大概就这样吧。用法什么的问你们自家程序。当然触发的条件请随意更改~
void function() { function hackMethod(methodName) { var old = Input[methodName]; Input[methodName] = function(keyName) { return (keyName === 'ok' && $gameSwitches && $gameSwitches.value(1) > 0) || old.call(this, keyName); } } hackMethod('isTriggered'); hackMethod('isPressed'); hackMethod('isRepeated'); }();
void function() {
function hackMethod(methodName) {
var old = Input[methodName];
Input[methodName] = function(keyName) {
return (keyName === 'ok' && $gameSwitches && $gameSwitches.value(1) > 0) || old.call(this, keyName);
}
}
hackMethod('isTriggered');
hackMethod('isPressed');
hackMethod('isRepeated');
}();
|