查看: 3730|回复: 1

[有事请教] 请问关于游戏手柄按键绑定

[复制链接]
梦石
0
星屑
3930
在线时间
1198 小时
注册时间
2016-8-9
回帖
2355

开拓者

发表于 2018-10-31 13:32:48 | 显示全部楼层 |阅读模式
悬赏100星屑未解决
本帖最后由 白嫩白嫩的 于 2018-11-5 17:02 编辑

2018-11-05

修改了410行的i < 6   把6改到和需要的按钮数一致,可以显示新的设置行了,但是这行并不是显示的attack,而是undefined,没有正确定义



=======================================

用了yep插件里的GamepadConfig.js  ,游戏里需要用到的上下左右,取消,确认,上翻页下翻页都有了,但是我自己增加了的游戏功能:

比如跳跃之类的新内容,我在脚本里仿照别的按钮新增了attack,结果在插件里写出来也无法体现到设置菜单内,不知道怎么回事,哎,还是怪我是个脚本盲。。。

所以跪求大神指点,比如能否给手柄按键绑定到公共事件,或者手柄按键绑定键盘的某个按键也可以,

谢谢啦

对了,所有按键都被占用了,不要说为什么不用上翻页下翻页了




  1. //=============================================================================
  2. // Yanfly Engine Plugins - Gamepad Config
  3. // GamepadConfig.js
  4. // Version: 1.01
  5. //=============================================================================

  6. var Imported = Imported || {};
  7. Imported.GamepadConfig = true;

  8. var Yanfly = Yanfly || {};
  9. Yanfly.GamepadConfig = Yanfly.GamepadConfig || {};
  10. Yanfly.GamepadConfig.version = 1.01;

  11. //=============================================================================
  12. /*:
  13. * @plugindesc v1.01 Allows players to adjust their button configuration
  14. * for gamepads.
  15. * @author Yanfly Engine Plugins
  16. *
  17. * @param Command Name
  18. * @desc This is the option name that appears in the main menu.
  19. * @default Gamepad Config
  20. *
  21. * @param Button Name
  22. * @desc This is how a button name will appear in the config menu.
  23. * @default Button %1
  24. *
  25. * @param OK Button
  26. * @desc This is the command name for the OK button.
  27. * @default OK / Talk
  28. *
  29. * @param OK Help
  30. * @desc This is the help description for the OK button.
  31. * @default Used to accept menu actions and talk to people.
  32. *
  33. * @param Cancel Button
  34. * @desc Cancel Button
  35. * @desc This is the command name for the Cancel button.
  36. * @default Cancel
  37. *
  38. * @param Cancel Help
  39. * @desc This is the help description for the Cancel button.
  40. * @default Used to cancel menu actions.
  41. *
  42. * @param Shift Button
  43. * @desc This is the command name for the Shift button.
  44. * @default Dash
  45. *
  46. * @param Shift Help
  47. * @desc This is the help description for the Shift button.
  48. * @default Hold this button to dash on the field.
  49. *
  50. * @param Menu Button
  51. * @desc This is the command name for the Menu button.
  52. * @default Menu
  53. *
  54. * @param Menu Help
  55. * @desc This is the help description for the Menu button.
  56. * @default Access the Main Menu from the field.
  57. *
  58. * @param PageUp Button
  59. * @desc This is the command name for the Page Up button.
  60. * @default Page Up
  61. *
  62. * @param PageUp Help
  63. * @desc This is the help description for the Page Up button.
  64. * @default Use it to quickly scroll up menus.
  65. *
  66. * @param PageDown Button
  67. * @desc This is the command name for the Page Down button.
  68. * @default Page Down
  69. *
  70. * @param PageDown Help
  71. * @desc This is the help description for the Page Down button.
  72. * @default Use it to quickly scroll down menus.
  73. *
  74. * @param Reset Default
  75. * @desc This is the command name to reset the config to default.
  76. * @default Reset to Default
  77. *
  78. * @param Reset Help
  79. * @desc This is the help description for the Reset button.
  80. * @default Returns your controller to default settings.
  81. *
  82. * @param Finish Config
  83. * @desc This is the command name for the finish button.
  84. * @default Finish Configuration
  85. *
  86. * @param Finish Help
  87. * @desc This is the help description for the Finish button.
  88. * @default Are you done configuring your gamepad?
  89. *
  90. * @param Attack Button
  91. * @desc This is the command name for the Attack button.
  92. * @default Attack
  93. *
  94. * @param Attack Help
  95. * @desc This is the help description for the Attack button.
  96. * @default Used to Attack.
  97. *
  98. * @help
  99. * Adds a "Gamepad Config" option to the Options Menu if a gamepad is detected.
  100. * Players can then adjust the button configuration to their liking and it will
  101. * be loaded automatically each time they play the game. Keep in mind that if
  102. * at any point where a Gamepad is not detected inside of the Option or Gamepad
  103. * Config menu, the game will automatically eject the player out the prevent
  104. * the player from being locked inside.
  105. *
  106. * ============================================================================
  107. * Options Core Settings - Adding the New Options
  108. * ============================================================================
  109. *
  110. * If you are using YEP_OptionsCore.js, you can add a new Option using this
  111. * plugin. Here's the following code/parameter settings you can use with it.
  112. *
  113. * ---------
  114. * Settings:
  115. * ---------
  116. *
  117. * Name:
  118. * \i[83]Gamepad Config
  119. *
  120. * Help Description:
  121. * Configure the game's gamepad settings.
  122. *
  123. * Symbol:
  124. * gamepadConfig
  125. *
  126. * Show/Hide:
  127. * if (Imported.GamepadConfig && Input.isControllerConnected()) {
  128. *   show = !Utils.isMobileDevice();
  129. * } else {
  130. *   show = false;
  131. * }
  132. *
  133. * Enable:
  134. * enabled = true;
  135. *
  136. * Ext:
  137. * ext = 0;
  138. *
  139. * ----------
  140. * Functions:
  141. * ----------
  142. *
  143. * Make Option Code:
  144. * this.addCommand(name, symbol, enabled, ext);
  145. *
  146. * Draw Option Code:
  147. * var rect = this.itemRectForText(index);
  148. * var statusWidth = this.statusWidth();
  149. * var titleWidth = rect.width - statusWidth;
  150. * this.resetTextColor();
  151. * this.changePaintOpacity(this.isCommandEnabled(index));
  152. * this.drawOptionsName(index);
  153. *
  154. * Process OK Code:
  155. * this.playOkSound();
  156. * SceneManager.push(Scene_GamepadConfig);
  157. *
  158. * Cursor Right Code:
  159. * // Empty. Provided by this plugin.
  160. *
  161. * Cursor Left Code:
  162. * // Empty. Provided by this plugin.
  163. *
  164. * Default Config Code:
  165. * // Empty. Provided by this plugin.
  166. *
  167. * Save Config Code:
  168. * // Empty. Provided by this plugin.
  169. *
  170. * Load Config Code:
  171. * // Empty. Provided by this plugin.
  172. *
  173. * ============================================================================
  174. * Changelog
  175. * ============================================================================
  176. *
  177. * Version 1.01:
  178. * - Compatibility update with YEP_OptionsCore.js!
  179. *
  180. * Version 1.00:
  181. * - Finished Plugin!
  182. */
  183. //=============================================================================

  184. //=============================================================================
  185. // Parameter Variables
  186. //=============================================================================

  187. Yanfly.Parameters = PluginManager.parameters('GamepadConfig');
  188. Yanfly.Param = Yanfly.Param || {};

  189. Yanfly.Param.GamepadConfigName = String(Yanfly.Parameters['Command Name']);
  190. Yanfly.Param.GamepadConfigButton = String(Yanfly.Parameters['Button Name']);
  191. Yanfly.Param.GamepadConfigOkTx = String(Yanfly.Parameters['OK Button']);
  192. Yanfly.Param.GamepadConfigOkHelp = String(Yanfly.Parameters['OK Help']);
  193. Yanfly.Param.GamepadConfigCancelTx = String(Yanfly.Parameters['Cancel Button']);
  194. Yanfly.Param.GamepadConfigCancelHelp = String(Yanfly.Parameters['Cancel Help']);
  195. Yanfly.Param.GamepadConfigShiftTx = String(Yanfly.Parameters['Shift Button']);
  196. Yanfly.Param.GamepadConfigShiftHelp = String(Yanfly.Parameters['Shift Help']);
  197. Yanfly.Param.GamepadConfigMenuTx = String(Yanfly.Parameters['Menu Button']);
  198. Yanfly.Param.GamepadConfigMenuHelp = String(Yanfly.Parameters['Menu Help']);
  199. Yanfly.Param.GamepadConfigPgUpTx = String(Yanfly.Parameters['PageUp Button']);
  200. Yanfly.Param.GamepadConfigPgUpHelp = String(Yanfly.Parameters['PageUp Help']);
  201. Yanfly.Param.GamepadConfigPgDnTx = String(Yanfly.Parameters['PageDown Button']);
  202. Yanfly.Param.GamepadConfigPgDnHelp = String(Yanfly.Parameters['PageDown Help']);
  203. Yanfly.Param.GamepadConfigResetTx = String(Yanfly.Parameters['Reset Default']);
  204. Yanfly.Param.GamepadConfigResetHelp = String(Yanfly.Parameters['Reset Help']);
  205. Yanfly.Param.GamepadConfigFinishTx = String(Yanfly.Parameters['Finish Config']);
  206. Yanfly.Param.GamepadConfigFinishHelp = String(Yanfly.Parameters['Finish Help']);
  207. Yanfly.Param.GamepadConfigAttackTx = String(Yanfly.Parameters['Attack Button']);
  208. Yanfly.Param.GamepadConfigAttackHelp = String(Yanfly.Parameters['Attack Help']);

  209. //=============================================================================
  210. // Input
  211. //=============================================================================

  212. Input.getPressedGamepadButton = function() {
  213.         if (Yanfly.Param.GamepadTimer > 0) {
  214.                 Yanfly.Param.GamepadTimer -= 1;
  215.                 return -1;
  216.         }
  217.         if (navigator.getGamepads) {
  218.                 var gamepads = navigator.getGamepads();
  219.                 if (gamepads) {
  220.                         for (var i = 0; i < gamepads.length; i++) {
  221.                                 var gamepad = gamepads[i];
  222.                                 if (gamepad && gamepad.connected) {
  223.                                         return this.gamepadButtonId(gamepad);
  224.                                 }
  225.                         }
  226.                 }
  227.   }
  228.         return -1;
  229. };

  230. Input.gamepadButtonId = function(gamepad) {
  231.   var buttons = gamepad.buttons;
  232.   for (var i = 0; i < buttons.length; i++) {
  233.     if (buttons[i].pressed) return i;
  234.   }
  235.         return -1;
  236. };

  237. Input.getGamepadButton = function(type) {
  238.         for (var i = 0; i < 12; ++i) {
  239.                 if (Input.gamepadMapper[i] === type) return i;
  240.         }
  241.         return null;
  242. };

  243. Input.isControllerConnected = function() {
  244.         if (navigator.getGamepads) {
  245.                 var gamepads = navigator.getGamepads();
  246.                 if (gamepads) {
  247.                         for (var i = 0; i < gamepads.length; i++) {
  248.                                 var gamepad = gamepads[i];
  249.                                 if (gamepad && gamepad.connected) return true;
  250.                         }
  251.                 }
  252.         }
  253.         return false;
  254. };

  255. //=============================================================================
  256. // ConfigManager
  257. //=============================================================================

  258. ConfigManager.gamepadInput = {
  259.         0: 'ok',
  260.         1: 'cancel',
  261.         2: 'shift',
  262.         3: 'menu',
  263.         4: 'pageup',
  264.         5: 'pagedown',
  265.         12: 'up',
  266.         13: 'down',
  267.         14: 'left',
  268.         15: 'right',
  269.         9: 'attack',
  270. };

  271. Yanfly.GamepadConfig.ConfigManager_makeData = ConfigManager.makeData;
  272. ConfigManager.makeData = function() {
  273.   var config = Yanfly.GamepadConfig.ConfigManager_makeData.call(this);
  274.         config.gamepadInput = this.gamepadInput;
  275.         return config;
  276. };

  277. Yanfly.GamepadConfig.ConfigManager_applyData = ConfigManager.applyData;
  278. ConfigManager.applyData = function(config) {
  279.   Yanfly.GamepadConfig.ConfigManager_applyData.call(this, config);
  280.         this.gamepadInput = this.readGamepadConfig(config, 'gamepadInput');
  281.         this.applyGamepadConfig();
  282. };

  283. ConfigManager.applyGamepadConfig = function() {
  284.         Input.gamepadMapper = this.gamepadInput;
  285.         Input.update();
  286.         Input.clear();
  287. };

  288. ConfigManager.readGamepadConfig = function(config, name) {
  289.     var value = config[name];
  290.     if (value !== undefined) {
  291.         return value;
  292.     } else {
  293.         return {
  294.                                         0: 'ok',
  295.                                         1: 'cancel',
  296.                                         2: 'shift',
  297.                                         3: 'menu',
  298.                                         4: 'pageup',
  299.                                         5: 'pagedown',
  300.                                         12: 'up',
  301.                                         13: 'down',
  302.                                         14: 'left',
  303.                                         15: 'right',
  304.                                         9: 'attack',
  305.                                 };
  306.     }
  307. };

  308. //=============================================================================
  309. // Window_Options
  310. //=============================================================================

  311. Yanfly.GamepadConfig.Window_Options_addGeneralOptions =
  312.         Window_Options.prototype.addGeneralOptions;
  313. Window_Options.prototype.addGeneralOptions = function() {
  314.   Yanfly.GamepadConfig.Window_Options_addGeneralOptions.call(this);
  315.   if (!Imported.YEP_OptionsCore) this.addGameConfigCommand();
  316. };

  317. Window_Options.prototype.addGameConfigCommand = function() {
  318.         if (Input.isControllerConnected()) {
  319.                 this.addCommand(Yanfly.Param.GamepadConfigName, 'gamepadConfig', true);
  320.                 this._addedController = true;
  321.         }
  322. };

  323. Yanfly.GamepadConfig.Window_Options_update =
  324.         Window_Options.prototype.update;
  325. Window_Options.prototype.update = function() {
  326.         Yanfly.GamepadConfig.Window_Options_update.call(this);
  327.         if (this._addedController && !Input.isControllerConnected()) {
  328.                 this.refresh();
  329.                 this.height = this.windowHeight();
  330.                 this.updatePlacement();
  331.         }
  332. };

  333. if (!Imported.YEP_OptionsCore) {

  334. Yanfly.GamepadConfig.Window_Options_drawItem =
  335.         Window_Options.prototype.drawItem;
  336. Window_Options.prototype.drawItem = function(index) {
  337.     if (this.commandSymbol(index) === 'gamepadConfig') {
  338.                         var rect = this.itemRectForText(index);
  339.                         var text = this.commandName(index);
  340.             this.resetTextColor();
  341.             this.changePaintOpacity(this.isCommandEnabled(index));
  342.             this.drawText(text, rect.x, rect.y, rect.width, 'left');
  343.                 } else {
  344.                         Yanfly.GamepadConfig.Window_Options_drawItem.call(this, index);
  345.                 }
  346. };

  347. Yanfly.GamepadConfig.Window_Options_processOk =
  348.         Window_Options.prototype.processOk;
  349. Window_Options.prototype.processOk = function() {
  350.   if (this.commandSymbol(this.index()) === 'gamepadConfig') {
  351.                 Window_Command.prototype.processOk.call(this);
  352.         } else {
  353.                 Yanfly.GamepadConfig.Window_Options_processOk.call(this);
  354.         }
  355. };

  356. }; // Imported.YEP_OptionsCore


  357. //=============================================================================
  358. // Window_GamepadConfig
  359. //=============================================================================

  360. function Window_GamepadConfig() {
  361.     this.initialize.apply(this, arguments);
  362. }

  363. Window_GamepadConfig.prototype = Object.create(Window_Command.prototype);
  364. Window_GamepadConfig.prototype.constructor = Window_GamepadConfig;

  365. Window_GamepadConfig.prototype.initialize = function(helpWindow) {
  366.         var wy = helpWindow.height;
  367.         Window_Command.prototype.initialize.call(this, 0, wy);
  368.   this.setHelpWindow(helpWindow);
  369.         this.height = Graphics.boxHeight - wy;
  370.         this.refresh();
  371.         this.activate();
  372.         this.select(0);
  373. };

  374. Window_GamepadConfig.prototype.windowWidth = function() {
  375.     return Graphics.boxWidth;
  376. };

  377. Window_GamepadConfig.prototype.makeCommandList = function(index) {
  378.         for (var i = 0; i < 6; ++i) {
  379.                 var text = this.getButtonTypeText(i);
  380.                 this.addCommand(text, 'button', true);
  381.         }
  382.         this.addCommand('', 'filler', true);
  383.         this.addCommand(this.getButtonTypeText(7), 'reset', true);
  384.         this.addCommand(this.getButtonTypeText(8), 'finish', true);
  385. };

  386. Window_GamepadConfig.prototype.drawItem = function(index) {
  387.         if (index > 5) {
  388.                 Window_Command.prototype.drawItem.call(this, index);
  389.         } else {
  390.                 var rect = this.itemRectForText(index);
  391.     var align = this.itemTextAlign();
  392.                 var ww = rect.width / 2;
  393.     this.resetTextColor();
  394.     this.changePaintOpacity(this.isCommandEnabled(index));
  395.                 this.drawText(this.commandName(index), rect.x, rect.y, ww, align);
  396.                 var text = this.getButtonConfig(index);
  397.                 this.drawText(text, rect.x + ww, rect.y, ww, align);
  398.         }
  399. };

  400. Window_GamepadConfig.prototype.getButtonTypeText = function(index) {
  401.         if (index === 0) return Yanfly.Param.GamepadConfigOkTx;
  402.         if (index === 1) return Yanfly.Param.GamepadConfigCancelTx;
  403.         if (index === 2) return Yanfly.Param.GamepadConfigShiftTx;
  404.         if (index === 3) return Yanfly.Param.GamepadConfigMenuTx;
  405.         if (index === 4) return Yanfly.Param.GamepadConfigPgUpTx;
  406.         if (index === 5) return Yanfly.Param.GamepadConfigPgDnTx;
  407.         if (index === 7) return Yanfly.Param.GamepadConfigResetTx;
  408.         if (index === 8) return Yanfly.Param.GamepadConfigFinishTx;
  409.         if (index === 9) return Yanfly.Param.GamepadConfigAttackTx;
  410.         return '';
  411. };

  412. Window_GamepadConfig.prototype.getButtonConfig = function(index) {
  413.         if (index > 20) return '';
  414.         var key = this.getButtonKey(index);
  415.         var button = Input.getGamepadButton(key);
  416.   return Yanfly.Param.GamepadConfigButton.format(button);
  417. };

  418. Window_GamepadConfig.prototype.getButtonKey = function(index) {
  419.         if (index === 0) return 'ok';
  420.         if (index === 1) return 'cancel';
  421.         if (index === 2) return 'shift';
  422.         if (index === 3) return 'menu';
  423.         if (index === 4) return 'pageup';
  424.         if (index === 5) return 'pagedown';
  425.         if (index === 9) return 'Attack';
  426. };

  427. Window_GamepadConfig.prototype.itemTextAlign = function() {
  428.     return 'center';
  429. };

  430. Window_GamepadConfig.prototype.clearButtonConfig = function(index) {
  431.     var rect = this.itemRectForText(index);
  432.                 rect.x += rect.width / 2;
  433.                 rect.width /= 2;
  434.                 this.contents.clearRect(rect.x, rect.y, rect.width, rect.height);
  435. };

  436. Window_GamepadConfig.prototype.updateHelp = function() {
  437.     if (!this._helpWindow) return;
  438.                 switch (this.index()) {
  439.                 case 0:
  440.                         this._helpWindow.setText(Yanfly.Param.GamepadConfigOkHelp);
  441.                         break;
  442.                 case 1:
  443.                         this._helpWindow.setText(Yanfly.Param.GamepadConfigCancelHelp);
  444.                         break;
  445.                 case 2:
  446.                         this._helpWindow.setText(Yanfly.Param.GamepadConfigShiftHelp);
  447.                         break;
  448.                 case 3:
  449.                         this._helpWindow.setText(Yanfly.Param.GamepadConfigMenuHelp);
  450.                         break;
  451.                 case 4:
  452.                         this._helpWindow.setText(Yanfly.Param.GamepadConfigPgUpHelp);
  453.                         break;
  454.                 case 5:
  455.                         this._helpWindow.setText(Yanfly.Param.GamepadConfigPgDnHelp);
  456.                         break;
  457.                 case 7:
  458.                         this._helpWindow.setText(Yanfly.Param.GamepadConfigResetHelp);
  459.                         break;
  460.                 case 8:
  461.                         this._helpWindow.setText(Yanfly.Param.GamepadConfigFinishHelp);
  462.                         break;
  463.                 case 9:
  464.                         this._helpWindow.setText(Yanfly.Param.GamepadConfigAttackHelp);
  465.                         break;
  466.                 default:
  467.                         this._helpWindow.clear();
  468.                         break;
  469.                 }
  470. };

  471. //=============================================================================
  472. // Scene_Options
  473. //=============================================================================

  474. Yanfly.GamepadConfig.Scene_Options_createOptionsWindow =
  475.         Scene_Options.prototype.createOptionsWindow;
  476. Scene_Options.prototype.createOptionsWindow = function() {
  477.   Yanfly.GamepadConfig.Scene_Options_createOptionsWindow.call(this);
  478.         this._optionsWindow.setHandler('gamepadConfig',
  479.                 this.commandGamepadConfig.bind(this));
  480. };

  481. Scene_Options.prototype.commandGamepadConfig = function() {
  482.         SceneManager.push(Scene_GamepadConfig);
  483. };

  484. //=============================================================================
  485. // Scene_GamepadConfig
  486. //=============================================================================

  487. function Scene_GamepadConfig() {
  488.   this.initialize.apply(this, arguments);
  489. }

  490. Scene_GamepadConfig.prototype = Object.create(Scene_MenuBase.prototype);
  491. Scene_GamepadConfig.prototype.constructor = Scene_GamepadConfig;

  492. Scene_GamepadConfig.prototype.initialize = function() {
  493.   Scene_MenuBase.prototype.initialize.call(this);
  494. };

  495. Scene_GamepadConfig.prototype.create = function() {
  496.   Scene_MenuBase.prototype.create.call(this);
  497.   this.createHelpWindow();
  498.         this.createGamepadConfigWindow();
  499. };

  500. Scene_GamepadConfig.prototype.terminate = function() {
  501.   Scene_MenuBase.prototype.terminate.call(this);
  502.   ConfigManager.save();
  503. };

  504. Scene_GamepadConfig.prototype.update = function() {
  505.   Scene_MenuBase.prototype.update.call(this);
  506.         this.updateAttachedController();
  507.         this.updateButtonConfig();
  508.         this.updateAfterConfig();
  509. };

  510. Scene_GamepadConfig.prototype.updateAttachedController = function() {
  511.         if (Input.isControllerConnected()) return;
  512.         this.popScene();
  513. };

  514. Scene_GamepadConfig.prototype.createGamepadConfigWindow = function() {
  515.         this._configWindow = new Window_GamepadConfig(this._helpWindow);
  516.         this._configWindow.setHandler('button', this.commandButton.bind(this));
  517.         this._configWindow.setHandler('reset', this.commandReset.bind(this));
  518.         this._configWindow.setHandler('finish', this.popScene.bind(this));
  519.         this.addWindow(this._configWindow);
  520. };

  521. Scene_GamepadConfig.prototype.commandButton = function() {
  522.         var index = this._configWindow.index();
  523.         this._configWindow.clearButtonConfig(index);
  524.         this._configEnabled = true;
  525.         Yanfly.Param.GamepadTimer = 12;
  526. };

  527. Scene_GamepadConfig.prototype.commandReset = function() {
  528.         ConfigManager.gamepadInput = {
  529.                 0: 'ok',
  530.                 1: 'cancel',
  531.                 2: 'shift',
  532.                 3: 'menu',
  533.                 4: 'pageup',
  534.                 5: 'pagedown',
  535.                 12: 'up',
  536.                 13: 'down',
  537.                 14: 'left',
  538.                 15: 'right',
  539.                 9: 'attack',
  540.         };
  541.         ConfigManager.applyGamepadConfig();
  542.         this.refreshWindows();
  543. };

  544. Scene_GamepadConfig.prototype.refreshWindows = function() {
  545.         this._configWindow.refresh();
  546.         this._configWindow.activate();
  547.         ConfigManager.save();
  548. };

  549. Scene_GamepadConfig.prototype.updateButtonConfig = function() {
  550.         if (!this._configEnabled) return;
  551.         var buttonId = Input.getPressedGamepadButton();
  552.         if (buttonId > 20) return;
  553.         if (buttonId >= 0) this.applyButtonConfig(buttonId);
  554. };

  555. Scene_GamepadConfig.prototype.applyButtonConfig = function(buttonId) {
  556.         this._configEnabled = false;
  557.         var index = this._configWindow.index();
  558.         var newConfig = this._configWindow.getButtonKey(index);
  559.         var formerConfig = Input.gamepadMapper[buttonId];
  560.         var formerButton = Input.getGamepadButton(newConfig);
  561.         ConfigManager.gamepadInput[buttonId] = newConfig;
  562.         ConfigManager.gamepadInput[formerButton] = formerConfig;
  563.         ConfigManager.applyGamepadConfig();
  564.         this._configTimer = 12;
  565. };

  566. Scene_GamepadConfig.prototype.updateAfterConfig = function() {
  567.         if (!this._configTimer) return;
  568.         if (--this._configTimer > 0) return;
  569.         SoundManager.playEquip();
  570.         this.refreshWindows();
  571. };

  572. //=============================================================================
  573. // End of File
  574. //=============================================================================
复制代码

酸酸甜甜就④哇噢
梦石
0
星屑
3930
在线时间
1198 小时
注册时间
2016-8-9
回帖
2355

开拓者

 楼主| 发表于 2018-11-8 01:04:07 | 显示全部楼层
自己摸索完成了,不用这个插件了,直接调用rpgcore的函数就可以了
酸酸甜甜就④哇噢
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部