How to use setHandler method in storybook-root

Best JavaScript code snippet using storybook-root

DrXama_multiplayerLocal.js

Source:DrXama_multiplayerLocal.js Github

copy

Full Screen

...665 };666667 Scene_menuMultiplayerLocal.prototype.createMenuWindow = function () {668 this._menuWindow = new Window_menuMultiplayerLocal();669 this._menuWindow.setHandler('gamepadConfig', this.showSelectGamepad.bind(this));670 this._menuWindow.setHandler('keyboardConfig', this.showKeyboardSettings.bind(this));671 this._menuWindow.setHandler('cancel', this.popScene.bind(this));672 this.addWindow(this._menuWindow);673 };674675 Scene_menuMultiplayerLocal.prototype.createSelectGamepadWindow = function () {676 this._selectGamepadWindow = new Window_selectGamePadMultiplayerLocal();677 this.addWindow(this._selectGamepadWindow);678 };679680 Scene_menuMultiplayerLocal.prototype.createKeyboardSettingsWindow = function () {681 this._keyboardSettingsWindow = new Window_keyboardSettings(this._menuWindow.standardPadding() * 2, this._menuWindow.itemHeight() * 2 + this._menuWindow.standardPadding() * 4);682 this._menuWindow.addChild(this._keyboardSettingsWindow);683 };684685 Scene_menuMultiplayerLocal.prototype.showSelectGamepad = function () {686 this._menuWindow.hide();687 this._selectGamepadWindow.refresh();688 this._selectGamepadWindow.show();689 };690691 Scene_menuMultiplayerLocal.prototype.hideSelectGamepad = function () {692 this._selectGamepadWindow.hide();693 this._menuWindow.activate();694 this._menuWindow.show();695 };696697 Scene_menuMultiplayerLocal.prototype.showKeyboardSettings = function () {698 this._keyboardSettingsWindow.show();699 this._keyboardSettingsWindow.activate();700 };701702 Scene_menuMultiplayerLocal.prototype.hideKeyboardSettings = function () {703 this._keyboardSettingsWindow.deactivate();704 this._keyboardSettingsWindow.hide();705 this._menuWindow.activate();706 };707708 //-----------------------------------------------------------------------------709 // Window_menuMultiplayerLocal710 //711 function Window_menuMultiplayerLocal() {712 this.initialize.apply(this, arguments);713 }714715 Window_menuMultiplayerLocal.prototype = Object.create(Window_Command.prototype);716 Window_menuMultiplayerLocal.prototype.constructor = Window_menuMultiplayerLocal;717718 Window_menuMultiplayerLocal.prototype.initialize = function () {719 Window_Command.prototype.initialize.call(this, 0, 0);720 this.loadImages();721 };722723 Window_menuMultiplayerLocal.prototype.loadImages = function () {724 ImageManager.reserveMultiplayerLocalIMG('menu');725 };726727 Window_menuMultiplayerLocal.prototype.windowWidth = function () {728 return Graphics.boxWidth;729 };730731 Window_menuMultiplayerLocal.prototype.windowHeight = function () {732 return Graphics.boxHeight;733 };734735 Window_menuMultiplayerLocal.prototype.numVisibleRows = function () {736 return 4;737 };738739 Window_menuMultiplayerLocal.prototype.itemHeight = function () {740 var clientHeight = this.windowHeight() - (this.standardPadding() - 12) * 2;741 return Math.floor(clientHeight / this.numVisibleRows());742 };743744 Window_menuMultiplayerLocal.prototype.makeCommandList = function () {745 this.addMainCommands();746 };747748 Window_menuMultiplayerLocal.prototype.addMainCommands = function () {749 this.addCommand('Configurar os controles', 'gamepadConfig');750 this.addCommand('Configurar o teclado', 'keyboardConfig');751 };752753 Window_menuMultiplayerLocal.prototype.drawItem = function (index) {754 this.drawItemImage(index);755 this.drawItemText(index);756 };757758 Window_menuMultiplayerLocal.prototype.drawItemImage = function (index) {759 var rect = this.itemRect(index);760 this.drawIMG('menu', index, rect.x + 12, rect.y + 5);761 };762763 Window_menuMultiplayerLocal.prototype.drawItemText = function (index) {764 var rect = this.itemRectForText(index);765 var align = this.itemTextAlign();766 this.resetTextColor();767 this.changePaintOpacity(this.isCommandEnabled(index));768 this.drawText(this.commandName(index), rect.x + 155, rect.y + 25, rect.width, align);769 };770771 Window_menuMultiplayerLocal.prototype.drawIMG = function (file, index, x, y, width, height) {772 width = width || 144;773 height = height || 144;774 var bitmap = ImageManager.loadMultiplayerLocalIMG(file);775 var pw = 144;776 var ph = 144;777 var sw = Math.min(width, pw);778 var sh = Math.min(height, ph);779 var dx = Math.floor(x + Math.max(width - pw, 0) / 2);780 var dy = Math.floor(y + Math.max(height - ph, 0) / 2);781 var sx = index % 4 * pw + (pw - sw) / 2;782 var sy = Math.floor(index / 4) * ph + (ph - sh) / 2;783 this.contents.blt(bitmap, sx, sy, sw, sh, dx, dy);784 };785786 //-----------------------------------------------------------------------------787 // Window_selectGamePadMultiplayerLocal788 //789 function Window_selectGamePadMultiplayerLocal() {790 this.initialize.apply(this, arguments);791 }792793 Window_selectGamePadMultiplayerLocal.prototype = Object.create(Window_Base.prototype);794 Window_selectGamePadMultiplayerLocal.prototype.constructor = Window_selectGamePadMultiplayerLocal;795796 Window_selectGamePadMultiplayerLocal.prototype.initialize = function () {797 Window_Base.prototype.initialize.call(this, 0, 0, this.windowWidth(), this.windowHeight());798 this.deactivate();799 this.hide();800 this.loadImages();801 };802803 Window_selectGamePadMultiplayerLocal.prototype.loadImages = function () {804 ImageManager.reserveMultiplayerLocalIMG('selectGamepad');805 };806807 Window_selectGamePadMultiplayerLocal.prototype.windowWidth = function () {808 return Graphics.boxWidth;809 };810811 Window_selectGamePadMultiplayerLocal.prototype.windowHeight = function () {812 return Graphics.boxHeight;813 };814815 Window_selectGamePadMultiplayerLocal.prototype.refresh = function () {816 this.contents.clear();817 this.changeTextColor(this.systemColor());818 var fontSize = this.contents.fontSize;819 // CONTROLE 1820 this.drawIMG('selectGamepad', 0, 5, 5);821 this.contents.fontSize = 18;822 this.drawText('Controle', 39, 17, this.windowWidth(), 'left');823 this.contents.fontSize = fontSize;824 this.drawText('1', 70, 68, this.windowWidth(), 'left');825 this.drawText(this.commandGamepad(Input._gamepadOrder[0]), 162, 62, this.windowWidth(), 'left');826 // CONTROLE 2827 this.drawIMG('selectGamepad', 1, 5, 162);828 this.contents.fontSize = 18;829 this.drawText('Controle', 39, 174, this.windowWidth(), 'left');830 this.contents.fontSize = fontSize;831 this.drawText('2', 70, 225, this.windowWidth(), 'left');832 this.drawText(this.commandGamepad(Input._gamepadOrder[1]), 162, 222, this.windowWidth(), 'left');833 // CONTROLE 3834 this.drawIMG('selectGamepad', 2, this.windowWidth() - 192, 5);835 this.contents.fontSize = 18;836 this.drawText('Controle', -87, 17, this.windowWidth(), 'right');837 this.contents.fontSize = fontSize;838 this.drawText('3', -112, 68, this.windowWidth(), 'right');839 this.drawText(this.commandGamepad(Input._gamepadOrder[2]), -206, 62, this.windowWidth(), 'right');840 // CONTROLE 4841 this.drawIMG('selectGamepad', 3, this.windowWidth() - 192, 162);842 this.contents.fontSize = 18;843 this.drawText('Controle', -87, 174, this.windowWidth(), 'right');844 this.contents.fontSize = fontSize;845 this.drawText('4', -112, 225, this.windowWidth(), 'right');846 this.drawText(this.commandGamepad(Input._gamepadOrder[3]), -206, 222, this.windowWidth(), 'right');847 // Divisor Vertical848 this.changePaintOpacity(false);849 this.contents.fillRect(this.windowWidth() / 2 - this.standardPadding(), 5, 1, 312, 'white');850 this.changePaintOpacity(true);851 // Divisor Horizontal852 this.changePaintOpacity(false);853 this.contents.fillRect(5, 335, this.windowWidth() - (this.standardPadding() * 2 + this.textPadding() * 2), 1, 'white');854 this.changePaintOpacity(true);855 this.createWindowOptions();856 };857858 Window_selectGamePadMultiplayerLocal.prototype.commandGamepad = function (gamepadIndex) {859 switch (String(gamepadIndex).toLowerCase()) {860 case 'player_1':861 return 'JOGADOR 1';862 case 'player_2':863 return 'JOGADOR 2';864 case 'player_3':865 return 'JOGADOR 3';866 case 'player_4':867 return 'JOGADOR 4';868 };869 };870871 Window_selectGamePadMultiplayerLocal.prototype.drawIMG = function (file, index, x, y, width, height) {872 width = width || 144;873 height = height || 144;874 var bitmap = ImageManager.loadMultiplayerLocalIMG(file);875 var pw = 144;876 var ph = 144;877 var sw = Math.min(width, pw);878 var sh = Math.min(height, ph);879 var dx = Math.floor(x + Math.max(width - pw, 0) / 2);880 var dy = Math.floor(y + Math.max(height - ph, 0) / 2);881 var sx = index % 4 * pw + (pw - sw) / 2;882 var sy = Math.floor(index / 4) * ph + (ph - sh) / 2;883 this.contents.blt(bitmap, sx, sy, sw, sh, dx, dy);884 };885886 Window_selectGamePadMultiplayerLocal.prototype.createWindowOptions = function () {887 if (!this._windowOptions) {888 this._windowOptions = new Window_selectGamePadMultiplayerLocal_Options();889 this._windowOptions.setHandler('cancel', SceneManager._scene.hideSelectGamepad.bind(SceneManager._scene));890 this.addChild(this._windowOptions);891 } else {892 this._windowOptions.activate();893 this._windowOptions.show();894 }895 };896897 //-----------------------------------------------------------------------------898 // Window_selectGamePadMultiplayerLocal_Options899 //900 function Window_selectGamePadMultiplayerLocal_Options() {901 this.initialize.apply(this, arguments);902 }903904 Window_selectGamePadMultiplayerLocal_Options.prototype = Object.create(Window_Command.prototype);905 Window_selectGamePadMultiplayerLocal_Options.prototype.constructor = Window_selectGamePadMultiplayerLocal_Options;906907 Window_selectGamePadMultiplayerLocal_Options.prototype.initialize = function () {908 Window_Command.prototype.initialize.call(this, 25, 368);909 this.deactivate();910 this.hide();911 this.setBackgroundType(3);912 this.setHandlerMainCommands();913 this.createWindowButtonsChange();914 this.createWindowSetGamepad();915 };916917 Window_selectGamePadMultiplayerLocal_Options.prototype.windowWidth = function () {918 return Graphics.boxWidth - (this.standardPadding() * 2 + this.textPadding() * 2);919 };920921 Window_selectGamePadMultiplayerLocal_Options.prototype.windowHeight = function () {922 return 242;923 };924925 Window_selectGamePadMultiplayerLocal_Options.prototype.itemHeight = function () {926 var clientHeight = this.windowHeight() - this.standardPadding() * 2;927 return Math.floor(clientHeight / this.numVisibleRows());928 };929930 Window_selectGamePadMultiplayerLocal_Options.prototype.numVisibleRows = function () {931 return this.maxItems() > 1 ? 2 : 1;932 };933934 Window_selectGamePadMultiplayerLocal_Options.prototype.activate = function () {935 Window_Base.prototype.activate.call(this);936 this.select(0);937 };938939 Window_selectGamePadMultiplayerLocal_Options.prototype.makeCommandList = function () {940 this.addMainCommands();941 };942943 Window_selectGamePadMultiplayerLocal_Options.prototype.addMainCommands = function () {944 this.addCommand('Configuração de botáes', 'buttonsChange');945 this.addCommand('Atribuir Controles', 'setGamepad');946 };947948 Window_selectGamePadMultiplayerLocal_Options.prototype.drawItem = function (index) {949 this.drawItemText(index);950 };951952 Window_selectGamePadMultiplayerLocal_Options.prototype.drawItemText = function (index) {953 var rect = this.itemRectForText(index);954 var align = this.itemTextAlign();955 this.resetTextColor();956 this.changeTextColor(this.systemColor());957 this.changePaintOpacity(this.isCommandEnabled(index));958 this.drawText(this.commandName(index), rect.x + 1, rect.y + (rect.height / 2) - 20, rect.width, align);959 };960961 Window_selectGamePadMultiplayerLocal_Options.prototype.setHandlerMainCommands = function () {962 this.setHandler('buttonsChange', this.showWindowButtonsChange.bind(this));963 this.setHandler('setGamepad', this.showWindowSetGamepad.bind(this));964 };965966 Window_selectGamePadMultiplayerLocal_Options.prototype.createWindowButtonsChange = function () {967 this._windowButtonsChange = new Window_selectGamePadMultiplayerLocal_Options_buttonsChange();968 this._windowButtonsChange.setHandler('cancel', this.hideWindowButtonsChange.bind(this));969 SceneManager._scene.addChild(this._windowButtonsChange);970 };971972 Window_selectGamePadMultiplayerLocal_Options.prototype.showWindowButtonsChange = function () {973 this._windowButtonsChange.show();974 this._windowButtonsChange.refresh();975 this.parent.hide();976 };977978 Window_selectGamePadMultiplayerLocal_Options.prototype.hideWindowButtonsChange = function () {979 this._windowButtonsChange.hide();980 this.parent.refresh();981 this.parent.show();982 this.activate();983 };984985 Window_selectGamePadMultiplayerLocal_Options.prototype.createWindowSetGamepad = function () {986 this._windowSetGamepad = new Window_selectGamePadMultiplayerLocal_Options_setGamepad();987 this._windowSetGamepad.setHandler('cancel', this.hideWindowSetGamepad.bind(this));988 SceneManager._scene.addChild(this._windowSetGamepad);989 };990991 Window_selectGamePadMultiplayerLocal_Options.prototype.showWindowSetGamepad = function () {992 this._windowSetGamepad.show();993 this._windowSetGamepad.refresh();994 this.parent.hide();995 };996997 Window_selectGamePadMultiplayerLocal_Options.prototype.hideWindowSetGamepad = function () {998 this._windowSetGamepad.hide();999 this.parent.refresh();1000 this.parent.show();1001 this.activate();1002 };10031004 //-----------------------------------------------------------------------------1005 // Window_selectGamePadMultiplayerLocal_Options_buttonsChange1006 //1007 function Window_selectGamePadMultiplayerLocal_Options_buttonsChange() {1008 this.initialize.apply(this, arguments);1009 }10101011 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype = Object.create(Window_Command.prototype);1012 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype.constructor = Window_selectGamePadMultiplayerLocal_Options_buttonsChange;10131014 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype.initialize = function () {1015 Window_Command.prototype.initialize.call(this, 0, 0);1016 this.deactivate();1017 this.hide();1018 this.loadImages();1019 this.setHandlerMainCommands();1020 };10211022 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype.loadImages = function () {1023 ImageManager.reserveMultiplayerLocalIMG('selectGamepadButtons');1024 };10251026 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype.refresh = function () {1027 Window_Command.prototype.refresh.call(this);1028 this.activate();1029 this.drawHelpText();1030 this.createWindowSetValue();1031 this._cursorRectHide = null;1032 };10331034 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype.update = function () {1035 Window_Command.prototype.update.call(this);1036 this.updateHelpText();1037 };10381039 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype.windowWidth = function () {1040 return Graphics.boxWidth;1041 };10421043 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype.windowHeight = function () {1044 return Graphics.boxHeight;1045 };10461047 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype.numVisibleRows = function () {1048 return 4;1049 };10501051 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype.itemHeight = function () {1052 var clientHeight = this.windowHeight() - (this.standardPadding() - 12) * 2;1053 return Math.floor(clientHeight / this.numVisibleRows());1054 };10551056 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype.makeCommandList = function () {1057 this.addMainCommands();1058 };10591060 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype.addMainCommands = function () {1061 var textMenuSpecial = String(Input.gamepadMapper[11]).toLocaleLowerCase() === 'menumultiplayerlocal' ? 'MENU ESPECIAL' : String(Input.gamepadMapper[11]).toUpperCase();1062 this.addCommand(`Botão A - VALOR(${String(Input.gamepadMapper[0]).toUpperCase()})`, 'button_A');1063 this.addCommand(`Botão B - VALOR(${String(Input.gamepadMapper[1]).toUpperCase()})`, 'button_B');1064 this.addCommand(`Botão X - VALOR(${String(Input.gamepadMapper[2]).toUpperCase()})`, 'button_X');1065 this.addCommand(`Botão Y - VALOR(${String(Input.gamepadMapper[3]).toUpperCase()})`, 'button_Y');1066 this.addCommand(`Botão LB - VALOR(${String(Input.gamepadMapper[4]).toUpperCase()})`, 'button_LB');1067 this.addCommand(`Botão LT - VALOR(${String(Input.gamepadMapper[6]).toUpperCase()})`, 'button_LT');1068 this.addCommand(`Botão RB - VALOR(${String(Input.gamepadMapper[5]).toUpperCase()})`, 'button_RB');1069 this.addCommand(`Botão RT - VALOR(${String(Input.gamepadMapper[7]).toUpperCase()})`, 'button_RT');1070 this.addCommand(`Botão SELECT - VALOR(${String(Input.gamepadMapper[8]).toUpperCase()})`, 'button_SELECT');1071 this.addCommand(`Botão START - VALOR(${String(Input.gamepadMapper[9]).toUpperCase()})`, 'button_START');1072 this.addCommand(`A. Esquerdo Clique - VALOR(${String(Input.gamepadMapper[10]).toUpperCase()})`, 'button_ANALOGICO_ESQUERDO_CLIQUE');1073 this.addCommand(`A. Direito Clique - VALOR(${textMenuSpecial})`, 'button_ANALOGICO_DIREITO_CLIQUE');1074 this.addCommand(`D-pad Cima - VALOR(${String(Input.gamepadMapper[12]).toUpperCase()})`, 'button_DPAD_CIMA');1075 this.addCommand(`D-pad Baixo - VALOR(${String(Input.gamepadMapper[13]).toUpperCase()})`, 'button_DPAD_BAIXO');1076 this.addCommand(`D-pad Esquerda - VALOR(${String(Input.gamepadMapper[14]).toUpperCase()})`, 'button_DPAD_ESQUERDA');1077 this.addCommand(`D-pad Direita - VALOR(${String(Input.gamepadMapper[15]).toUpperCase()})`, 'button_DPAD_DIREITA');1078 this.addCommand(`A. Esquerdo Cima - VALOR(${String(Input.gamepadMapper[16]).toUpperCase()})`, 'button_ANALOGICO_ESQUERDO_CIMA');1079 this.addCommand(`A. Esquerdo Baixo - VALOR(${String(Input.gamepadMapper[17]).toUpperCase()})`, 'button_ANALOGICO_ESQUERDO_BAIXO');1080 this.addCommand(`A. Esquerdo Esquerda - VALOR(${String(Input.gamepadMapper[18]).toUpperCase()})`, 'button_ANALOGICO_ESQUERDO_ESQUERDA');1081 this.addCommand(`A. Esquerdo Direita - VALOR(${String(Input.gamepadMapper[19]).toUpperCase()})`, 'button_ANALOGICO_ESQUERDO_DIREITA');1082 this.addCommand(`A. Direito Cima - VALOR(${String(Input.gamepadMapper[20]).toUpperCase()})`, 'button_ANALOGICO_DIREITO_CIMA');1083 this.addCommand(`A. Direito Baixo - VALOR(${String(Input.gamepadMapper[21]).toUpperCase()})`, 'button_ANALOGICO_DIREITO_BAIXO');1084 this.addCommand(`A. Direito Esquerda - VALOR(${String(Input.gamepadMapper[22]).toUpperCase()})`, 'button_ANALOGICO_DIREITO_ESQUERDA');1085 this.addCommand(`A. Direito Direita - VALOR(${String(Input.gamepadMapper[23]).toUpperCase()})`, 'button_ANALOGICO_DIREITO_DIREITA');1086 };10871088 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype.setHandlerMainCommands = function () {1089 this.setHandler('button_A', this.showWindowSetValue.bind(this, 0));1090 this.setHandler('button_B', this.showWindowSetValue.bind(this, 1));1091 this.setHandler('button_X', this.showWindowSetValue.bind(this, 2));1092 this.setHandler('button_Y', this.showWindowSetValue.bind(this, 3));1093 this.setHandler('button_LB', this.showWindowSetValue.bind(this, 4));1094 this.setHandler('button_LT', this.showWindowSetValue.bind(this, 6));1095 this.setHandler('button_RB', this.showWindowSetValue.bind(this, 5));1096 this.setHandler('button_RT', this.showWindowSetValue.bind(this, 7));1097 this.setHandler('button_SELECT', this.showWindowSetValue.bind(this, 8));1098 this.setHandler('button_START', this.showWindowSetValue.bind(this, 9));1099 this.setHandler('button_ANALOGICO_ESQUERDO_CLIQUE', this.showWindowSetValue.bind(this, 10));1100 this.setHandler('button_ANALOGICO_DIREITO_CLIQUE', this.showWindowSetValue.bind(this, 11));1101 this.setHandler('button_DPAD_CIMA', this.showWindowSetValue.bind(this, 12));1102 this.setHandler('button_DPAD_BAIXO', this.showWindowSetValue.bind(this, 13));1103 this.setHandler('button_DPAD_ESQUERDA', this.showWindowSetValue.bind(this, 14));1104 this.setHandler('button_DPAD_DIREITA', this.showWindowSetValue.bind(this, 15));1105 this.setHandler('button_ANALOGICO_ESQUERDO_CIMA', this.showWindowSetValue.bind(this, 16));1106 this.setHandler('button_ANALOGICO_ESQUERDO_BAIXO', this.showWindowSetValue.bind(this, 17));1107 this.setHandler('button_ANALOGICO_ESQUERDO_ESQUERDA', this.showWindowSetValue.bind(this, 18));1108 this.setHandler('button_ANALOGICO_ESQUERDO_DIREITA', this.showWindowSetValue.bind(this, 19));1109 this.setHandler('button_ANALOGICO_DIREITO_CIMA', this.showWindowSetValue.bind(this, 20));1110 this.setHandler('button_ANALOGICO_DIREITO_BAIXO', this.showWindowSetValue.bind(this, 21));1111 this.setHandler('button_ANALOGICO_DIREITO_ESQUERDA', this.showWindowSetValue.bind(this, 22));1112 this.setHandler('button_ANALOGICO_DIREITO_DIREITA', this.showWindowSetValue.bind(this, 23));1113 };11141115 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype.drawItem = function (index) {1116 var rect = this.itemRect(index);1117 this.drawIMG('selectGamepadButtons', index, rect.x + 12, rect.y + 5);1118 this.drawItemText(index);1119 };11201121 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype.drawIMG = function (file, index, x, y, width, height) {1122 width = width || 144;1123 height = height || 144;1124 var bitmap = ImageManager.loadMultiplayerLocalIMG(file);1125 var pw = 144;1126 var ph = 144;1127 var sw = Math.min(width, pw);1128 var sh = Math.min(height, ph);1129 var dx = Math.floor(x + Math.max(width - pw, 0) / 2);1130 var dy = Math.floor(y + Math.max(height - ph, 0) / 2);1131 var sx = index % 4 * pw + (pw - sw) / 2;1132 var sy = Math.floor(index / 4) * ph + (ph - sh) / 2;1133 this.contents.blt(bitmap, sx, sy, sw, sh, dx, dy);1134 };11351136 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype.drawItemText = function (index) {1137 var rect = this.itemRectForText(index);1138 var align = this.itemTextAlign();1139 this.resetTextColor();1140 this.changeTextColor(this.systemColor());1141 this.changePaintOpacity(this.isCommandEnabled(index));1142 this.drawText(this.commandName(index), rect.x + 162, rect.y + (rect.height / 2) - 20, rect.width, align);1143 };11441145 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype.drawHelpText = function (text_1, text_2) {1146 if (text_1 === undefined) text_1 = 0;1147 if (text_2 === undefined) text_2 = 1;1148 if (!this._textsToHelp) {1149 this._textsToHelp = [1150 'Escolha um botão e aperte(OK) para trocar seu valor,',1151 'tome cuidado com botáes com o mesmo valor.',1152 'Alguns botáes não podem ter os valores retirados, para',1153 'retirar o valor vocΓƒΒͺ precisa atribuir o valor a outro botão.'1154 ]1155 }1156 var width = this.contentsWidth(),1157 height = this.contentsHeight(),1158 x = 5,1159 y1 = this.windowHeight() - 100 - (this.standardPadding() * 2 + this.textPadding() * 2),1160 y2 = this.windowHeight() - 60 - (this.standardPadding() * 2 + this.textPadding() * 2);1161 this.contents.clearRect(x, y1, width, height);1162 this.drawText(this._textsToHelp[text_1], x, y1, width, 'left');1163 this.drawText(this._textsToHelp[text_2], x, y2, width, 'left');1164 };11651166 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype.updateHelpText = function () {1167 if (!this._textHelp_times) {1168 this._textHelp_times = [180, 180];1169 this._textHelp_change = false;1170 }1171 if (this._textHelp_times[0] > 0) {1172 this._textHelp_times[0] -= .60;1173 } else {1174 if (!this._textHelp_change) {1175 this._textHelp_change = true;1176 this.drawHelpText(2, 3);1177 }1178 if (this._textHelp_times[1] > 0) {1179 this._textHelp_times[1] -= .60;1180 } else {1181 this.drawHelpText(0, 1);1182 this._textHelp_times = null;1183 }1184 }1185 };11861187 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype.createWindowSetValue = function () {1188 if (!this._windowSetValue) {1189 this._windowSetValue = new Window_selectGamePadMultiplayerLocal_Options_buttonsChange_setValue();1190 }1191 this.addChild(this._windowSetValue);1192 };11931194 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype.showWindowSetValue = function (buttonId) {1195 this._windowSetValue.show();1196 this._windowSetValue.activate();1197 this._windowSetValue._buttonId = buttonId;1198 this._windowSetValue._winParent = this;1199 this._cursorRectHide = true;1200 };12011202 Window_selectGamePadMultiplayerLocal_Options_buttonsChange.prototype._updateCursor = function () {1203 var blinkCount = this._animationCount % 40;1204 var cursorOpacity = this.contentsOpacity;1205 if (this.active) {1206 if (blinkCount < 20) {1207 cursorOpacity -= blinkCount * 8;1208 } else {1209 cursorOpacity -= (40 - blinkCount) * 8;1210 }1211 }1212 this._windowCursorSprite.alpha = cursorOpacity / 255;1213 this._windowCursorSprite.visible = this._cursorRectHide ? false : this.isOpen();1214 };12151216 //-----------------------------------------------------------------------------1217 // Window_selectGamePadMultiplayerLocal_Options_buttonsChange_setValue1218 //1219 function Window_selectGamePadMultiplayerLocal_Options_buttonsChange_setValue() {1220 this.initialize.apply(this, arguments);1221 }12221223 Window_selectGamePadMultiplayerLocal_Options_buttonsChange_setValue.prototype = Object.create(Window_Command.prototype);1224 Window_selectGamePadMultiplayerLocal_Options_buttonsChange_setValue.prototype.constructor = Window_selectGamePadMultiplayerLocal_Options_buttonsChange_setValue;12251226 Window_selectGamePadMultiplayerLocal_Options_buttonsChange_setValue.prototype.initialize = function () {1227 Window_Command.prototype.initialize.call(this, Graphics.boxWidth / 4, Graphics.boxHeight / 4);1228 this.deactivate();1229 this.hide();1230 this.setHandlerMainCommands();1231 this._buttonId = null;1232 this._winParent = null;1233 };12341235 Window_selectGamePadMultiplayerLocal_Options_buttonsChange_setValue.prototype.windowWidth = function () {1236 return 420;1237 };12381239 Window_selectGamePadMultiplayerLocal_Options_buttonsChange_setValue.prototype.windowHeight = function () {1240 return 280;1241 };12421243 Window_selectGamePadMultiplayerLocal_Options_buttonsChange_setValue.prototype.standardBackOpacity = function () {1244 return 100;1245 };12461247 Window_selectGamePadMultiplayerLocal_Options_buttonsChange_setValue.prototype.numVisibleRows = function () {1248 return 1;1249 };12501251 Window_selectGamePadMultiplayerLocal_Options_buttonsChange_setValue.prototype.itemHeight = function () {1252 return this.windowHeight() - this.standardPadding() * 2;1253 };12541255 Window_selectGamePadMultiplayerLocal_Options_buttonsChange_setValue.prototype.makeCommandList = function () {1256 this.addMainCommands();1257 };12581259 Window_selectGamePadMultiplayerLocal_Options_buttonsChange_setValue.prototype.addMainCommands = function () {1260 this.addCommand('OK', '_ok');1261 this.addCommand('CANCEL', '_cancel');1262 this.addCommand('MENU', '_menu');1263 this.addCommand('M. ESPECIAL', '_menuEspecial');1264 this.addCommand('TAB', '_tab');1265 this.addCommand('SHIFT', '_shift');1266 this.addCommand('CONTROL', '_control');1267 this.addCommand('ESCAPE', '_escape');1268 this.addCommand('PAGEUP', '_pageup');1269 this.addCommand('PAGEDOWN', '_pagedown');1270 this.addCommand('LEFT', '_left');1271 this.addCommand('UP', '_up');1272 this.addCommand('RIGHT', '_right');1273 this.addCommand('DOWN', '_down');1274 this.addCommand('DEBUG', '_debug');1275 };12761277 Window_selectGamePadMultiplayerLocal_Options_buttonsChange_setValue.prototype.drawItem = function (index) {1278 var rect = this.itemRectForText(index);1279 var align = 'center';1280 this.changeTextColor(this.systemColor());1281 this.contents.fontSize = 132;1282 this.changePaintOpacity(this.isCommandEnabled(index));1283 this.drawText(this.commandName(index), rect.x, (rect.height / 4) + (rect.y + this.standardPadding() * 2), rect.width, align);1284 };12851286 Window_selectGamePadMultiplayerLocal_Options_buttonsChange_setValue.prototype.setHandlerMainCommands = function () {1287 this.setHandler('_ok', this.setButtonValue.bind(this, 'ok'));1288 this.setHandler('_cancel', this.setButtonValue.bind(this, 'cancel'));1289 this.setHandler('_menu', this.setButtonValue.bind(this, 'menu'));1290 this.setHandler('_menuEspecial', this.setButtonValue.bind(this, 'menuMultiplayerLocal'));1291 this.setHandler('_tab', this.setButtonValue.bind(this, 'tab'));1292 this.setHandler('_shift', this.setButtonValue.bind(this, 'shift'));1293 this.setHandler('_control', this.setButtonValue.bind(this, 'control'));1294 this.setHandler('_escape', this.setButtonValue.bind(this, 'escape'));1295 this.setHandler('_pageup', this.setButtonValue.bind(this, 'pageup'));1296 this.setHandler('_pagedown', this.setButtonValue.bind(this, 'pagedown'));1297 this.setHandler('_left', this.setButtonValue.bind(this, 'left'));1298 this.setHandler('_up', this.setButtonValue.bind(this, 'up'));1299 this.setHandler('_right', this.setButtonValue.bind(this, 'right'));1300 this.setHandler('_down', this.setButtonValue.bind(this, 'down'));1301 this.setHandler('_debug', this.setButtonValue.bind(this, 'debug'));1302 this.setHandler('cancel', this.closeWin.bind(this));1303 };13041305 Window_selectGamePadMultiplayerLocal_Options_buttonsChange_setValue.prototype.setButtonValue = function (value) {1306 if (this._buttonId != null && this._winParent != null) {1307 var buttonsEssentials = ['ok', 'cancel', 'menu', 'menuMultiplayerLocal'];1308 if (buttonsEssentials.filter(function (button) {1309 return Input.gamepadMapper[this._buttonId] === button;1310 }, this).length > 0 && !this.buttonAlradyExist(buttonsEssentials, [this._buttonId, Input.gamepadMapper[this._buttonId]])) {1311 SoundManager.playBuzzer();1312 this.activate();1313 return;1314 }1315 Input.gamepadMapper[this._buttonId] = value;1316 Input._fileSettingsUpdate();1317 this.closeWin();1318 }1319 };13201321 Window_selectGamePadMultiplayerLocal_Options_buttonsChange_setValue.prototype.buttonAlradyExist = function (values, exclude) {1322 var buttons = [];1323 Object.keys(Input.gamepadMapper).filter(function (key) {1324 if (exclude[0] != key)1325 if (values.indexOf(Input.gamepadMapper[key]) != -1)1326 buttons.push(Input.gamepadMapper[key]);1327 });1328 return buttons.length >= 0 && buttons.indexOf(exclude[1]) != -1;1329 };13301331 Window_selectGamePadMultiplayerLocal_Options_buttonsChange_setValue.prototype.closeWin = function () {1332 if (this._winParent) {1333 this._winParent.refresh();1334 this._winParent._cursorRectHide = false;1335 }1336 this.hide();1337 };13381339 //-----------------------------------------------------------------------------1340 // Window_selectGamePadMultiplayerLocal_Options_setGamepad1341 //1342 function Window_selectGamePadMultiplayerLocal_Options_setGamepad() {1343 this.initialize.apply(this, arguments);1344 }13451346 Window_selectGamePadMultiplayerLocal_Options_setGamepad.prototype = Object.create(Window_Command.prototype);1347 Window_selectGamePadMultiplayerLocal_Options_setGamepad.prototype.constructor = Window_selectGamePadMultiplayerLocal_Options_setGamepad;13481349 Window_selectGamePadMultiplayerLocal_Options_setGamepad.prototype.initialize = function (x, y) {1350 Window_Command.prototype.initialize.call(this, 0, 0);1351 this.deactivate();1352 this.hide();1353 this.loadImages();1354 this.setHandlerMainCommands();1355 this._cursorRectHide = null;1356 };13571358 Window_selectGamePadMultiplayerLocal_Options_setGamepad.prototype.loadImages = function () {1359 ImageManager.reserveMultiplayerLocalIMG('selectGamepad');1360 };13611362 Window_selectGamePadMultiplayerLocal_Options_setGamepad.prototype.refresh = function () {1363 Window_Command.prototype.refresh.call(this);1364 this.activate();1365 this.createWindowSetValue();1366 };13671368 Window_selectGamePadMultiplayerLocal_Options_setGamepad.prototype.windowWidth = function () {1369 return Graphics.boxWidth;1370 };13711372 Window_selectGamePadMultiplayerLocal_Options_setGamepad.prototype.windowHeight = function () {1373 return Graphics.boxHeight;1374 };13751376 Window_selectGamePadMultiplayerLocal_Options_setGamepad.prototype.itemHeight = function () {1377 var clientHeight = this.windowHeight() - this.standardPadding() * 2;1378 return Math.floor(clientHeight / 4);1379 };13801381 Window_selectGamePadMultiplayerLocal_Options_setGamepad.prototype.makeCommandList = function () {1382 this.addMainCommands();1383 };13841385 Window_selectGamePadMultiplayerLocal_Options_setGamepad.prototype.addMainCommands = function () {1386 this.addCommand('Controle 1', 'gamepad_1');1387 this.addCommand('Controle 2', 'gamepad_2');1388 this.addCommand('Controle 3', 'gamepad_3');1389 this.addCommand('Controle 4', 'gamepad_4');1390 };13911392 Window_selectGamePadMultiplayerLocal_Options_setGamepad.prototype.setHandlerMainCommands = function () {1393 this.setHandler('gamepad_1', this.showWindowSetGamepad.bind(this, 0));1394 this.setHandler('gamepad_2', this.showWindowSetGamepad.bind(this, 1));1395 this.setHandler('gamepad_3', this.showWindowSetGamepad.bind(this, 2));1396 this.setHandler('gamepad_4', this.showWindowSetGamepad.bind(this, 3));1397 };13981399 Window_selectGamePadMultiplayerLocal_Options_setGamepad.prototype.drawItem = function (index) {1400 this.drawItemImage(index);1401 this.drawItemText(index);1402 };14031404 Window_selectGamePadMultiplayerLocal_Options_setGamepad.prototype.drawItemImage = function (index) {1405 var rect = this.itemRect(index),1406 fontSize = this.contents.fontSize;1407 this.drawIMG('selectGamepad', index, rect.x + 12, rect.y + 5);1408 this.changeTextColor(this.systemColor());1409 this.contents.fontSize = 18;1410 this.drawText('Controle', rect.x + 43, rect.y + 16, rect.width, 'left');1411 this.contents.fontSize = fontSize;1412 this.drawText(`${index + 1}`, rect.x + 74, rect.y + 66, rect.width, 'left');1413 };14141415 Window_selectGamePadMultiplayerLocal_Options_setGamepad.prototype.drawItemText = function (index) {1416 var rect = this.itemRectForText(index);1417 var align = this.itemTextAlign();1418 this.resetFontSettings();1419 this.changeTextColor(this.systemColor());1420 this.changePaintOpacity(this.isCommandEnabled(index));1421 this.contents.fontSize = 26;1422 this.drawText(`${this.commandGamepad(Input._gamepadOrder[index])} - Aperte('OK') para trocar o jogador`, rect.x + 160, rect.y + 60, rect.width, align);1423 };14241425 Window_selectGamePadMultiplayerLocal_Options_setGamepad.prototype.commandGamepad = function (gamepadIndex) {1426 switch (String(gamepadIndex).toLowerCase()) {1427 case 'player_1':1428 return 'JOGADOR 1';1429 case 'player_2':1430 return 'JOGADOR 2';1431 case 'player_3':1432 return 'JOGADOR 3';1433 case 'player_4':1434 return 'JOGADOR 4';1435 };1436 };14371438 Window_selectGamePadMultiplayerLocal_Options_setGamepad.prototype.drawIMG = function (file, index, x, y, width, height) {1439 width = width || 144;1440 height = height || 144;1441 var bitmap = ImageManager.loadMultiplayerLocalIMG(file);1442 var pw = 144;1443 var ph = 144;1444 var sw = Math.min(width, pw);1445 var sh = Math.min(height, ph);1446 var dx = Math.floor(x + Math.max(width - pw, 0) / 2);1447 var dy = Math.floor(y + Math.max(height - ph, 0) / 2);1448 var sx = index % 4 * pw + (pw - sw) / 2;1449 var sy = Math.floor(index / 4) * ph + (ph - sh) / 2;1450 this.contents.blt(bitmap, sx, sy, sw, sh, dx, dy, 140, 140);1451 };14521453 Window_selectGamePadMultiplayerLocal_Options_setGamepad.prototype.createWindowSetValue = function () {1454 if (!this._windowSetGamepad) {1455 this._windowSetGamepad = new Window_selectGamePadMultiplayerLocal_Options_setGamepad_changePad();1456 }1457 this.addChild(this._windowSetGamepad);1458 };14591460 Window_selectGamePadMultiplayerLocal_Options_setGamepad.prototype.showWindowSetGamepad = function (gamepadId) {1461 this._windowSetGamepad.show();1462 this._windowSetGamepad.activate();1463 this._windowSetGamepad._gamepadId = gamepadId;1464 this._windowSetGamepad._winParent = this;1465 this._cursorRectHide = true;1466 };14671468 Window_selectGamePadMultiplayerLocal_Options_setGamepad.prototype._updateCursor = function () {1469 var blinkCount = this._animationCount % 40;1470 var cursorOpacity = this.contentsOpacity;1471 if (this.active) {1472 if (blinkCount < 20) {1473 cursorOpacity -= blinkCount * 8;1474 } else {1475 cursorOpacity -= (40 - blinkCount) * 8;1476 }1477 }1478 this._windowCursorSprite.alpha = cursorOpacity / 255;1479 this._windowCursorSprite.visible = this._cursorRectHide ? false : this.isOpen();1480 };14811482 //-----------------------------------------------------------------------------1483 // Window_selectGamePadMultiplayerLocal_Options_setGamepad_changePad1484 //14851486 function Window_selectGamePadMultiplayerLocal_Options_setGamepad_changePad() {1487 this.initialize.apply(this, arguments);1488 }14891490 Window_selectGamePadMultiplayerLocal_Options_setGamepad_changePad.prototype = Object.create(Window_Command.prototype);1491 Window_selectGamePadMultiplayerLocal_Options_setGamepad_changePad.prototype.constructor = Window_selectGamePadMultiplayerLocal_Options_setGamepad_changePad;14921493 Window_selectGamePadMultiplayerLocal_Options_setGamepad_changePad.prototype.initialize = function () {1494 var x = Graphics.boxWidth / 4,1495 y = Graphics.boxHeight / 4;1496 Window_Command.prototype.initialize.call(this, x, y);1497 this.deactivate();1498 this.hide();1499 this.setHandlerMainCommands();1500 this._gamepadId = null;1501 this._winParent = null;1502 };15031504 Window_selectGamePadMultiplayerLocal_Options_setGamepad_changePad.prototype.windowWidth = function () {1505 return 420;1506 };15071508 Window_selectGamePadMultiplayerLocal_Options_setGamepad_changePad.prototype.windowHeight = function () {1509 return 280;1510 };15111512 Window_selectGamePadMultiplayerLocal_Options_setGamepad_changePad.prototype.standardBackOpacity = function () {1513 return 100;1514 };15151516 Window_selectGamePadMultiplayerLocal_Options_setGamepad_changePad.prototype.numVisibleRows = function () {1517 return 1;1518 };15191520 Window_selectGamePadMultiplayerLocal_Options_setGamepad_changePad.prototype.itemHeight = function () {1521 return this.windowHeight() - this.standardPadding() * 2;1522 };15231524 Window_selectGamePadMultiplayerLocal_Options_setGamepad_changePad.prototype.makeCommandList = function () {1525 this.addMainCommands();1526 };15271528 Window_selectGamePadMultiplayerLocal_Options_setGamepad_changePad.prototype.addMainCommands = function () {1529 this.addCommand('JOGADOR 1', 'player_1');1530 this.addCommand('JOGADOR 2', 'player_2');1531 this.addCommand('JOGADOR 3', 'player_3');1532 this.addCommand('JOGADOR 4', 'player_4');1533 };15341535 Window_selectGamePadMultiplayerLocal_Options_setGamepad_changePad.prototype.drawItem = function (index) {1536 var rect = this.itemRectForText(index);1537 var align = 'center';1538 this.changeTextColor(this.systemColor());1539 this.contents.fontSize = 132;1540 this.changePaintOpacity(this.isCommandEnabled(index));1541 this.drawText(this.commandName(index), rect.x, (rect.height / 4) + (rect.y + this.standardPadding() * 2), rect.width, align);1542 };15431544 Window_selectGamePadMultiplayerLocal_Options_setGamepad_changePad.prototype.setHandlerMainCommands = function () {1545 this.setHandler('player_1', this.setGamepad.bind(this, 'player_1'));1546 this.setHandler('player_2', this.setGamepad.bind(this, 'player_2'));1547 this.setHandler('player_3', this.setGamepad.bind(this, 'player_3'));1548 this.setHandler('player_4', this.setGamepad.bind(this, 'player_4'));1549 this.setHandler('cancel', this.closeWin.bind(this));1550 };15511552 Window_selectGamePadMultiplayerLocal_Options_setGamepad_changePad.prototype.setGamepad = function (player) {1553 if (this._gamepadId != null && this._winParent != null) {1554 for (var i in Input._gamepadOrder) {1555 if (Input._gamepadOrder[i] === player) {1556 Input._gamepadOrder[i] = Input._gamepadOrder[this._gamepadId];1557 break;1558 }1559 };1560 Input._gamepadOrder[this._gamepadId] = player;1561 Input._fileSettingsUpdate();1562 this.closeWin();1563 }1564 };15651566 Window_selectGamePadMultiplayerLocal_Options_setGamepad_changePad.prototype.closeWin = function () {1567 if (this._winParent) {1568 this._winParent.refresh();1569 this._winParent._cursorRectHide = false;1570 }1571 this.hide();1572 };15731574 //-----------------------------------------------------------------------------1575 // Window_keyboardSettings1576 //1577 function Window_keyboardSettings() {1578 this.initialize.apply(this, arguments);1579 }15801581 Window_keyboardSettings.prototype = Object.create(Window_Command.prototype);1582 Window_keyboardSettings.prototype.constructor = Window_keyboardSettings;15831584 Window_keyboardSettings.prototype.initialize = function (x, y) {1585 Window_Command.prototype.initialize.call(this, x, y);1586 this.deactivate();1587 this.hide();1588 this.setHandlerMainCommands();1589 this.createWindowSetKeyBoard();1590 this.createWindowDefineOwnerKeyBoard();1591 };15921593 Window_keyboardSettings.prototype.windowWidth = function () {1594 return Graphics.boxWidth - this.standardPadding() * 4;1595 };15961597 Window_keyboardSettings.prototype.windowHeight = function () {1598 return 192;1599 };16001601 Window_keyboardSettings.prototype.numVisibleRows = function () {1602 return 1;1603 };16041605 Window_keyboardSettings.prototype.standardBackOpacity = function () {1606 return 100;1607 };16081609 Window_keyboardSettings.prototype.itemHeight = function () {1610 var clientHeight = this.windowHeight() - this.standardPadding() * 2;1611 return Math.floor(clientHeight / this.numVisibleRows());1612 };16131614 Window_keyboardSettings.prototype.makeCommandList = function () {1615 this.addMainCommands();1616 };16171618 Window_keyboardSettings.prototype.addMainCommands = function () {1619 this.addCommand('Definir Teclas', 'setKeys');1620 this.addCommand('Atribuir Teclado', 'setKeyboard');1621 };16221623 Window_keyboardSettings.prototype.drawItem = function (index) {1624 var rect = this.itemRectForText(index);1625 var align = 'center';1626 this.changeTextColor(this.systemColor());1627 this.contents.fontSize = 64;1628 this.changePaintOpacity(this.isCommandEnabled(index));1629 this.drawText(this.commandName(index), rect.x, (rect.height / 4) + (rect.y + this.standardPadding()), rect.width, align);1630 };16311632 Window_keyboardSettings.prototype.setHandlerMainCommands = function () {1633 this.setHandler('setKeys', this.showWindowSetKeyBoard.bind(this));1634 this.setHandler('setKeyboard', this.showWindowDefineOwnerKeyBoard.bind(this));1635 this.setHandler('cancel', SceneManager._scene.hideKeyboardSettings.bind(SceneManager._scene));1636 };16371638 Window_keyboardSettings.prototype.createWindowSetKeyBoard = function () {1639 this._windowSetKeyBoard = new Window_keyboardSettings_setKeyBoard();1640 this._windowSetKeyBoard.setHandler('cancel', this.hideWindowSetKeyBoard.bind(this));1641 SceneManager._scene.addChild(this._windowSetKeyBoard);1642 };16431644 Window_keyboardSettings.prototype.showWindowSetKeyBoard = function () {1645 SceneManager._scene._menuWindow.hide();1646 this._windowSetKeyBoard.activate();1647 this._windowSetKeyBoard.show();1648 };16491650 Window_keyboardSettings.prototype.hideWindowSetKeyBoard = function () {1651 this._windowSetKeyBoard.deactivate();1652 this._windowSetKeyBoard.hide();1653 SceneManager._scene._menuWindow.show();1654 this.activate();1655 };16561657 Window_keyboardSettings.prototype.createWindowDefineOwnerKeyBoard = function () {1658 this._windowDefineOwnerKeyBoard = new Window_keyboardSettings_defineOwnerKeyBoard();1659 this._windowDefineOwnerKeyBoard.setHandler('cancel', this.hideWindowDefineOwnerKeyBoard.bind(this));1660 SceneManager._scene.addChild(this._windowDefineOwnerKeyBoard);1661 };16621663 Window_keyboardSettings.prototype.showWindowDefineOwnerKeyBoard = function () {1664 SceneManager._scene._menuWindow.hide();1665 this._windowDefineOwnerKeyBoard.activate();1666 this._windowDefineOwnerKeyBoard.refresh();1667 this._windowDefineOwnerKeyBoard.show();1668 };16691670 Window_keyboardSettings.prototype.hideWindowDefineOwnerKeyBoard = function () {1671 this._windowDefineOwnerKeyBoard.deactivate();1672 this._windowDefineOwnerKeyBoard.hide();1673 SceneManager._scene._menuWindow.show();1674 this.activate();1675 };16761677 //-----------------------------------------------------------------------------1678 // Window_keyboardSettings_setKeyBoard1679 //1680 function Window_keyboardSettings_setKeyBoard() {1681 this.initialize.apply(this, arguments);1682 }16831684 Window_keyboardSettings_setKeyBoard.prototype = Object.create(Window_Command.prototype);1685 Window_keyboardSettings_setKeyBoard.prototype.constructor = Window_keyboardSettings_setKeyBoard;16861687 Window_keyboardSettings_setKeyBoard.prototype.initialize = function () {1688 Window_Command.prototype.initialize.call(this, 0, 0);1689 this.deactivate();1690 this.hide();1691 this.setHandlerMainCommands();1692 this.createSetButtonWindow();1693 this._cursorRectHide = null;1694 };16951696 Window_keyboardSettings_setKeyBoard.prototype.refresh = function () {1697 Window_Command.prototype.refresh.call(this);1698 this.activate();1699 };17001701 Window_keyboardSettings_setKeyBoard.prototype.windowWidth = function () {1702 return Graphics.boxWidth;1703 };17041705 Window_keyboardSettings_setKeyBoard.prototype.windowHeight = function () {1706 return Graphics.boxHeight;1707 };17081709 Window_keyboardSettings_setKeyBoard.prototype.numVisibleRows = function () {1710 return 4;1711 };17121713 Window_keyboardSettings_setKeyBoard.prototype.itemHeight = function () {1714 var clientHeight = this.windowHeight() - this.standardPadding() * 2;1715 return Math.floor(clientHeight / this.numVisibleRows());1716 };17171718 Window_keyboardSettings_setKeyBoard.prototype.makeCommandList = function () {1719 this.addMainCommands();1720 };17211722 Window_keyboardSettings_setKeyBoard.prototype.addMainCommands = function () {1723 this.addCommand(`TECLA A VALOR(${this.textCommandConfigure(Input.keyMapper[65])})`, '_key_A');1724 this.addCommand(`TECLA B VALOR(${this.textCommandConfigure(Input.keyMapper[66])})`, '_key_B');1725 this.addCommand(`TECLA C VALOR(${this.textCommandConfigure(Input.keyMapper[67])})`, '_key_C');1726 this.addCommand(`TECLA D VALOR(${this.textCommandConfigure(Input.keyMapper[68])})`, '_key_D');1727 this.addCommand(`TECLA E VALOR(${this.textCommandConfigure(Input.keyMapper[69])})`, '_key_E');1728 this.addCommand(`TECLA F VALOR(${this.textCommandConfigure(Input.keyMapper[70])})`, '_key_F');1729 this.addCommand(`TECLA G VALOR(${this.textCommandConfigure(Input.keyMapper[71])})`, '_key_G');1730 this.addCommand(`TECLA H VALOR(${this.textCommandConfigure(Input.keyMapper[72])})`, '_key_H');1731 this.addCommand(`TECLA I VALOR(${this.textCommandConfigure(Input.keyMapper[73])})`, '_key_I');1732 this.addCommand(`TECLA J VALOR(${this.textCommandConfigure(Input.keyMapper[74])})`, '_key_J');1733 this.addCommand(`TECLA K VALOR(${this.textCommandConfigure(Input.keyMapper[75])})`, '_key_K');1734 this.addCommand(`TECLA L VALOR(${this.textCommandConfigure(Input.keyMapper[76])})`, '_key_L');1735 this.addCommand(`TECLA M VALOR(${this.textCommandConfigure(Input.keyMapper[77])})`, '_key_M');1736 this.addCommand(`TECLA N VALOR(${this.textCommandConfigure(Input.keyMapper[78])})`, '_key_N');1737 this.addCommand(`TECLA O VALOR(${this.textCommandConfigure(Input.keyMapper[79])})`, '_key_O');1738 this.addCommand(`TECLA P VALOR(${this.textCommandConfigure(Input.keyMapper[80])})`, '_key_P');1739 this.addCommand(`TECLA Q VALOR(${this.textCommandConfigure(Input.keyMapper[81])})`, '_key_Q');1740 this.addCommand(`TECLA R VALOR(${this.textCommandConfigure(Input.keyMapper[82])})`, '_key_R');1741 this.addCommand(`TECLA S VALOR(${this.textCommandConfigure(Input.keyMapper[83])})`, '_key_S');1742 this.addCommand(`TECLA T VALOR(${this.textCommandConfigure(Input.keyMapper[84])})`, '_key_T');1743 this.addCommand(`TECLA U VALOR(${this.textCommandConfigure(Input.keyMapper[85])})`, '_key_U');1744 this.addCommand(`TECLA V VALOR(${this.textCommandConfigure(Input.keyMapper[86])})`, '_key_V');1745 this.addCommand(`TECLA W VALOR(${this.textCommandConfigure(Input.keyMapper[87])})`, '_key_W');1746 this.addCommand(`TECLA X VALOR(${this.textCommandConfigure(Input.keyMapper[88])})`, '_key_X');1747 this.addCommand(`TECLA Y VALOR(${this.textCommandConfigure(Input.keyMapper[89])})`, '_key_Y');1748 this.addCommand(`TECLA Z VALOR(${this.textCommandConfigure(Input.keyMapper[90])})`, '_key_Z');1749 this.addCommand(`TECLA TAB VALOR(${this.textCommandConfigure(Input.keyMapper[9])})`, '_key_TAB');1750 this.addCommand(`TECLA ENTER VALOR(${this.textCommandConfigure(Input.keyMapper[13])})`, '_key_ENTER');1751 this.addCommand(`TECLA SHIFT(ESQUERDO/DIREITO) VALOR(${this.textCommandConfigure(Input.keyMapper[16])})`, '_key_SHIFT');1752 this.addCommand(`TECLA CTRL(ESQUERDO/DIREITO) VALOR(${this.textCommandConfigure(Input.keyMapper[17])})`, '_key_CTRL');1753 this.addCommand(`TECLA ALT(ESQUERDO/DIREITO) VALOR(${this.textCommandConfigure(Input.keyMapper[18])})`, '_key_ALT');1754 this.addCommand(`TECLA PAUSE/BREAK VALOR(${this.textCommandConfigure(Input.keyMapper[19])})`, '_key_Pause_Break');1755 this.addCommand(`TECLA CAPS-LOCK VALOR(${this.textCommandConfigure(Input.keyMapper[20])})`, '_key_Caps_Lock');1756 this.addCommand(`TECLA ESC VALOR(${this.textCommandConfigure(Input.keyMapper[27])})`, '_key_ESC');1757 this.addCommand(`TECLA ESPAÇO VALOR(${this.textCommandConfigure(Input.keyMapper[32])})`, '_key_ESPAÇO');1758 this.addCommand(`TECLA PAGE-UP VALOR(${this.textCommandConfigure(Input.keyMapper[33])})`, '_key_PAGE_UP');1759 this.addCommand(`TECLA PAGE-DOWN VALOR(${this.textCommandConfigure(Input.keyMapper[34])})`, '_key_PAGE_DOWN');1760 this.addCommand(`TECLA END VALOR(${this.textCommandConfigure(Input.keyMapper[35])})`, '_key_END');1761 this.addCommand(`TECLA HOME VALOR(${this.textCommandConfigure(Input.keyMapper[36])})`, '_key_HOME');1762 this.addCommand(`TECLA SETA PARA ESQUERDA VALOR(${this.textCommandConfigure(Input.keyMapper[37])})`, '_key_SETA_PARA_ESQUERDA');1763 this.addCommand(`TECLA SETA PARA CIMA VALOR(${this.textCommandConfigure(Input.keyMapper[38])})`, '_key_SETA_PARA_CIMA');1764 this.addCommand(`TECLA SETA PARA DIREITA VALOR(${this.textCommandConfigure(Input.keyMapper[39])})`, '_key_SETA_PARA_DIREITA');1765 this.addCommand(`TECLA SETA PARA BAIXO VALOR(${this.textCommandConfigure(Input.keyMapper[40])})`, '_key_SETA_PARA_BAIXO');1766 this.addCommand(`TECLA INSERT VALOR(${this.textCommandConfigure(Input.keyMapper[45])})`, '_key_INSERT');1767 this.addCommand(`TECLA DELETE VALOR(${this.textCommandConfigure(Input.keyMapper[46])})`, '_key_DELETE');1768 this.addCommand(`TECLA 0 VALOR(${this.textCommandConfigure(Input.keyMapper[48])})`, '_key_0');1769 this.addCommand(`TECLA 1 VALOR(${this.textCommandConfigure(Input.keyMapper[49])})`, '_key_1');1770 this.addCommand(`TECLA 2 VALOR(${this.textCommandConfigure(Input.keyMapper[50])})`, '_key_2');1771 this.addCommand(`TECLA 3 VALOR(${this.textCommandConfigure(Input.keyMapper[51])})`, '_key_3');1772 this.addCommand(`TECLA 4 VALOR(${this.textCommandConfigure(Input.keyMapper[52])})`, '_key_4');1773 this.addCommand(`TECLA 5 VALOR(${this.textCommandConfigure(Input.keyMapper[53])})`, '_key_5');1774 this.addCommand(`TECLA 6 VALOR(${this.textCommandConfigure(Input.keyMapper[54])})`, '_key_6');1775 this.addCommand(`TECLA 7 VALOR(${this.textCommandConfigure(Input.keyMapper[55])})`, '_key_7');1776 this.addCommand(`TECLA 8 VALOR(${this.textCommandConfigure(Input.keyMapper[56])})`, '_key_8');1777 this.addCommand(`TECLA 9 VALOR(${this.textCommandConfigure(Input.keyMapper[57])})`, '_key_9');1778 this.addCommand(`TECLA NUMERICA 0 VALOR(${this.textCommandConfigure(Input.keyMapper[96])})`, '_key_NUM_0');1779 this.addCommand(`TECLA NUMERICA 1 VALOR(${this.textCommandConfigure(Input.keyMapper[97])})`, '_key_NUM_1');1780 this.addCommand(`TECLA NUMERICA 2 VALOR(${this.textCommandConfigure(Input.keyMapper[98])})`, '_key_NUM_2');1781 this.addCommand(`TECLA NUMERICA 3 VALOR(${this.textCommandConfigure(Input.keyMapper[99])})`, '_key_NUM_3');1782 this.addCommand(`TECLA NUMERICA 4 VALOR(${this.textCommandConfigure(Input.keyMapper[100])})`, '_key_NUM_4');1783 this.addCommand(`TECLA NUMERICA 5 VALOR(${this.textCommandConfigure(Input.keyMapper[101])})`, '_key_NUM_5');1784 this.addCommand(`TECLA NUMERICA 6 VALOR(${this.textCommandConfigure(Input.keyMapper[102])})`, '_key_NUM_6');1785 this.addCommand(`TECLA NUMERICA 7 VALOR(${this.textCommandConfigure(Input.keyMapper[103])})`, '_key_NUM_7');1786 this.addCommand(`TECLA NUMERICA 8 VALOR(${this.textCommandConfigure(Input.keyMapper[104])})`, '_key_NUM_8');1787 this.addCommand(`TECLA NUMERICA 9 VALOR(${this.textCommandConfigure(Input.keyMapper[105])})`, '_key_NUM_9');1788 this.addCommand(`TECLA MULTIPLICAÇÃO(*) VALOR(${this.textCommandConfigure(Input.keyMapper[106])})`, '_key_MULTIPLICAÇÃO');1789 this.addCommand(`TECLA ADIÇÃO(+) VALOR(${this.textCommandConfigure(Input.keyMapper[107])})`, '_key_ADIÇÃO');1790 this.addCommand(`TECLA SUBTRAÇÃO(-) VALOR(${this.textCommandConfigure(Input.keyMapper[109])})`, '_key_SUBTRAÇÃO');1791 this.addCommand(`TECLA PONTO DECIMAL(.) VALOR(${this.textCommandConfigure(Input.keyMapper[110])})`, '_key_PONTO_DECIMAL');1792 this.addCommand(`TECLA DIVISÃO(/) VALOR(${this.textCommandConfigure(Input.keyMapper[111])})`, '_key_DIVISÃO');1793 this.addCommand(`TECLA F1 VALOR(${this.textCommandConfigure(Input.keyMapper[112])})`, '_key_F1');1794 this.addCommand(`TECLA F2 VALOR(${this.textCommandConfigure(Input.keyMapper[113])})`, '_key_F2');1795 this.addCommand(`TECLA F3 VALOR(${this.textCommandConfigure(Input.keyMapper[114])})`, '_key_F3');1796 this.addCommand(`TECLA F4 VALOR(${this.textCommandConfigure(Input.keyMapper[115])})`, '_key_F4');1797 this.addCommand(`TECLA F5 VALOR(${this.textCommandConfigure(Input.keyMapper[116])})`, '_key_F5');1798 this.addCommand(`TECLA F6 VALOR(${this.textCommandConfigure(Input.keyMapper[117])})`, '_key_F6');1799 this.addCommand(`TECLA F7 VALOR(${this.textCommandConfigure(Input.keyMapper[118])})`, '_key_F7');1800 this.addCommand(`TECLA F8 VALOR(${this.textCommandConfigure(Input.keyMapper[119])})`, '_key_F8');1801 this.addCommand(`TECLA F9 VALOR(${this.textCommandConfigure(Input.keyMapper[120])})`, '_key_F9');1802 this.addCommand(`TECLA F10 VALOR(${this.textCommandConfigure(Input.keyMapper[121])})`, '_key_F10');1803 this.addCommand(`TECLA F11 VALOR(${this.textCommandConfigure(Input.keyMapper[122])})`, '_key_F11');1804 this.addCommand(`TECLA F12 VALOR(${this.textCommandConfigure(Input.keyMapper[123])})`, '_key_F12');1805 this.addCommand(`TECLA NUM-LOCK VALOR(${this.textCommandConfigure(Input.keyMapper[144])})`, '_key_NUM_LOCK');1806 this.addCommand(`TECLA SCROLL-LOCK VALOR(${this.textCommandConfigure(Input.keyMapper[145])})`, '_key_SCROLL_LOCK');1807 this.addCommand(`TECLA VIRGULA(;) VALOR(${this.textCommandConfigure(Input.keyMapper[186])})`, '_key_PONTO_E_VIRGULA');1808 this.addCommand(`TECLA IGUAL(=) VALOR(${this.textCommandConfigure(Input.keyMapper[187])})`, '_key_IGUAL');1809 this.addCommand(`TECLA VIRGULA(,) VALOR(${this.textCommandConfigure(Input.keyMapper[188])})`, '_key_VIRGULA');1810 this.addCommand(`TECLA TRAÇO(-) VALOR(${this.textCommandConfigure(Input.keyMapper[189])})`, '_key_TRAÇO');1811 this.addCommand(`TECLA PONTO(.) VALOR(${this.textCommandConfigure(Input.keyMapper[190])})`, '_key_PONTO');1812 this.addCommand(`TECLA BARRA(/) VALOR(${this.textCommandConfigure(Input.keyMapper[191])})`, '_key_BARRA_1');1813 this.addCommand(`TECLA Acento Grave(\`) VALOR(${this.textCommandConfigure(Input.keyMapper[192])})`, '_key_ACENTO_GRAVE');1814 this.addCommand(`TECLA COLCHETES([) VALOR(${this.textCommandConfigure(Input.keyMapper[219])})`, '_key_COLCHETES_ABERTO');1815 this.addCommand(`TECLA BARRA(\\) VALOR(${this.textCommandConfigure(Input.keyMapper[220])})`, '_key_BARRA_2');1816 this.addCommand(`TECLA COLCHETES(]) VALOR(${this.textCommandConfigure(Input.keyMapper[221])})`, '_key_COLCHETES_FECHADO');1817 this.addCommand(`TECLA ASPAS(\'|\") VALOR(${this.textCommandConfigure(Input.keyMapper[222])})`, '_key_ASPAS');1818 };18191820 Window_keyboardSettings_setKeyBoard.prototype.textCommandConfigure = function (command) {1821 return String(command).toLocaleLowerCase() === 'menumultiplayerlocal' ? 'MENU ESPECIAL' : String(command).toUpperCase();1822 };18231824 Window_keyboardSettings_setKeyBoard.prototype.drawItem = function (index) {1825 var rect = this.itemRectForText(index);1826 var align = 'center';1827 this.changeTextColor(this.systemColor());1828 this.contents.fontSize = 42;1829 this.drawText(this.commandName(index), rect.x, (rect.height / 4) + (rect.y + this.standardPadding()), rect.width, align);1830 };18311832 Window_keyboardSettings_setKeyBoard.prototype.setHandlerMainCommands = function () {1833 this.setHandler('_key_A', this.showSetButtonWindow.bind(this, 65));1834 this.setHandler('_key_B', this.showSetButtonWindow.bind(this, 66));1835 this.setHandler('_key_C', this.showSetButtonWindow.bind(this, 67));1836 this.setHandler('_key_D', this.showSetButtonWindow.bind(this, 68));1837 this.setHandler('_key_E', this.showSetButtonWindow.bind(this, 69));1838 this.setHandler('_key_F', this.showSetButtonWindow.bind(this, 70));1839 this.setHandler('_key_G', this.showSetButtonWindow.bind(this, 71));1840 this.setHandler('_key_H', this.showSetButtonWindow.bind(this, 72));1841 this.setHandler('_key_I', this.showSetButtonWindow.bind(this, 73));1842 this.setHandler('_key_J', this.showSetButtonWindow.bind(this, 74));1843 this.setHandler('_key_K', this.showSetButtonWindow.bind(this, 75));1844 this.setHandler('_key_L', this.showSetButtonWindow.bind(this, 76));1845 this.setHandler('_key_M', this.showSetButtonWindow.bind(this, 77));1846 this.setHandler('_key_N', this.showSetButtonWindow.bind(this, 78));1847 this.setHandler('_key_O', this.showSetButtonWindow.bind(this, 79));1848 this.setHandler('_key_P', this.showSetButtonWindow.bind(this, 80));1849 this.setHandler('_key_Q', this.showSetButtonWindow.bind(this, 81));1850 this.setHandler('_key_R', this.showSetButtonWindow.bind(this, 82));1851 this.setHandler('_key_S', this.showSetButtonWindow.bind(this, 83));1852 this.setHandler('_key_T', this.showSetButtonWindow.bind(this, 84));1853 this.setHandler('_key_U', this.showSetButtonWindow.bind(this, 85));1854 this.setHandler('_key_V', this.showSetButtonWindow.bind(this, 86));1855 this.setHandler('_key_W', this.showSetButtonWindow.bind(this, 87));1856 this.setHandler('_key_X', this.showSetButtonWindow.bind(this, 88));1857 this.setHandler('_key_Y', this.showSetButtonWindow.bind(this, 89));1858 this.setHandler('_key_Z', this.showSetButtonWindow.bind(this, 90));1859 this.setHandler('_key_TAB', this.showSetButtonWindow.bind(this, 9));1860 this.setHandler('_key_ENTER', this.showSetButtonWindow.bind(this, 13));1861 this.setHandler('_key_SHIFT', this.showSetButtonWindow.bind(this, 16));1862 this.setHandler('_key_CTRL', this.showSetButtonWindow.bind(this, 17));1863 this.setHandler('_key_ALT', this.showSetButtonWindow.bind(this, 18));1864 this.setHandler('_key_Pause_Break', this.showSetButtonWindow.bind(this, 19));1865 this.setHandler('_key_Caps_Lock', this.showSetButtonWindow.bind(this, 20));1866 this.setHandler('_key_ESC', this.showSetButtonWindow.bind(this, 27));1867 this.setHandler('_key_ESPAÇO', this.showSetButtonWindow.bind(this, 32));1868 this.setHandler('_key_PAGE_UP', this.showSetButtonWindow.bind(this, 33));1869 this.setHandler('_key_PAGE_DOWN', this.showSetButtonWindow.bind(this, 34));1870 this.setHandler('_key_END', this.showSetButtonWindow.bind(this, 35));1871 this.setHandler('_key_HOME', this.showSetButtonWindow.bind(this, 36));1872 this.setHandler('_key_SETA_PARA_ESQUERDA', this.showSetButtonWindow.bind(this, 37));1873 this.setHandler('_key_SETA_PARA_CIMA', this.showSetButtonWindow.bind(this, 38));1874 this.setHandler('_key_SETA_PARA_DIREITA', this.showSetButtonWindow.bind(this, 39));1875 this.setHandler('_key_SETA_PARA_BAIXO', this.showSetButtonWindow.bind(this, 40));1876 this.setHandler('_key_INSERT', this.showSetButtonWindow.bind(this, 45));1877 this.setHandler('_key_DELETE', this.showSetButtonWindow.bind(this, 46));1878 this.setHandler('_key_0', this.showSetButtonWindow.bind(this, 48));1879 this.setHandler('_key_1', this.showSetButtonWindow.bind(this, 49));1880 this.setHandler('_key_2', this.showSetButtonWindow.bind(this, 50));1881 this.setHandler('_key_3', this.showSetButtonWindow.bind(this, 51));1882 this.setHandler('_key_4', this.showSetButtonWindow.bind(this, 52));1883 this.setHandler('_key_5', this.showSetButtonWindow.bind(this, 53));1884 this.setHandler('_key_6', this.showSetButtonWindow.bind(this, 54));1885 this.setHandler('_key_7', this.showSetButtonWindow.bind(this, 55));1886 this.setHandler('_key_8', this.showSetButtonWindow.bind(this, 56));1887 this.setHandler('_key_9', this.showSetButtonWindow.bind(this, 57));1888 this.setHandler('_key_NUM_0', this.showSetButtonWindow.bind(this, 96));1889 this.setHandler('_key_NUM_1', this.showSetButtonWindow.bind(this, 97));1890 this.setHandler('_key_NUM_2', this.showSetButtonWindow.bind(this, 98));1891 this.setHandler('_key_NUM_3', this.showSetButtonWindow.bind(this, 99));1892 this.setHandler('_key_NUM_4', this.showSetButtonWindow.bind(this, 100));1893 this.setHandler('_key_NUM_5', this.showSetButtonWindow.bind(this, 101));1894 this.setHandler('_key_NUM_6', this.showSetButtonWindow.bind(this, 102));1895 this.setHandler('_key_NUM_7', this.showSetButtonWindow.bind(this, 103));1896 this.setHandler('_key_NUM_8', this.showSetButtonWindow.bind(this, 104));1897 this.setHandler('_key_NUM_9', this.showSetButtonWindow.bind(this, 105));1898 this.setHandler('_key_MULTIPLICAÇÃO', this.showSetButtonWindow.bind(this, 106));1899 this.setHandler('_key_ADIÇÃO', this.showSetButtonWindow.bind(this, 107));1900 this.setHandler('_key_SUBTRAÇÃO', this.showSetButtonWindow.bind(this, 109));1901 this.setHandler('_key_PONTO_DECIMAL', this.showSetButtonWindow.bind(this, 110));1902 this.setHandler('_key_DIVISÃO', this.showSetButtonWindow.bind(this, 111));1903 this.setHandler('_key_F1', this.showSetButtonWindow.bind(this, 112));1904 this.setHandler('_key_F2', this.showSetButtonWindow.bind(this, 113));1905 this.setHandler('_key_F3', this.showSetButtonWindow.bind(this, 114));1906 this.setHandler('_key_F4', this.showSetButtonWindow.bind(this, 115));1907 this.setHandler('_key_F5', this.showSetButtonWindow.bind(this, 116));1908 this.setHandler('_key_F6', this.showSetButtonWindow.bind(this, 117));1909 this.setHandler('_key_F7', this.showSetButtonWindow.bind(this, 118));1910 this.setHandler('_key_F8', this.showSetButtonWindow.bind(this, 119));1911 this.setHandler('_key_F9', this.showSetButtonWindow.bind(this, 120));1912 this.setHandler('_key_F10', this.showSetButtonWindow.bind(this, 121));1913 this.setHandler('_key_F11', this.showSetButtonWindow.bind(this, 122));1914 this.setHandler('_key_F12', this.showSetButtonWindow.bind(this, 123));1915 this.setHandler('_key_NUM_LOCK', this.showSetButtonWindow.bind(this, 144));1916 this.setHandler('_key_SCROLL_LOCK', this.showSetButtonWindow.bind(this, 145));1917 this.setHandler('_key_PONTO_E_VIRGULA', this.showSetButtonWindow.bind(this, 186));1918 this.setHandler('_key_IGUAL', this.showSetButtonWindow.bind(this, 187));1919 this.setHandler('_key_VIRGULA', this.showSetButtonWindow.bind(this, 188));1920 this.setHandler('_key_TRAÇO', this.showSetButtonWindow.bind(this, 189));1921 this.setHandler('_key_PONTO', this.showSetButtonWindow.bind(this, 190));1922 this.setHandler('_key_BARRA_1', this.showSetButtonWindow.bind(this, 191));1923 this.setHandler('_key_ACENTO_GRAVE', this.showSetButtonWindow.bind(this, 191));1924 this.setHandler('_key_COLCHETES_ABERTO', this.showSetButtonWindow.bind(this, 219));1925 this.setHandler('_key_BARRA_2', this.showSetButtonWindow.bind(this, 220));1926 this.setHandler('_key_COLCHETES_FECHADO', this.showSetButtonWindow.bind(this, 221));1927 this.setHandler('_key_ASPAS', this.showSetButtonWindow.bind(this, 222));1928 };19291930 Window_keyboardSettings_setKeyBoard.prototype.createSetButtonWindow = function () {1931 this._windowSetButtonValue = new Window_keyboardSettings_setButtonValue();1932 this.addChild(this._windowSetButtonValue);1933 };19341935 Window_keyboardSettings_setKeyBoard.prototype.showSetButtonWindow = function (buttonId) {1936 this._windowSetButtonValue.activate();1937 this._windowSetButtonValue.show();1938 this._windowSetButtonValue._buttonId = buttonId;1939 this._windowSetButtonValue._winParent = this;1940 this._cursorRectHide = true;1941 };19421943 Window_keyboardSettings_setKeyBoard.prototype._updateCursor = function () {1944 var blinkCount = this._animationCount % 40;1945 var cursorOpacity = this.contentsOpacity;1946 if (this.active) {1947 if (blinkCount < 20) {1948 cursorOpacity -= blinkCount * 8;1949 } else {1950 cursorOpacity -= (40 - blinkCount) * 8;1951 }1952 }1953 this._windowCursorSprite.alpha = cursorOpacity / 255;1954 this._windowCursorSprite.visible = this._cursorRectHide ? false : this.isOpen();1955 };19561957 //-----------------------------------------------------------------------------1958 // Window_keyboardSettings_setButtonValue1959 //1960 function Window_keyboardSettings_setButtonValue() {1961 this.initialize.apply(this, arguments);1962 }19631964 Window_keyboardSettings_setButtonValue.prototype = Object.create(Window_Command.prototype);1965 Window_keyboardSettings_setButtonValue.prototype.constructor = Window_keyboardSettings_setButtonValue;19661967 Window_keyboardSettings_setButtonValue.prototype.initialize = function () {1968 Window_Command.prototype.initialize.call(this, 25, (Graphics.boxHeight / 8) - 15);1969 this.deactivate();1970 this.hide();1971 this.setHandlerMainCommands();1972 this._buttonId = null;1973 this._winParent = null;1974 };19751976 Window_keyboardSettings_setButtonValue.prototype.windowWidth = function () {1977 return Graphics.boxWidth - 25 * 2;1978 };19791980 Window_keyboardSettings_setButtonValue.prototype.windowHeight = function () {1981 return 490;1982 };19831984 Window_keyboardSettings_setButtonValue.prototype.standardBackOpacity = function () {1985 return 100;1986 };19871988 Window_keyboardSettings_setButtonValue.prototype.numVisibleRows = function () {1989 return 4;1990 };19911992 Window_keyboardSettings_setButtonValue.prototype.itemHeight = function () {1993 var clientHeight = this.windowHeight() - this.standardPadding() * 2;1994 return Math.floor(clientHeight / this.numVisibleRows());1995 };19961997 Window_keyboardSettings_setButtonValue.prototype.drawItem = function (index) {1998 var rect = this.itemRectForText(index);1999 var align = 'center';2000 this.changeTextColor(this.systemColor());2001 this.contents.fontSize = 62;2002 this.changePaintOpacity(this.isCommandEnabled(index));2003 this.drawText(this.commandName(index), rect.x, (rect.height / 2) - this.standardPadding() + rect.y, rect.width, align);2004 };20052006 Window_keyboardSettings_setButtonValue.prototype.makeCommandList = function () {2007 this.addMainCommands();2008 };20092010 Window_keyboardSettings_setButtonValue.prototype.addMainCommands = function () {2011 this.addCommand('OK', '_ok');2012 this.addCommand('CANCEL', '_cancel');2013 this.addCommand('MENU', '_menu');2014 this.addCommand('M. ESPECIAL', '_menuEspecial');2015 this.addCommand('TAB', '_tab');2016 this.addCommand('SHIFT', '_shift');2017 this.addCommand('CONTROL', '_control');2018 this.addCommand('ESCAPE', '_escape');2019 this.addCommand('PAGEUP', '_pageup');2020 this.addCommand('PAGEDOWN', '_pagedown');2021 this.addCommand('LEFT', '_left');2022 this.addCommand('UP', '_up');2023 this.addCommand('RIGHT', '_right');2024 this.addCommand('DOWN', '_down');2025 this.addCommand('DEBUG', '_debug');2026 this.addCommand('A', '_key_A');2027 this.addCommand('B', '_key_B');2028 this.addCommand('C', '_key_C');2029 this.addCommand('D', '_key_D');2030 this.addCommand('E', '_key_E');2031 this.addCommand('F', '_key_F');2032 this.addCommand('G', '_key_G');2033 this.addCommand('H', '_key_H');2034 this.addCommand('I', '_key_I');2035 this.addCommand('J', '_key_J');2036 this.addCommand('K', '_key_K');2037 this.addCommand('L', '_key_L');2038 this.addCommand('M', '_key_M');2039 this.addCommand('N', '_key_N');2040 this.addCommand('O', '_key_O');2041 this.addCommand('P', '_key_P');2042 this.addCommand('Q', '_key_Q');2043 this.addCommand('R', '_key_R');2044 this.addCommand('S', '_key_S');2045 this.addCommand('T', '_key_T');2046 this.addCommand('U', '_key_U');2047 this.addCommand('V', '_key_V');2048 this.addCommand('W', '_key_W');2049 this.addCommand('X', '_key_X');2050 this.addCommand('Y', '_key_Y');2051 this.addCommand('Z', '_key_Z');2052 this.addCommand('TAB', '_key_TAB');2053 this.addCommand('ENTER', '_key_ENTER');2054 this.addCommand('SHIFT', '_key_SHIFT');2055 this.addCommand('CTRL', '_key_CTRL');2056 this.addCommand('ALT', '_key_ALT');2057 this.addCommand('PAUSE/BREAK', '_key_Pause_Break');2058 this.addCommand('CAPS-LOCK', '_key_Caps_Lock');2059 this.addCommand('ESC', '_key_ESC');2060 this.addCommand('ESPAÇO', '_key_ESPAÇO');2061 this.addCommand('PAGE-UP', '_key_PAGE_UP');2062 this.addCommand('PAGE-DOWN', '_key_PAGE_DOWN');2063 this.addCommand('END', '_key_END');2064 this.addCommand('HOME', '_key_HOME');2065 this.addCommand('SETA PARA ESQUERDA', '_key_SETA_PARA_ESQUERDA');2066 this.addCommand('SETA PARA CIMA', '_key_SETA_PARA_CIMA');2067 this.addCommand('SETA PARA DIREITA', '_key_SETA_PARA_DIREITA');2068 this.addCommand('SETA PARA BAIXO', '_key_SETA_PARA_BAIXO');2069 this.addCommand('INSERT', '_key_INSERT');2070 this.addCommand('DELETE', '_key_DELETE');2071 this.addCommand('TECLA 0', '_key_TECLA_0');2072 this.addCommand('TECLA 1', '_key_TECLA_1');2073 this.addCommand('TECLA 2', '_key_TECLA_2');2074 this.addCommand('TECLA 3', '_key_TECLA_3');2075 this.addCommand('TECLA 4', '_key_TECLA_4');2076 this.addCommand('TECLA 5', '_key_TECLA_5');2077 this.addCommand('TECLA 6', '_key_TECLA_6');2078 this.addCommand('TECLA 7', '_key_TECLA_7');2079 this.addCommand('TECLA 8', '_key_TECLA_8');2080 this.addCommand('TECLA 9', '_key_TECLA_9');2081 this.addCommand('TECLA NUMERICA 0', '_key_TECLA_NUMERICA_0');2082 this.addCommand('TECLA NUMERICA 1', '_key_TECLA_NUMERICA_1');2083 this.addCommand('TECLA NUMERICA 2', '_key_TECLA_NUMERICA_2');2084 this.addCommand('TECLA NUMERICA 3', '_key_TECLA_NUMERICA_3');2085 this.addCommand('TECLA NUMERICA 4', '_key_TECLA_NUMERICA_4');2086 this.addCommand('TECLA NUMERICA 5', '_key_TECLA_NUMERICA_5');2087 this.addCommand('TECLA NUMERICA 6', '_key_TECLA_NUMERICA_6');2088 this.addCommand('TECLA NUMERICA 7', '_key_TECLA_NUMERICA_7');2089 this.addCommand('TECLA NUMERICA 8', '_key_TECLA_NUMERICA_8');2090 this.addCommand('TECLA NUMERICA 9', '_key_TECLA_NUMERICA_9');2091 this.addCommand('MULTIPLICAÇÃO(*)', '_key_MULTIPLICAÇÃO');2092 this.addCommand('ADIÇÃO(+)', '_key_ADIÇÃO');2093 this.addCommand('SUBTRAÇÃO(-)', '_key_SUBTRAÇÃO');2094 this.addCommand('PONTO DECIMAL(.)', '_key_PONTO_DECIMAL');2095 this.addCommand('F1', '_key_F1');2096 this.addCommand('F2', '_key_F2');2097 this.addCommand('F3', '_key_F3');2098 this.addCommand('F4', '_key_F4');2099 this.addCommand('F5', '_key_F5');2100 this.addCommand('F6', '_key_F6');2101 this.addCommand('F7', '_key_F7');2102 this.addCommand('F8', '_key_F8');2103 this.addCommand('F9', '_key_F9');2104 this.addCommand('F10', '_key_F10');2105 this.addCommand('F11', '_key_F11');2106 this.addCommand('F12', '_key_F12');2107 this.addCommand('NUM-LOCK', '_key_Num_Lock');2108 this.addCommand('VIRGURLA(;)', '_key_PONTO_E_VIRGURLA');2109 this.addCommand('IGUAL(=)', '_key_IGUAL');2110 this.addCommand('VIRGULA(,)', '_key_VIRGULA');2111 this.addCommand('TRAÇO(-)', '_key_TRAÇO');2112 this.addCommand('PONTO(.)', '_key_PONTO');2113 this.addCommand('BARRA(/)', '_key_BARRA_1');2114 this.addCommand('Acento Grave(`)', '_key_Acento_Grave');2115 this.addCommand('COLCHETES([)', '_key_COLCHETES_ABERTO');2116 this.addCommand('BARRA(\\)', '_key_BARRA_2');2117 this.addCommand('COLCHETES([)', '_key_COLCHETES_FECHADO');2118 this.addCommand('ASPAS(\'|\")', '_key_ASPAS');2119 };21202121 Window_keyboardSettings_setButtonValue.prototype.setHandlerMainCommands = function () {2122 this.setHandler('_ok', this.setButtonValue.bind(this, 'ok'));2123 this.setHandler('_cancel', this.setButtonValue.bind(this, 'cancel'));2124 this.setHandler('_menu', this.setButtonValue.bind(this, 'menu'));2125 this.setHandler('_menuEspecial', this.setButtonValue.bind(this, 'menuMultiplayerLocal'));2126 this.setHandler('_tab', this.setButtonValue.bind(this, 'tab'));2127 this.setHandler('_shift', this.setButtonValue.bind(this, 'shift'));2128 this.setHandler('_control', this.setButtonValue.bind(this, 'control'));2129 this.setHandler('_escape', this.setButtonValue.bind(this, 'escape'));2130 this.setHandler('_pageup', this.setButtonValue.bind(this, 'pageup'));2131 this.setHandler('_pagedown', this.setButtonValue.bind(this, 'pagedown'));2132 this.setHandler('_left', this.setButtonValue.bind(this, 'left'));2133 this.setHandler('_up', this.setButtonValue.bind(this, 'up'));2134 this.setHandler('_right', this.setButtonValue.bind(this, 'right'));2135 this.setHandler('_down', this.setButtonValue.bind(this, 'down'));2136 this.setHandler('_debug', this.setButtonValue.bind(this, 'debug'));2137 this.setHandler('_key_A', this.setButtonValue.bind(this, 'a'));2138 this.setHandler('_key_B', this.setButtonValue.bind(this, 'b'));2139 this.setHandler('_key_C', this.setButtonValue.bind(this, 'c'));2140 this.setHandler('_key_D', this.setButtonValue.bind(this, 'd'));2141 this.setHandler('_key_E', this.setButtonValue.bind(this, 'e'));2142 this.setHandler('_key_F', this.setButtonValue.bind(this, 'f'));2143 this.setHandler('_key_G', this.setButtonValue.bind(this, 'g'));2144 this.setHandler('_key_H', this.setButtonValue.bind(this, 'h'));2145 this.setHandler('_key_I', this.setButtonValue.bind(this, 'i'));2146 this.setHandler('_key_J', this.setButtonValue.bind(this, 'j'));2147 this.setHandler('_key_K', this.setButtonValue.bind(this, 'k'));2148 this.setHandler('_key_L', this.setButtonValue.bind(this, 'l'));2149 this.setHandler('_key_M', this.setButtonValue.bind(this, 'm'));2150 this.setHandler('_key_N', this.setButtonValue.bind(this, 'n'));2151 this.setHandler('_key_O', this.setButtonValue.bind(this, 'o'));2152 this.setHandler('_key_P', this.setButtonValue.bind(this, 'p'));2153 this.setHandler('_key_Q', this.setButtonValue.bind(this, 'q'));2154 this.setHandler('_key_R', this.setButtonValue.bind(this, 'r'));2155 this.setHandler('_key_S', this.setButtonValue.bind(this, 's'));2156 this.setHandler('_key_T', this.setButtonValue.bind(this, 't'));2157 this.setHandler('_key_U', this.setButtonValue.bind(this, 'u'));2158 this.setHandler('_key_V', this.setButtonValue.bind(this, 'v'));2159 this.setHandler('_key_W', this.setButtonValue.bind(this, 'w'));2160 this.setHandler('_key_X', this.setButtonValue.bind(this, 'x'));2161 this.setHandler('_key_Y', this.setButtonValue.bind(this, 'y'));2162 this.setHandler('_key_Z', this.setButtonValue.bind(this, 'z'));2163 this.setHandler('_key_TAB', this.setButtonValue.bind(this, 'tab'));2164 this.setHandler('_key_ENTER', this.setButtonValue.bind(this, 'enter'));2165 this.setHandler('_key_SHIFT', this.setButtonValue.bind(this, 'shift'));2166 this.setHandler('_key_CTRL', this.setButtonValue.bind(this, 'ctrl'));2167 this.setHandler('_key_ALT', this.setButtonValue.bind(this, 'alt'));2168 this.setHandler('_key_Pause_Break', this.setButtonValue.bind(this, 'pause/break'));2169 this.setHandler('_key_Caps_Lock', this.setButtonValue.bind(this, 'caps-lock'));2170 this.setHandler('_key_ESC', this.setButtonValue.bind(this, 'esc'));2171 this.setHandler('_key_ESPAÇO', this.setButtonValue.bind(this, 'espaço'));2172 this.setHandler('_key_PAGE_UP', this.setButtonValue.bind(this, 'page-up'));2173 this.setHandler('_key_PAGE_DOWN', this.setButtonValue.bind(this, 'page-down'));2174 this.setHandler('_key_END', this.setButtonValue.bind(this, 'end'));2175 this.setHandler('_key_HOME', this.setButtonValue.bind(this, 'home'));2176 this.setHandler('_key_SETA_PARA_ESQUERDA', this.setButtonValue.bind(this, 'seta para esquerda'));2177 this.setHandler('_key_SETA_PARA_CIMA', this.setButtonValue.bind(this, 'seta para cima'));2178 this.setHandler('_key_SETA_PARA_DIREITA', this.setButtonValue.bind(this, 'seta para direita'));2179 this.setHandler('_key_SETA_PARA_BAIXO', this.setButtonValue.bind(this, 'seta para baixo'));2180 this.setHandler('_key_INSERT', this.setButtonValue.bind(this, 'insert'));2181 this.setHandler('_key_DELETE', this.setButtonValue.bind(this, 'delete'));2182 this.setHandler('_key_TECLA_0', this.setButtonValue.bind(this, '0'));2183 this.setHandler('_key_TECLA_1', this.setButtonValue.bind(this, '1'));2184 this.setHandler('_key_TECLA_2', this.setButtonValue.bind(this, '2'));2185 this.setHandler('_key_TECLA_3', this.setButtonValue.bind(this, '3'));2186 this.setHandler('_key_TECLA_4', this.setButtonValue.bind(this, '4'));2187 this.setHandler('_key_TECLA_5', this.setButtonValue.bind(this, '5'));2188 this.setHandler('_key_TECLA_6', this.setButtonValue.bind(this, '6'));2189 this.setHandler('_key_TECLA_7', this.setButtonValue.bind(this, '7'));2190 this.setHandler('_key_TECLA_8', this.setButtonValue.bind(this, '8'));2191 this.setHandler('_key_TECLA_9', this.setButtonValue.bind(this, '9'));2192 this.setHandler('_key_TECLA_NUMERICA_0', this.setButtonValue.bind(this, 'numerico 0'));2193 this.setHandler('_key_TECLA_NUMERICA_1', this.setButtonValue.bind(this, 'numerico 1'));2194 this.setHandler('_key_TECLA_NUMERICA_2', this.setButtonValue.bind(this, 'numerico 2'));2195 this.setHandler('_key_TECLA_NUMERICA_3', this.setButtonValue.bind(this, 'numerico 3'));2196 this.setHandler('_key_TECLA_NUMERICA_4', this.setButtonValue.bind(this, 'numerico 4'));2197 this.setHandler('_key_TECLA_NUMERICA_5', this.setButtonValue.bind(this, 'numerico 5'));2198 this.setHandler('_key_TECLA_NUMERICA_6', this.setButtonValue.bind(this, 'numerico 6'));2199 this.setHandler('_key_TECLA_NUMERICA_7', this.setButtonValue.bind(this, 'numerico 7'));2200 this.setHandler('_key_TECLA_NUMERICA_8', this.setButtonValue.bind(this, 'numerico 8'));2201 this.setHandler('_key_TECLA_NUMERICA_9', this.setButtonValue.bind(this, 'numerico 9'));2202 this.setHandler('_key_MULTIPLICAÇÃO', this.setButtonValue.bind(this, '*'));2203 this.setHandler('_key_ADIÇÃO', this.setButtonValue.bind(this, '+'));2204 this.setHandler('_key_SUBTRAÇÃO', this.setButtonValue.bind(this, '-'));2205 this.setHandler('_key_PONTO_DECIMAL', this.setButtonValue.bind(this, '.'));2206 this.setHandler('_key_DIVISÃO', this.setButtonValue.bind(this, '/'));2207 this.setHandler('_key_F1', this.setButtonValue.bind(this, 'f1'));2208 this.setHandler('_key_F2', this.setButtonValue.bind(this, 'f2'));2209 this.setHandler('_key_F3', this.setButtonValue.bind(this, 'f3'));2210 this.setHandler('_key_F4', this.setButtonValue.bind(this, 'f4'));2211 this.setHandler('_key_F5', this.setButtonValue.bind(this, 'f5'));2212 this.setHandler('_key_F6', this.setButtonValue.bind(this, 'f6'));2213 this.setHandler('_key_F7', this.setButtonValue.bind(this, 'f7'));2214 this.setHandler('_key_F8', this.setButtonValue.bind(this, 'f8'));2215 this.setHandler('_key_F9', this.setButtonValue.bind(this, 'f9'));2216 this.setHandler('_key_F10', this.setButtonValue.bind(this, 'f10'));2217 this.setHandler('_key_F11', this.setButtonValue.bind(this, 'f11'));2218 this.setHandler('_key_F12', this.setButtonValue.bind(this, 'f12'));2219 this.setHandler('_key_Num_Lock', this.setButtonValue.bind(this, 'num-lock'));2220 this.setHandler('_key_Scroll_Lock', this.setButtonValue.bind(this, 'scroll-lock'));2221 this.setHandler('_key_PONTO_E_VIRGURLA', this.setButtonValue.bind(this, ';'));2222 this.setHandler('_key_IGUAL', this.setButtonValue.bind(this, '='));2223 this.setHandler('_key_VIRGULA', this.setButtonValue.bind(this, ','));2224 this.setHandler('_key_TRAÇO', this.setButtonValue.bind(this, '--'));2225 this.setHandler('_key_PONTO', this.setButtonValue.bind(this, '..'));2226 this.setHandler('_key_BARRA_1', this.setButtonValue.bind(this, '//'));2227 this.setHandler('_key_Acento_Grave', this.setButtonValue.bind(this, '\`'));2228 this.setHandler('_key_COLCHETES_ABERTO', this.setButtonValue.bind(this, '['));2229 this.setHandler('_key_BARRA_2', this.setButtonValue.bind(this, '\\'));2230 this.setHandler('_key_COLCHETES_FECHADO', this.setButtonValue.bind(this, ']'));2231 this.setHandler('_key_ASPAS', this.setButtonValue.bind(this, '\"'));2232 this.setHandler('cancel', this.closeWin.bind(this));2233 };22342235 Window_keyboardSettings_setButtonValue.prototype.setButtonValue = function (value) {2236 if (this._buttonId != null && this._winParent != null) {2237 var buttonsEssentials = ['ok', 'cancel', 'menu', 'menuMultiplayerLocal'];2238 if (buttonsEssentials.filter(function (button) {2239 return Input.keyMapper[this._buttonId] === button;2240 }, this).length > 0 && !this.buttonAlradyExist(buttonsEssentials, [this._buttonId, Input.keyMapper[this._buttonId]])) {2241 SoundManager.playBuzzer();2242 this.activate();2243 return;2244 }2245 Input.keyMapper[this._buttonId] = value;2246 Input._fileSettingsUpdate();2247 this.closeWin();2248 }2249 };22502251 Window_keyboardSettings_setButtonValue.prototype.buttonAlradyExist = function (values, exclude) {2252 var buttons = [];2253 Object.keys(Input.keyMapper).filter(function (key) {2254 if (exclude[0] != key)2255 if (values.indexOf(Input.keyMapper[key]) != -1)2256 buttons.push(Input.keyMapper[key]);2257 });2258 return buttons.length >= 0 && buttons.indexOf(exclude[1]) != -1;2259 };22602261 Window_keyboardSettings_setButtonValue.prototype.closeWin = function () {2262 if (this._winParent) {2263 this._winParent.refresh();2264 this._winParent._cursorRectHide = false;2265 }2266 this.hide();2267 };22682269 //-----------------------------------------------------------------------------2270 // Window_keyboardSettings_defineOwnerKeyBoard2271 //2272 function Window_keyboardSettings_defineOwnerKeyBoard() {2273 this.initialize.apply(this, arguments);2274 }22752276 Window_keyboardSettings_defineOwnerKeyBoard.prototype = Object.create(Window_Command.prototype);2277 Window_keyboardSettings_defineOwnerKeyBoard.prototype.constructor = Window_keyboardSettings_defineOwnerKeyBoard;22782279 Window_keyboardSettings_defineOwnerKeyBoard.prototype.initialize = function () {2280 Window_Command.prototype.initialize.call(this, 0, 0);2281 this.deactivate();2282 this.hide();2283 this.setHandlerMainCommands();2284 this.loadImages();2285 this._cursorRectHide = null;2286 this.createWindowSetOwnerKeyBoard();2287 };22882289 Window_keyboardSettings_defineOwnerKeyBoard.prototype.loadImages = function () {2290 ImageManager.reserveMultiplayerLocalIMG('selectKeyboard');2291 };22922293 Window_keyboardSettings_defineOwnerKeyBoard.prototype.windowWidth = function () {2294 return Graphics.boxWidth;2295 };22962297 Window_keyboardSettings_defineOwnerKeyBoard.prototype.windowHeight = function () {2298 return Graphics.boxHeight;2299 };23002301 Window_keyboardSettings_defineOwnerKeyBoard.prototype.numVisibleRows = function () {2302 return 1;2303 };23042305 Window_keyboardSettings_defineOwnerKeyBoard.prototype.itemHeight = function () {2306 var clientHeight = this.windowHeight() - this.standardPadding() * 2;2307 return Math.floor(clientHeight / this.numVisibleRows());2308 };23092310 Window_keyboardSettings_defineOwnerKeyBoard.prototype.drawItem = function (index) {2311 var rect = this.itemRectForText(index);2312 var align = 'center';2313 this.changeTextColor(this.systemColor());2314 this.contents.fontSize = 62;2315 this.changePaintOpacity(this.isCommandEnabled(index));2316 this.drawText(this.commandName(index), rect.x, (rect.height / 2) - this.standardPadding() + rect.y, rect.width, align);2317 };23182319 Window_keyboardSettings_defineOwnerKeyBoard.prototype.makeCommandList = function () {2320 this.addMainCommands();2321 };23222323 Window_keyboardSettings_defineOwnerKeyBoard.prototype.addMainCommands = function () {2324 this.addCommand('Teclado', 'setOwnerKeyboard');2325 };23262327 Window_keyboardSettings_defineOwnerKeyBoard.prototype.setHandlerMainCommands = function () {2328 this.setHandler('setOwnerKeyboard', this.showWindowSetOwnerKeyBoard.bind(this));2329 };23302331 Window_keyboardSettings_defineOwnerKeyBoard.prototype.drawItem = function (index) {2332 this.drawItemImage(index);2333 this.drawItemText(index);2334 };23352336 Window_keyboardSettings_defineOwnerKeyBoard.prototype.drawItemImage = function (index) {2337 var rect = this.itemRect(index),2338 fontSize = this.contents.fontSize;2339 this.drawIMG('selectKeyboard', index, (rect.width / 4) + this.standardPadding() * 4, (rect.height / 4) + 12);2340 this.changeTextColor(this.systemColor());2341 this.contents.fontSize = 74;2342 this.drawText('Teclado', this.standardPadding(), this.standardPadding() * 4, rect.width, 'center');2343 };23442345 Window_keyboardSettings_defineOwnerKeyBoard.prototype.drawItemText = function (index) {2346 var rect = this.itemRectForText(index);2347 this.resetFontSettings();2348 this.changeTextColor(this.systemColor());2349 this.changePaintOpacity(this.isCommandEnabled(index));2350 this.contents.fontSize = 32;2351 this.drawText(`${this.commandKeyBoard(Input._inputOwner)} - Aperte('OK') para trocar o jogador`, 5, (rect.height / 2) + this.standardPadding() * 10, rect.width, 'center');2352 };23532354 Window_keyboardSettings_defineOwnerKeyBoard.prototype.commandKeyBoard = function (keyboardIndex) {2355 switch (String(keyboardIndex).toLowerCase()) {2356 case 'player_1':2357 return 'JOGADOR 1';2358 case 'player_2':2359 return 'JOGADOR 2';2360 case 'player_3':2361 return 'JOGADOR 3';2362 case 'player_4':2363 return 'JOGADOR 4';2364 };2365 };23662367 Window_keyboardSettings_defineOwnerKeyBoard.prototype.drawIMG = function (file, index, x, y, width, height) {2368 width = width || 288;2369 height = height || 288;2370 var bitmap = ImageManager.loadMultiplayerLocalIMG(file);2371 var pw = width;2372 var ph = height;2373 var sw = Math.min(width, pw);2374 var sh = Math.min(height, ph);2375 var dx = Math.floor(x + Math.max(width - pw, 0) / 2);2376 var dy = Math.floor(y + Math.max(height - ph, 0) / 2);2377 var sx = index % 4 * pw + (pw - sw) / 2;2378 var sy = Math.floor(index / 4) * ph + (ph - sh) / 2;2379 this.contents.blt(bitmap, sx, sy, sw, sh, dx, dy);2380 };23812382 Window_keyboardSettings_defineOwnerKeyBoard.prototype._updateCursor = function () {2383 var blinkCount = this._animationCount % 40;2384 var cursorOpacity = this.contentsOpacity;2385 if (this.active) {2386 if (blinkCount < 20) {2387 cursorOpacity -= blinkCount * 8;2388 } else {2389 cursorOpacity -= (40 - blinkCount) * 8;2390 }2391 }2392 this._windowCursorSprite.alpha = cursorOpacity / 255;2393 this._windowCursorSprite.visible = this._cursorRectHide ? false : this.isOpen();2394 };23952396 Window_keyboardSettings_defineOwnerKeyBoard.prototype.createWindowSetOwnerKeyBoard = function () {2397 this._windowSetOwnerKeyBoard = new Window_keyboardSettings_defineOwnerKeyBoard_setOwnerKeyBoard();2398 this._windowSetOwnerKeyBoard.setHandler('cancel', this.hideWindowSetOwnerKeyBoard.bind(this));2399 this.addChild(this._windowSetOwnerKeyBoard);2400 };24012402 Window_keyboardSettings_defineOwnerKeyBoard.prototype.showWindowSetOwnerKeyBoard = function () {2403 this._windowSetOwnerKeyBoard.activate();2404 this._windowSetOwnerKeyBoard.show();2405 this._windowSetOwnerKeyBoard._winParent = this;2406 this._cursorRectHide = true;2407 };24082409 Window_keyboardSettings_defineOwnerKeyBoard.prototype.hideWindowSetOwnerKeyBoard = function () {2410 this._windowSetOwnerKeyBoard.deactivate();2411 this._windowSetOwnerKeyBoard.hide();2412 this.refresh();2413 };24142415 Window_keyboardSettings_defineOwnerKeyBoard.prototype.refresh = function () {2416 Window_Command.prototype.refresh.call(this);2417 this.activate();2418 this._cursorRectHide = false;2419 };24202421 //-----------------------------------------------------------------------------2422 // Window_keyboardSettings_defineOwnerKeyBoard_setOwnerKeyBoard2423 //2424 function Window_keyboardSettings_defineOwnerKeyBoard_setOwnerKeyBoard() {2425 this.initialize.apply(this, arguments);2426 }24272428 Window_keyboardSettings_defineOwnerKeyBoard_setOwnerKeyBoard.prototype = Object.create(Window_Command.prototype);2429 Window_keyboardSettings_defineOwnerKeyBoard_setOwnerKeyBoard.prototype.constructor = Window_keyboardSettings_defineOwnerKeyBoard_setOwnerKeyBoard;24302431 Window_keyboardSettings_defineOwnerKeyBoard_setOwnerKeyBoard.prototype.initialize = function () {2432 Window_Command.prototype.initialize.call(this, 25, (Graphics.boxHeight / 8) - 15);2433 this.deactivate();2434 this.hide();2435 this._winParent = null;2436 this.setHandlerMainCommands();2437 };24382439 Window_keyboardSettings_defineOwnerKeyBoard_setOwnerKeyBoard.prototype.windowWidth = function () {2440 return Graphics.boxWidth - 25 * 2;2441 };24422443 Window_keyboardSettings_defineOwnerKeyBoard_setOwnerKeyBoard.prototype.windowHeight = function () {2444 return 490;2445 };24462447 Window_keyboardSettings_defineOwnerKeyBoard_setOwnerKeyBoard.prototype.standardBackOpacity = function () {2448 return 100;2449 };24502451 Window_keyboardSettings_defineOwnerKeyBoard_setOwnerKeyBoard.prototype.numVisibleRows = function () {2452 return 4;2453 };24542455 Window_keyboardSettings_defineOwnerKeyBoard_setOwnerKeyBoard.prototype.itemHeight = function () {2456 var clientHeight = this.windowHeight() - this.standardPadding() * 2;2457 return Math.floor(clientHeight / this.numVisibleRows());2458 };24592460 Window_keyboardSettings_defineOwnerKeyBoard_setOwnerKeyBoard.prototype.drawItem = function (index) {2461 var rect = this.itemRectForText(index);2462 var align = 'center';2463 this.changeTextColor(this.systemColor());2464 this.contents.fontSize = 62;2465 this.changePaintOpacity(this.isCommandEnabled(index));2466 this.drawText(this.commandName(index), rect.x, (rect.height / 2) - this.standardPadding() + rect.y, rect.width, align);2467 };24682469 Window_keyboardSettings_defineOwnerKeyBoard_setOwnerKeyBoard.prototype.makeCommandList = function () {2470 this.addMainCommands();2471 };24722473 Window_keyboardSettings_defineOwnerKeyBoard_setOwnerKeyBoard.prototype.addMainCommands = function () {2474 this.addCommand('JOGADOR 1', 'player_1');2475 this.addCommand('JOGADOR 2', 'player_2');2476 this.addCommand('JOGADOR 3', 'player_3');2477 this.addCommand('JOGADOR 4', 'player_4');2478 };24792480 Window_keyboardSettings_defineOwnerKeyBoard_setOwnerKeyBoard.prototype.setHandlerMainCommands = function () {2481 this.setHandler('player_1', this.setOwnerKeyBoard.bind(this, 'player_1'));2482 this.setHandler('player_2', this.setOwnerKeyBoard.bind(this, 'player_2'));2483 this.setHandler('player_3', this.setOwnerKeyBoard.bind(this, 'player_3'));2484 this.setHandler('player_4', this.setOwnerKeyBoard.bind(this, 'player_4'));2485 };24862487 Window_keyboardSettings_defineOwnerKeyBoard_setOwnerKeyBoard.prototype.setOwnerKeyBoard = function (value) {2488 Input._inputOwner = value;2489 Input._fileSettingsUpdate();2490 this.closeWin();2491 };24922493 Window_keyboardSettings_defineOwnerKeyBoard_setOwnerKeyBoard.prototype.closeWin = function () {2494 if (this._winParent)2495 this._winParent.refresh();2496 this.hide();2497 };2498 // ---------------------------------------------------------------------------- ...

