Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*:
- * @plugindesc Plugin for kanji illustrator. key press induces a common event
- * @version 1.0
- @param Key A
- @desc The common event to play when A is pressed.
- Use 0 to have that not trigger a common event.
- @default 0
- @param Key B
- @desc The common event to play when B is pressed.
- Use 0 to have that not trigger a common event.
- @default 0
- @param Key K
- @desc The common event to play when K is pressed.
- Use 0 to have that not trigger a common event.
- @default 0
- */
- //Name this file XGD_KeyPress.js
- var parameters = PluginManager.parameters('XGD_KeyPress');
- (function ($) {
- var XGD_PluginEvent = Input._onKeyUp;
- Input._onKeyUp = function(event) {
- XGD_PluginEvent.call(this, event);
- switch (event.keyCode)
- {
- case 65: PerformCommonEvent('Key A'); break;
- case 66: PerformCommonEvent('Key B'); break;
- case 75: PerformCommonEvent('Key K'); break;
- }
- };
- PerformCommonEvent = function(p) {
- var e = Number(parameters[p] || 0);
- if (e !== 0)
- $gameTemp.reserveCommonEvent(e);
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment