1 Star 0 Fork 0

noahwang/MV

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
RS_EventTouch.js 1.65 KB
一键复制 编辑 原始数据 按行查看 历史
biud436 提交于 2017-01-31 00:21 . .
/*:
* RS_EventTouch.js
* @plugindesc This plugin allows you to execute the event when you are clicking
* the event.
* @author biud436
*
* @param Event Regex
* @desc this parameter define a RegExp
* @default /Event[ ]*Click/ig
*
* @help
* 1. Adding the command called 'Comment' into the event
* 2. The event's setup is simplify. It is done that you are to enter the comment
* called 'Event Click' into the event's list.
*
* - Change Log
* 2016.07.03 (v1.0.0) - First Release
* 2017.01.30 (v1.0.1) - Fixed the bug that is not working when using event starting conditions
* 2017.01.31 (v1.0.2) - Fixed the bug is not working this plugin properly
*/
var Imported = Imported || {};
Imported.RS_EventTouch = true;
(function () {
var parameters = PluginManager.parameters('RS_EventTouch');
var regex = eval(parameters['Event Regex']) || /Event[ ]*Click/ig;
Game_Map.prototype.executeTouchEvent = function() {
var x, y, id, lEvent;
if(TouchInput.isTriggered()) {
x = $gameMap.canvasToMapX(TouchInput._x),
y = $gameMap.canvasToMapY(TouchInput._y),
id = $gameMap.eventIdXy(x, y);
lEvent = this.event(id);
if(!lEvent) return false;
if(lEvent.findProperPageIndex() < 0) return false;
lEvent.list().forEach(function(i) {
if(i.code === 108 || i.code === 408) {
if( i.parameters[0].match(regex) ) {
if(lEvent._trigger < 3) lEvent.start();
}
}
}, this);
}
};
var alias_Game_Map_update = Game_Map.prototype.update;
Game_Map.prototype.update = function(sceneActive) {
alias_Game_Map_update.call(this, sceneActive);
this.executeTouchEvent();
};
})();
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/inoah/MV.git
git@gitee.com:inoah/MV.git
inoah
MV
MV
master

搜索帮助