Full Screen

Full Screen

EventTarget.ts

Source:EventTarget.ts Github

copy

Full Screen

...48 get onabort() {49 return getHandler(this, 'abort')50 }51 set onabort(listener) {52 setHandler(this, 'abort', listener)53 }54 get onafterprint() {55 return getHandler(this, 'afterprint')56 }57 set onafterprint(listener) {58 setHandler(this, 'afterprint', listener)59 }60 get onanimationcancel() {61 return getHandler(this, 'animationcancel')62 }63 set onanimationcancel(listener) {64 setHandler(this, 'animationcancel', listener)65 }66 get onanimationend() {67 return getHandler(this, 'animationend')68 }69 set onanimationend(listener) {70 setHandler(this, 'animationend', listener)71 }72 get onanimationiteration() {73 return getHandler(this, 'animationiteration')74 }75 set onanimationiteration(listener) {76 setHandler(this, 'animationiteration', listener)77 }78 get onanimationstart() {79 return getHandler(this, 'animationstart')80 }81 set onanimationstart(listener) {82 setHandler(this, 'animationstart', listener)83 }84 get onauxclick() {85 return getHandler(this, 'auxclick')86 }87 set onauxclick(listener) {88 setHandler(this, 'auxclick', listener)89 }90 get onbeforeprint() {91 return getHandler(this, 'beforeprint')92 }93 set onbeforeprint(listener) {94 setHandler(this, 'beforeprint', listener)95 }96 get onbeforeunload() {97 return getHandler(this, 'beforeunload')98 }99 set onbeforeunload(listener) {100 setHandler(this, 'beforeunload', listener)101 }102 get onblur() {103 return getHandler(this, 'blur')104 }105 set onblur(listener) {106 setHandler(this, 'blur', listener)107 }108 get oncancel() {109 return getHandler(this, 'cancel')110 }111 set oncancel(listener) {112 setHandler(this, 'cancel', listener)113 }114 get oncanplay() {115 return getHandler(this, 'canplay')116 }117 set oncanplay(listener) {118 setHandler(this, 'canplay', listener)119 }120 get oncanplaythrough() {121 return getHandler(this, 'canplaythrough')122 }123 set oncanplaythrough(listener) {124 setHandler(this, 'canplaythrough', listener)125 }126 get onchange() {127 return getHandler(this, 'change')128 }129 set onchange(listener) {130 setHandler(this, 'change', listener)131 }132 get onclick() {133 return getHandler(this, 'click')134 }135 set onclick(listener) {136 setHandler(this, 'click', listener)137 }138 get onclose() {139 return getHandler(this, 'close')140 }141 set onclose(listener) {142 setHandler(this, 'close', listener)143 }144 get oncompassneedscalibration() {145 return getHandler(this, 'compassneedscalibration')146 }147 set oncompassneedscalibration(listener) {148 setHandler(this, 'compassneedscalibration', listener)149 }150 get oncontextmenu() {151 return getHandler(this, 'contextmenu')152 }153 set oncontextmenu(listener) {154 setHandler(this, 'contextmenu', listener)155 }156 get oncopy() {157 return getHandler(this, 'copy')158 }159 set oncopy(listener) {160 setHandler(this, 'copy', listener)161 }162 get oncuechange() {163 return getHandler(this, 'cuechange')164 }165 set oncuechange(listener) {166 setHandler(this, 'cuechange', listener)167 }168 get oncut() {169 return getHandler(this, 'cut')170 }171 set oncut(listener) {172 setHandler(this, 'cut', listener)173 }174 get ondblclick() {175 return getHandler(this, 'dblclick')176 }177 set ondblclick(listener) {178 setHandler(this, 'dblclick', listener)179 }180 get ondevicelight() {181 return getHandler(this, 'devicelight')182 }183 set ondevicelight(listener) {184 setHandler(this, 'devicelight', listener)185 }186 get ondevicemotion() {187 return getHandler(this, 'devicemotion')188 }189 set ondevicemotion(listener) {190 setHandler(this, 'devicemotion', listener)191 }192 get ondeviceorientation() {193 return getHandler(this, 'deviceorientation')194 }195 set ondeviceorientation(listener) {196 setHandler(this, 'deviceorientation', listener)197 }198 get ondeviceorientationabsolute() {199 return getHandler(this, 'deviceorientationabsolute')200 }201 set ondeviceorientationabsolute(listener) {202 setHandler(this, 'deviceorientationabsolute', listener)203 }204 get ondrag() {205 return getHandler(this, 'drag')206 }207 set ondrag(listener) {208 setHandler(this, 'drag', listener)209 }210 get ondragend() {211 return getHandler(this, 'dragend')212 }213 set ondragend(listener) {214 setHandler(this, 'dragend', listener)215 }216 get ondragenter() {217 return getHandler(this, 'dragenter')218 }219 set ondragenter(listener) {220 setHandler(this, 'dragenter', listener)221 }222 get ondragexit() {223 return getHandler(this, 'dragexit')224 }225 set ondragexit(listener) {226 setHandler(this, 'dragexit', listener)227 }228 get ondragleave() {229 return getHandler(this, 'dragleave')230 }231 set ondragleave(listener) {232 setHandler(this, 'dragleave', listener)233 }234 get ondragover() {235 return getHandler(this, 'dragover')236 }237 set ondragover(listener) {238 setHandler(this, 'dragover', listener)239 }240 get ondragstart() {241 return getHandler(this, 'dragstart')242 }243 set ondragstart(listener) {244 setHandler(this, 'dragstart', listener)245 }246 get ondrop() {247 return getHandler(this, 'drop')248 }249 set ondrop(listener) {250 setHandler(this, 'drop', listener)251 }252 get ondurationchange() {253 return getHandler(this, 'durationchange')254 }255 set ondurationchange(listener) {256 setHandler(this, 'durationchange', listener)257 }258 get onemptied() {259 return getHandler(this, 'emptied')260 }261 set onemptied(listener) {262 setHandler(this, 'emptied', listener)263 }264 get onended() {265 return getHandler(this, 'ended')266 }267 set onended(listener) {268 setHandler(this, 'ended', listener)269 }270 get onerror() {271 return getHandler(this, 'error')272 }273 set onerror(listener) {274 setHandler(this, 'error', listener)275 }276 get onfocus() {277 return getHandler(this, 'focus')278 }279 set onfocus(listener) {280 setHandler(this, 'focus', listener)281 }282 get onformdata() {283 return getHandler(this, 'formdata')284 }285 set onformdata(listener) {286 setHandler(this, 'formdata', listener)287 }288 get onfullscreenchange() {289 return getHandler(this, 'fullscreenchange')290 }291 set onfullscreenchange(listener) {292 setHandler(this, 'fullscreenchange', listener)293 }294 get onfullscreenerror() {295 return getHandler(this, 'fullscreenerror')296 }297 set onfullscreenerror(listener) {298 setHandler(this, 'fullscreenerror', listener)299 }300 get ongamepadconnected() {301 return getHandler(this, 'gamepadconnected')302 }303 set ongamepadconnected(listener) {304 setHandler(this, 'gamepadconnected', listener)305 }306 get ongamepaddisconnected() {307 return getHandler(this, 'gamepaddisconnected')308 }309 set ongamepaddisconnected(listener) {310 setHandler(this, 'gamepaddisconnected', listener)311 }312 get ongotpointercapture() {313 return getHandler(this, 'gotpointercapture')314 }315 set ongotpointercapture(listener) {316 setHandler(this, 'gotpointercapture', listener)317 }318 get onhashchange() {319 return getHandler(this, 'hashchange')320 }321 set onhashchange(listener) {322 setHandler(this, 'hashchange', listener)323 }324 get oninput() {325 return getHandler(this, 'input')326 }327 set oninput(listener) {328 setHandler(this, 'input', listener)329 }330 get oninvalid() {331 return getHandler(this, 'invalid')332 }333 set oninvalid(listener) {334 setHandler(this, 'invalid', listener)335 }336 get onkeydown() {337 return getHandler(this, 'keydown')338 }339 set onkeydown(listener) {340 setHandler(this, 'keydown', listener)341 }342 get onkeypress() {343 return getHandler(this, 'keypress')344 }345 set onkeypress(listener) {346 setHandler(this, 'keypress', listener)347 }348 get onkeyup() {349 return getHandler(this, 'keyup')350 }351 set onkeyup(listener) {352 setHandler(this, 'keyup', listener)353 }354 get onlanguagechange() {355 return getHandler(this, 'languagechange')356 }357 set onlanguagechange(listener) {358 setHandler(this, 'languagechange', listener)359 }360 get onload() {361 return getHandler(this, 'load')362 }363 set onload(listener) {364 setHandler(this, 'load', listener)365 }366 get onloadeddata() {367 return getHandler(this, 'loadeddata')368 }369 set onloadeddata(listener) {370 setHandler(this, 'loadeddata', listener)371 }372 get onloadedmetadata() {373 return getHandler(this, 'loadedmetadata')374 }375 set onloadedmetadata(listener) {376 setHandler(this, 'loadedmetadata', listener)377 }378 get onloadstart() {379 return getHandler(this, 'loadstart')380 }381 set onloadstart(listener) {382 setHandler(this, 'loadstart', listener)383 }384 get onlostpointercapture() {385 return getHandler(this, 'lostpointercapture')386 }387 set onlostpointercapture(listener) {388 setHandler(this, 'lostpointercapture', listener)389 }390 get onmessage() {391 return getHandler(this, 'message')392 }393 set onmessage(listener) {394 setHandler(this, 'message', listener)395 }396 get onmessageerror() {397 return getHandler(this, 'messageerror')398 }399 set onmessageerror(listener) {400 setHandler(this, 'messageerror', listener)401 }402 get onmousedown() {403 return getHandler(this, 'mousedown')404 }405 set onmousedown(listener) {406 setHandler(this, 'mousedown', listener)407 }408 get onmouseenter() {409 return getHandler(this, 'mouseenter')410 }411 set onmouseenter(listener) {412 setHandler(this, 'mouseenter', listener)413 }414 get onmouseleave() {415 return getHandler(this, 'mouseleave')416 }417 set onmouseleave(listener) {418 setHandler(this, 'mouseleave', listener)419 }420 get onmousemove() {421 return getHandler(this, 'mousemove')422 }423 set onmousemove(listener) {424 setHandler(this, 'mousemove', listener)425 }426 get onmouseout() {427 return getHandler(this, 'mouseout')428 }429 set onmouseout(listener) {430 setHandler(this, 'mouseout', listener)431 }432 get onmouseover() {433 return getHandler(this, 'mouseover')434 }435 set onmouseover(listener) {436 setHandler(this, 'mouseover', listener)437 }438 get onmouseup() {439 return getHandler(this, 'mouseup')440 }441 set onmouseup(listener) {442 setHandler(this, 'mouseup', listener)443 }444 get onmousewheel() {445 return getHandler(this, 'mousewheel')446 }447 set onmousewheel(listener) {448 setHandler(this, 'mousewheel', listener)449 }450 get onoffline() {451 return getHandler(this, 'offline')452 }453 set onoffline(listener) {454 setHandler(this, 'offline', listener)455 }456 get ononline() {457 return getHandler(this, 'online')458 }459 set ononline(listener) {460 setHandler(this, 'online', listener)461 }462 get onorientationchange() {463 return getHandler(this, 'orientationchange')464 }465 set onorientationchange(listener) {466 setHandler(this, 'orientationchange', listener)467 }468 get onpagehide() {469 return getHandler(this, 'pagehide')470 }471 set onpagehide(listener) {472 setHandler(this, 'pagehide', listener)473 }474 get onpageshow() {475 return getHandler(this, 'pageshow')476 }477 set onpageshow(listener) {478 setHandler(this, 'pageshow', listener)479 }480 get onpaste() {481 return getHandler(this, 'paste')482 }483 set onpaste(listener) {484 setHandler(this, 'paste', listener)485 }486 get onpause() {487 return getHandler(this, 'pause')488 }489 set onpause(listener) {490 setHandler(this, 'pause', listener)491 }492 get onplay() {493 return getHandler(this, 'play')494 }495 set onplay(listener) {496 setHandler(this, 'play', listener)497 }498 get onplaying() {499 return getHandler(this, 'playing')500 }501 set onplaying(listener) {502 setHandler(this, 'playing', listener)503 }504 get onpointercancel() {505 return getHandler(this, 'pointercancel')506 }507 set onpointercancel(listener) {508 setHandler(this, 'pointercancel', listener)509 }510 get onpointerdown() {511 return getHandler(this, 'pointerdown')512 }513 set onpointerdown(listener) {514 setHandler(this, 'pointerdown', listener)515 }516 get onpointerenter() {517 return getHandler(this, 'pointerenter')518 }519 set onpointerenter(listener) {520 setHandler(this, 'pointerenter', listener)521 }522 get onpointerleave() {523 return getHandler(this, 'pointerleave')524 }525 set onpointerleave(listener) {526 setHandler(this, 'pointerleave', listener)527 }528 get onpointerlockchange() {529 return getHandler(this, 'pointerlockchange')530 }531 set onpointerlockchange(listener) {532 setHandler(this, 'pointerlockchange', listener)533 }534 get onpointerlockerror() {535 return getHandler(this, 'pointerlockerror')536 }537 set onpointerlockerror(listener) {538 setHandler(this, 'pointerlockerror', listener)539 }540 get onpointermove() {541 return getHandler(this, 'pointermove')542 }543 set onpointermove(listener) {544 setHandler(this, 'pointermove', listener)545 }546 get onpointerout() {547 return getHandler(this, 'pointerout')548 }549 set onpointerout(listener) {550 setHandler(this, 'pointerout', listener)551 }552 get onpointerover() {553 return getHandler(this, 'pointerover')554 }555 set onpointerover(listener) {556 setHandler(this, 'pointerover', listener)557 }558 get onpointerup() {559 return getHandler(this, 'pointerup')560 }561 set onpointerup(listener) {562 setHandler(this, 'pointerup', listener)563 }564 get onpopstate() {565 return getHandler(this, 'popstate')566 }567 set onpopstate(listener) {568 setHandler(this, 'popstate', listener)569 }570 get onprogress() {571 return getHandler(this, 'progress')572 }573 set onprogress(listener) {574 setHandler(this, 'progress', listener)575 }576 get onratechange() {577 return getHandler(this, 'ratechange')578 }579 set onratechange(listener) {580 setHandler(this, 'ratechange', listener)581 }582 get onreadystatechange() {583 return getHandler(this, 'readystatechange')584 }585 set onreadystatechange(listener) {586 setHandler(this, 'readystatechange', listener)587 }588 get onrejectionhandled() {589 return getHandler(this, 'rejectionhandled')590 }591 set onrejectionhandled(listener) {592 setHandler(this, 'rejectionhandled', listener)593 }594 get onreset() {595 return getHandler(this, 'reset')596 }597 set onreset(listener) {598 setHandler(this, 'reset', listener)599 }600 get onresize() {601 return getHandler(this, 'resize')602 }603 set onresize(listener) {604 setHandler(this, 'resize', listener)605 }606 get onscroll() {607 return getHandler(this, 'scroll')608 }609 set onscroll(listener) {610 setHandler(this, 'scroll', listener)611 }612 get onsecuritypolicyviolation() {613 return getHandler(this, 'securitypolicyviolation')614 }615 set onsecuritypolicyviolation(listener) {616 setHandler(this, 'securitypolicyviolation', listener)617 }618 get onseeked() {619 return getHandler(this, 'seeked')620 }621 set onseeked(listener) {622 setHandler(this, 'seeked', listener)623 }624 get onseeking() {625 return getHandler(this, 'seeking')626 }627 set onseeking(listener) {628 setHandler(this, 'seeking', listener)629 }630 get onselect() {631 return getHandler(this, 'select')632 }633 set onselect(listener) {634 setHandler(this, 'select', listener)635 }636 get onselectionchange() {637 return getHandler(this, 'selectionchange')638 }639 set onselectionchange(listener) {640 setHandler(this, 'selectionchange', listener)641 }642 get onselectstart() {643 return getHandler(this, 'selectstart')644 }645 set onselectstart(listener) {646 setHandler(this, 'selectstart', listener)647 }648 get onslotchange() {649 return getHandler(this, 'slotchange')650 }651 set onslotchange(listener) {652 setHandler(this, 'slotchange', listener)653 }654 get onstalled() {655 return getHandler(this, 'stalled')656 }657 set onstalled(listener) {658 setHandler(this, 'stalled', listener)659 }660 get onstorage() {661 return getHandler(this, 'storage')662 }663 set onstorage(listener) {664 setHandler(this, 'storage', listener)665 }666 get onsubmit() {667 return getHandler(this, 'submit')668 }669 set onsubmit(listener) {670 setHandler(this, 'submit', listener)671 }672 get onsuspend() {673 return getHandler(this, 'suspend')674 }675 set onsuspend(listener) {676 setHandler(this, 'suspend', listener)677 }678 get ontimeupdate() {679 return getHandler(this, 'timeupdate')680 }681 set ontimeupdate(listener) {682 setHandler(this, 'timeupdate', listener)683 }684 get ontoggle() {685 return getHandler(this, 'toggle')686 }687 set ontoggle(listener) {688 setHandler(this, 'toggle', listener)689 }690 get ontouchcancel() {691 return getHandler(this, 'touchcancel')692 }693 set ontouchcancel(listener) {694 setHandler(this, 'touchcancel', listener)695 }696 get ontouchend() {697 return getHandler(this, 'touchend')698 }699 set ontouchend(listener) {700 setHandler(this, 'touchend', listener)701 }702 get ontouchmove() {703 return getHandler(this, 'touchmove')704 }705 set ontouchmove(listener) {706 setHandler(this, 'touchmove', listener)707 }708 get ontouchstart() {709 return getHandler(this, 'touchstart')710 }711 set ontouchstart(listener) {712 setHandler(this, 'touchstart', listener)713 }714 get ontransitioncancel() {715 return getHandler(this, 'transitioncancel')716 }717 set ontransitioncancel(listener) {718 setHandler(this, 'transitioncancel', listener)719 }720 get ontransitionend() {721 return getHandler(this, 'transitionend')722 }723 set ontransitionend(listener) {724 setHandler(this, 'transitionend', listener)725 }726 get ontransitionrun() {727 return getHandler(this, 'transitionrun')728 }729 set ontransitionrun(listener) {730 setHandler(this, 'transitionrun', listener)731 }732 get ontransitionstart() {733 return getHandler(this, 'transitionstart')734 }735 set ontransitionstart(listener) {736 setHandler(this, 'transitionstart', listener)737 }738 get onunhandledrejection() {739 return getHandler(this, 'unhandledrejection')740 }741 set onunhandledrejection(listener) {742 setHandler(this, 'unhandledrejection', listener)743 }744 get onunload() {745 return getHandler(this, 'unload')746 }747 set onunload(listener) {748 setHandler(this, 'unload', listener)749 }750 get onvisibilitychange() {751 return getHandler(this, 'visibilitychange')752 }753 set onvisibilitychange(listener) {754 setHandler(this, 'visibilitychange', listener)755 }756 get onvolumechange() {757 return getHandler(this, 'volumechange')758 }759 set onvolumechange(listener) {760 setHandler(this, 'volumechange', listener)761 }762 get onvrdisplayactivate() {763 return getHandler(this, 'vrdisplayactivate')764 }765 set onvrdisplayactivate(listener) {766 setHandler(this, 'vrdisplayactivate', listener)767 }768 get onvrdisplayblur() {769 return getHandler(this, 'vrdisplayblur')770 }771 set onvrdisplayblur(listener) {772 setHandler(this, 'vrdisplayblur', listener)773 }774 get onvrdisplayconnect() {775 return getHandler(this, 'vrdisplayconnect')776 }777 set onvrdisplayconnect(listener) {778 setHandler(this, 'vrdisplayconnect', listener)779 }780 get onvrdisplaydeactivate() {781 return getHandler(this, 'vrdisplaydeactivate')782 }783 set onvrdisplaydeactivate(listener) {784 setHandler(this, 'vrdisplaydeactivate', listener)785 }786 get onvrdisplaydisconnect() {787 return getHandler(this, 'vrdisplaydisconnect')788 }789 set onvrdisplaydisconnect(listener) {790 setHandler(this, 'vrdisplaydisconnect', listener)791 }792 get onvrdisplayfocus() {793 return getHandler(this, 'vrdisplayfocus')794 }795 set onvrdisplayfocus(listener) {796 setHandler(this, 'vrdisplayfocus', listener)797 }798 get onvrdisplaypointerrestricted() {799 return getHandler(this, 'vrdisplaypointerrestricted')800 }801 set onvrdisplaypointerrestricted(listener) {802 setHandler(this, 'vrdisplaypointerrestricted', listener)803 }804 get onvrdisplaypointerunrestricted() {805 return getHandler(this, 'vrdisplaypointerunrestricted')806 }807 set onvrdisplaypointerunrestricted(listener) {808 setHandler(this, 'vrdisplaypointerunrestricted', listener)809 }810 get onvrdisplaypresentchange() {811 return getHandler(this, 'vrdisplaypresentchange')812 }813 set onvrdisplaypresentchange(listener) {814 setHandler(this, 'vrdisplaypresentchange', listener)815 }816 get onwaiting() {817 return getHandler(this, 'waiting')818 }819 set onwaiting(listener) {820 setHandler(this, 'waiting', listener)821 }822 get onwheel() {823 return getHandler(this, 'wheel')824 }825 set onwheel(listener) {826 setHandler(this, 'wheel', listener)827 }828 get onzoom() {829 return getHandler(this, 'zoom')830 }831 set onzoom(listener) {832 setHandler(this, 'zoom', listener)833 }834 // ignore vendor835 onmsgesturechange836 onmsgesturedoubletap837 onmsgestureend838 onmsgesturehold839 onmsgesturestart840 onmsgesturetap841 onmsinertiastart842 onmspointercancel843 onmspointerdown844 onmspointerenter845 onmspointerleave846 onmspointermove...

Full Screen

Full Screen

ServicesConfig.js

Source:ServicesConfig.js Github

copy

Full Screen

...27 */28 init: function() {29 this.app = this.options.app;30 31 this.app.commands.setHandler("command:login", Login);32 this.app.commands.setHandler("command:logout", Logout);33 this.app.commands.setHandler("command:recoverlogin", Logout);34 this.app.commands.setHandler("command:getbalance", GetBalance);35 this.app.commands.setHandler("command:getPriceAdjustment", GetPriceAdjustment);36 this.app.commands.setHandler("command:getRootLadder", GetRootLadder);37 38 this.app.commands.setHandler("command:getFrontPageSchedule", GetFrontPageSchedule);39 this.app.commands.setHandler("command:getSportSchedule", GetSportSchedule);40 this.app.commands.setHandler("command:getKeyMarketsForSport", GetKeyMarkets);41 this.app.commands.setHandler("command:getEvent", GetEvent);42 this.app.commands.setHandler("command:getCompetitionEvents", GetCompetitionEvents);43 this.app.commands.setHandler("command:getCouponEvents", GetCouponEvents);44 this.app.commands.setHandler("command:getSportDisplayTemplate", GetSportDisplayTemplate);45 this.app.commands.setHandler("command:placeBets", PlaceBets);46 this.app.commands.setHandler("command:getOpenBets", GetOpenBets);47 this.app.commands.setHandler("command:getClosedBets", GetClosedBets);48 this.app.commands.setHandler("command:subscribe:events", SubscriptionCommand);49 this.app.commands.setHandler("command:subscribe:eventDetails", SubscriptionCommand);50 this.app.commands.setHandler("command:subscribe:markets", SubscriptionCommand);51 this.app.commands.setHandler("command:subscribe:schedule", SubscriptionCommand);52 this.success();53 }54 })...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1import { setHandler } from 'storybook-root';2import * as React from 'react';3import { storiesOf } from '@storybook/react';4import { action } from '@storybook/addon-actions';5import { Button } from '@storybook/react/demo';6storiesOf('Button', module)7 .add('with text', () => <Button onClick={action('clicked')}>Hello Button</Button>)8 .add('with some emoji', () => (9 <Button onClick={action('clicked')}>πŸ˜€ 😎 πŸ‘ πŸ’―</Button>10 ));11setHandler('Button', 'with text', 'onClick', (e) => {12 console.log('Hello Button is clicked');13});14setHandler('Button', 'with some emoji', 'onClick', (e) => {15 console.log('πŸ˜€ 😎 πŸ‘ πŸ’― is clicked');16});17setHandler('Button', 'with some emoji', 'onClick', (e) => {18 console.log('πŸ˜€ 😎 πŸ‘ πŸ’― is clicked');19});20setHandler('Button', 'with text', 'onClick', (e) => {21 console.log('Hello Button is clicked');22});23setHandler('Button', 'with some emoji', 'onClick', (e) => {24 console.log('πŸ˜€ 😎 πŸ‘ πŸ’― is clicked');25});26setHandler('Button', 'with text', 'onClick', (e) => {27 console.log('Hello Button is clicked');28});29setHandler('Button', 'with some emoji', 'onClick', (e) => {30 console.log('πŸ˜€ 😎 πŸ‘ πŸ’― is clicked');31});32setHandler('Button', 'with text', 'onClick', (e) => {33 console.log('Hello Button is clicked');34});35setHandler('Button', 'with some emoji', 'onClick', (e) => {36 console.log('πŸ˜€ 😎 πŸ‘ πŸ’― is clicked');37});

Full Screen

Using AI Code Generation

copy

Full Screen

1import { setHandler } from 'storybook-root';2const handler = () => {3 console.log('Hello World');4}5setHandler(handler);6import { getHandler } from 'storybook-root';7export const Root = () => {8 const handler = getHandler();9 handler();10}11{12 "scripts": {13 }14}

Full Screen

Using AI Code Generation

copy

Full Screen

1import { setHandler } from 'storybook-root';2setHandler('log', (data) => {3 console.log(data);4});5const handlers = {};6export const setHandler = (name, handler) => {7 handlers[name] = handler;8};9export const getHandler = (name) => {10 return handlers[name];11};12import { getHandler } from 'storybook-root';13const logHandler = getHandler('log');14logHandler('Hello World');

Full Screen

Using AI Code Generation

copy

Full Screen

1import { setHandler } from 'storybook-root-saga';2import { call } from 'redux-saga/effects';3import { get } from 'lodash';4import { getRootSaga } from 'my-app-root-saga';5import { getRootSaga } from 'my-app-root-saga';6const rootSaga = getRootSaga();7const handler = function* (error, saga, action) {8}9setHandler(handler);10import { setHandler } from 'storybook-root-saga';11import { call } from 'redux-saga/effects';12import { get } from 'lodash';13import { getRootSaga } from 'my-app-root-saga';14import { getRootSaga } from 'my-app-root-saga';15const rootSaga = getRootSaga();16const handler = function* (error, saga, action) {17}18setHandler(handler);19import { setHandler } from 'storybook-root-saga';20import { call } from 'redux-saga/effects';21import { get } from 'lodash';22import { getRootSaga } from 'my-app-root-saga';23import { getRootSaga } from 'my-app-root-saga';24const rootSaga = getRootSaga();25const handler = function* (error, saga, action) {26}27setHandler(handler);28import { setHandler } from 'storybook

Full Screen

Using AI Code Generation

copy

Full Screen

1import { setHandler } from 'storybook-root';2import { App } from './app';3setHandler(App);4import { App } from './app';5import { setHandler } from 'storybook-root';6export const handler = setHandler(App);7import { handler } from './app';8describe('app', () => {9 it('should be a handler', () => {10 expect(handler).toBeTruthy();11 });12});13import { handler } from './app';14import { setHandler } from 'storybook-root';15setHandler(handler);16import { handler } from './app';17describe('index', () => {18 it('should be a handler', () => {19 expect(handler).toBeTruthy();20 });21});22import { setHandler } from 'storybook-root';23import { App } from './app';24setHandler(App);25import { setHandler } from 'storybook-root';26import { App } from './app';27describe('storybook-root', () => {28 it('should be a handler', () => {29 expect(setHandler(App)).toBeTruthy();30 });31});32import { setHandler } from 'storybook-root';33import { App } from './app';34setHandler(App);35import { setHandler } from 'storybook-root';36import { App } from './app';37describe('test', () => {38 it('should be a handler', () => {39 expect(setHandler(App)).toBeTruthy();40 });41});42import { App } from './app';43import { setHandler } from 'storybook-root';44export const handler = setHandler(App);45import { handler } from './app';46describe('app', () => {47 it('should be a handler',

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run storybook-root automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful