-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMano_InputConfig.js
More file actions
6651 lines (6186 loc) · 174 KB
/
Mano_InputConfig.js
File metadata and controls
6651 lines (6186 loc) · 174 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//=============================================================================
// Mano_InputConfig.js
// ----------------------------------------------------------------------------
// Copyright (c) 2017-2021 Sigureya
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
// ----------------------------------------------------------------------------
// Version
// ver 9.3.0 2023/09/30
// ----------------------------------------------------------------------------
// [Twitter]: https://twitter.com/Sigureya/
//=============================================================================
/*:
* @plugindesc ゲームの操作に関する機能をまとめて管理します。
* ユーザーによる拡張も支援します。
* @author しぐれん(https://github.com/Sigureya/RPGmakerMV)
* @url https://raw.githubusercontent.com/Sigureya/RPGmakerMZ/master/Mano_InputConfig.js
*
* @target MZ
* @orderAfter VisuMZ_1_OptionsCore
* @orderAfter MOG_TitleSplashScreen
*
* @command GetButtonName
* @text GetButton/ボタン名の取得
* @desc 指定した操作がどのボタンにあるかを返します。
* Returns which button has the specified action.
* @arg symbol
* @type select
* @option ok(決定)
* @value ok
* @option cancel(取り消し)
* @value cancel
* @option shift(ダッシュ)
* @value shift
* @option menu(メニュー)
* @value menu
* @option pageup(前)
* @value pageup
* @option pagedown(次)
* @value pagedown
* @default ok
*
* @arg nameVariable
* @text ボタン名称/buttonName
* @desc ボタン名称を受け取る変数です。
* Variable to store the result.
* @type variable
* @default 0
* @command GetButtonNameEX
* @text GetButtonEX/ボタン名の取得
* @desc 指定した操作がどのボタンにあるかを返します。
* Returns which button has the specified action.
* @arg symbol
* @desc アクションのシンボル
*
* @arg nameVariable
* @desc ボタン名称を受け取る変数です。
* Variable to store the result.
* @type variable
* @default 0
*
* @command IsKeyboardValid
* @desc キーボードの設定が正しい場合、指定スイッチをONにします。
* @arg switchId
* @type switch
* @default 0
* @desc 結果を保存するスイッチ
* Where to save the results
*
* @command GamepadScene
* @text GamepadScene/ゲームパッド設定を開く
* @desc ゲームパッド設定のシーンを開きます。
* Open the gamepad settings scene.
*
* @command KeyboardScene
* @text KeyboardScene/キーボード設定を開く
* @desc キーボード設定のシーンを開きます。
* Open the keyboard settings scene.
*
* @param color
* @text 色設定/ColorSetting
* @type struct<ColorManager>
* @default {"normal":"#880000","mandatory":"#22e488","move":"#22e488"}
*
* @param basicOk
* @text 決定/ok
* @type struct<BasicSymbol>
* @default {"mandatory":"true","name":"{\"jp\":\"決定\",\"en\":\"OK\"}","keyText":"{\"jp\":\"\",\"en\":\"\"}","helpText":"{\"jp\":\"\",\"en\":\"\"}"}
*
* @param basicCancel
* @text 取り消し/cancle
* @type struct<BasicSymbol>
* @default {"mandatory":"true","name":"{\"jp\":\"キャンセル\",\"en\":\"cancel\"}","keyText":"{\"jp\":\"\",\"en\":\"\"}","helpText":"{\"jp\":\"\",\"en\":\"\"}"}
*
* @param basicShift
* @text ダッシュ/dash
* @type struct<BasicSymbol>
* @default {"mandatory":"true","name":"{\"jp\":\"ダッシュ\",\"en\":\"dash\"}","keyText":"{\"jp\":\"\",\"en\":\"\"}","helpText":"{\"jp\":\"\",\"en\":\"\"}"}
*
* @param basicMenu
* @text メニュー/menu
* @type struct<BasicSymbol>
* @default {"mandatory":"true","name":"{\"jp\":\"メニュー\",\"en\":\"menu\"}","keyText":"{\"jp\":\"\",\"en\":\"\"}","helpText":"{\"jp\":\"\",\"en\":\"\"}"}
*
* @param basicEscape
* @text メニュー(2)/menu(2)
* @type struct<BasicSymbol>
* @default {"mandatory":"true","name":"{\"jp\":\"メニュー/キャンセル\",\"en\":\"menu/cancel\"}","keyText":"{\"jp\":\"\",\"en\":\"\"}","helpText":"{\"jp\":\"\",\"en\":\"\"}"}
*
* @param basicPageup
* @text 次/next
* @type struct<BasicSymbol>
* @default {"mandatory":"true","name":"{\"jp\":\"次\",\"en\":\"next\"}","keyText":"{\"jp\":\"\",\"en\":\"\"}","helpText":"{\"jp\":\"\",\"en\":\"\"}"}
*
* @param basicPagedown
* @text 前/prev
* @type struct<BasicSymbol>
* @default {"mandatory":"true","name":"{\"jp\":\"前\",\"en\":\"prev\"}","keyText":"{\"jp\":\"\",\"en\":\"\"}","helpText":"{\"jp\":\"\",\"en\":\"\"}"}
*
*
*
* @param mapperDelete
* @text 設定を消去/delete
* @type struct<MultiLangString>
* @default {"en":"delete","jp":"設定を消去"}
*
*
* @param extendsMapper
* @desc ボタンイベント・追加の入力設定の登録
* Registration of button events and additional input settings
* @text 入力拡張/inputExtension
* @type struct<InputDefine>[]
* @default []
*
* @param eventList
* @desc コモンイベントの呼び出し設定(簡単版)
* Registration of button events and additional input settings
* @text コモンイベント/CommonEvent
* @type struct<EventDefine>[]
* @default []
*
* @param GamepadIsNotConnectedText
* @text 未接続/GamepadIsNotConnected
* @desc ゲームパッドが接続されていない場合の文章です。
* This is the text when the gamepad is not connected.
* @type struct<MultiLangNote>
* @default {"jp":"\"ゲームパッドが接続されていません\\nボタンを押して再度試してください\"","en":"\"The gamepad is not connected.\\nPress the button and try again.\""}
*
* @param needButtonDetouchText
* @text ボタンから手を放すように促すメッセージ
* @desc キーコンフィグはボタンから手を離さない限り終了しません。
* 手を放すように促すメッセージを設定します。
* @type struct<MultiLangNote>
* @default {"jp":"\"コンフィグを終了するために、\\nボタンから手を放してください。\"","en":"\"Release the button to exit the config.\""}
*
*
*
* @param saveCommand
* @text 設定の保存/SaveSetting
* @type struct<MultiLangString>
* @default {"en":"seve setting","jp":"設定を保存"}
*
* @param saveValidTest
* @text 設定検証/Validating the Configuration
* @desc 入力設定の不備がある場合、保存を禁止。
* If the input settings are incomplete, save is prohibited.
* @type boolean
* @default true
*
* @param saveCommandWidth
* @text 幅/width
* @type number
* @default 4
* @parent saveCommand
*
* @param saveDescription
* @text 説明文/Description
* @type struct<MultiLangString>
* @default {"en":"seve setting","jp":"設定を保存"}
* @parent saveCommand
*
*
* @param resetCommand
* @type struct<MultiLangString>
* @default {"en":"reset","jp":"初期設定に戻す"}
*
* @param resetWidth
* @type number
* @default 4
* @parent resetCommand
*
* @param resetDescription
* @type struct<MultiLangString>
* @default {"en":"reset","jp":"初期設定に戻します。"}
* @parent resetCommand
*
*
* @param WASDCommand
* @type struct<MultiLangString>
* @default {"en":"WASD","jp":"WASD"}
* @param WASDwidth
* @text WASD Command Width
* @type number
* @default 3
* @parent WASDCommand
*
* @param WASDhelp
* @type struct<MultiLangString>
* @default {"en":"seve setting","jp":"WASDのキーで移動できるようにします。"}
* @parent WASDCommand
*
* @param changeKeyLayoutCommand
* @text キー配置/KeyLayout
* @type struct<MultiLangString>
* @default {"jp":"キー配置","en":"Key Layout"}
*
* @param changeKeyLayoutCommandWidth
* @type number
* @default 4
* @parent changeKeyLayoutCommand
*
*
*
* @param exitCommand
* @text やめる/exit
* @type struct<MultiLangString>
* @default {"en":"exit","jp":"やめる"}
*
* @param exitWidth
* @type number
* @default 4
* @parent exitCommand
* @param exitHelp
* @text 説明文
* @type struct<MultiLangString>
* @default {"en":"exit","jp":"変更を保存せずにやめる"}
* @parent exitCommand
*
* @param gamepadConfigCommandText
* @desc ゲームパッドコンフィグを開くコマンドの名前です
* @type struct<MultiLangString>
* @default {"en":"gamepad config","jp":"ゲームパッドコンフィグ"}
*
* @param keyConfigCommandText
* @desc キーコンフィグを開くコマンドの名前です
* @type struct<MultiLangString>
* @default {"en":"keyboard config","jp":"キーコンフィグ"}
*
* @param gamepadSceneBackground
* @type file
* @dir img/titles1/
*
* @param keySceneBackground
* @type file
* @dir img/titles1/
*
* @param SettingsForYEP_OptionsCore
* @type struct<DisguiseAsYEP>
* @default {"gamepad":"true","Keyboard":"true"}
*
* @help
* ※日本語テキストは下の方にあるのでスクロールしてください
*
* Loads the settings at game startup as initial values.
* Detects input changes regardless of where the plugin is installed.
* It is OK even if the button is modified by another plug-in.
*
* The config data set by this plug-in is recorded in the file.
* If you install a new plugin,
* Please reset the config with "Reset to default" after starting the game.
*
* ■ What to do if strange characters such as "? KEY: Symbol" are displayed
* Occurs because the input added by another plugin is unknown.
* If the above display is displayed,
* It can be handled by adding an element to extendsMapper.
* 1. Add an element
* 2. Try either of the following AB methods.
* Copy the character corresponding to A: KEY and paste it into Key Setting.
* B: Copy the characters corresponding to Symbol and paste them into symbol.
* Be careful not to confuse the case.
*
* ■ What to do if a display like unknow: XXXX appears
* The following causes are possible.
* -Symbols were set after the game started (after Scene_Boot)
* -Initialization process was not performed correctly
* It may be improved by moving this plugin down.
*
* ■ Button operation diffusion function
* If the operation is set by another plugin,
* May be set on only one of the gamepad / keyboard.
* In such a case, you can operate it from others by setting it in extendsMapper.
* For example, suppose that the operation is set when you press only T on the keyboard.
* If you want to set the operation for the buttons on the gamepad in this state, set as follows.
* Key setting: T
* Pad button: (any button number)
* By doing this, this plugin will read the behavior set for T on the keyboard and
* Set so that the same function can be used with the buttons on the gamepad.
* The same is true for the opposite.
*
* If the operation is set on both the keyboard and the gamepad,
* Determine which one to prioritize in the overwrite setting.
* When using manual symbol settings (for advanced users)
* Ignore the priority settings and use the contents set manually.
*
* ■ Common event call button
* extendsMapper has an item called "Events".
* If you set an event here, the event will be called when the button is pressed.
* You can use it to create a function to open the map when you press the button.
*
* ■All functions can be used without eval ()
* There are no items in this plugin that use eval ().
* If you're writing a JavaScript expression for use with eval (),
* you're wrong.
*
* ■ If you want to control the transition with a script
* Used when modifying other plugins or switching scenes directly with a script.
* SceneManager.push (Mano_InputConfig.Scene_GamepadConfig); // Gamepad Config
* SceneManager.push (Mano_InputConfig.Scene_KeyConfig); // Keyboard config
* You can now move to the specified scene.
*
* ゲームの起動時の設定を初期値として読み込みます。
* プラグインの導入位置に関わらず、入力の変更を検知します。
* 他のプラグインでボタンが改造されていてもOKです。
*
* このプラグインで設定したコンフィグデータは、ファイルに記録されます。
* 新しいプラグインを入れた場合、
* ゲーム起動後にコンフィグを「初期設定に戻す」でリセットしてください。
*
* ■"?KEY:Symbol"のような変な文字が表示される場合の対処法
* 他のプラグインによって追加された入力が不明なために発生します。
* 上記のような表示が出ている場合、
* extendsMapperに要素を追加することで対応できます。
* 1.要素を追加する
* 2.下記のABどちらかの方法を試す。
* A:KEYにあたる部分の文字をコピーして、KeySettingに貼り付ける。
* B:Symbolにあたる部分の文字をコピーし、symbolに貼り付ける。
* 大文字・小文字を間違えないように注意すること。
*
* ■unknow:XXXXのような表示が出る場合の対処法
* 以下の原因が考えられます。
* ・シンボルの設定がゲーム起動後(Scene_Bootより後)で行われた
* ・初期化処理が正しく行われなかった
* このプラグインを下の方に移動することで改善する可能性があります。
*
* ■ボタン操作拡散機能
* 他のプラグインで操作が設定されている場合に、
* ゲームパッド・キーボードの片方にしか設定されていない場合があります。
* そういった場合、extendsMapperで設定を行うことで他からも操作できるようになります。
* 例えば、キーボードのTにのみ押した場合の動作が設定されているとします。
* この状態でゲームパッドのボタンにも操作を設定する場合、以下のように設定します。
* キー設定:T
* パッドボタン:(任意のボタン番号)
* こうすることで、このプラグインはキーボードのTに設定されている動作を読み込み、
* ゲームパッドのボタンでも同じ機能が使えるように設定を行います。
* 逆の場合も同様です。
*
* キーボードとゲームパッドの双方に操作が設定されている場合、
* どちらを優先するかを上書き設定で決めます。
* シンボル手動設定(上級者向け)を使った場合、
* 優先設定を無視して手動設定による内容を使います。
*
* ■コモンイベント呼び出しボタン
* extendsMapperには「イベント」という項目があります。
* ここにイベントを設定すると、ボタンが押された時にイベントを呼び出します。
* ボタンを押したら地図を開く機能を作る時などに使えます。
*
* ■eval()無しで全機能が使えます
* このプラグインにはeval()を使う項目はありません。
* eval()で使うJavaScriptの式を書いている場合、あなたは間違っています。
*
* ■スクリプトで遷移を制御したい場合
* 他のプラグインを改造したり、スクリプトで直接シーンを切り替える時に使います。
* SceneManager.push(Mano_InputConfig.Scene_GamepadConfig ); //ゲームパッドコンフィグ
* SceneManager.push(Mano_InputConfig.Scene_KeyConfig ); // キーボードコンフィグ
* これで、指定されたシーンに移動できます。
*
* 更新履歴
* 2023/09/30 ver 9.2.0
* PS5 DualSenseで配置が大きく異なるので仮対応
*
* 2023/07/05 ver 9.2.1
* null参照で落ちる不具合があったのを修正
*
* 2023/04/16 ver 9.2.0
* 標準の操作の必須指定を変更可能に。
* その他、軽微なバグ修正。
*
* 2022/10/13 ver 9.0.0
* 内部処理を作り直し。
*
* 2022/06/10 ver 8.1.0
* コモンイベントの設定方法が複雑という意見があったので簡易版を作成。
*
* 2022/03/15 ver 8.0.1
* ゲームパッドコンフィグをリニューアル。
* MV環境での不具合を修正
*
* 2022/03/08 ver 7.1.0
* シンボルに対してボタンを割り当てる方式の廃止。
* メンテナンスコストが大きいため。
* ver8.0に向けた準備工事。
*
* 2022/01/18 ver7.0.1
* PP_Optionとの連携関連で不具合があったのを修正。
*
* 2021/12/30 ver7.0.0
* プラグインパラメータ「入力拡張」を中心に大改造。
*
* 2021/12/24 ver6.3.1
* エラーメッセージの英語表記を追加。
*
* 2021/12/22 ver6.3.0
* シンボル設定関連を更新。
* ヘルプの内容を追加。
*
* 2021/12/18 ver6.2.1
* ラムダ式関連の記述を修正した際に、バグを埋め込んでいたのを修正。
* プラグインコマンドを追加。
*
* 2021/11/30 ver6.2.0
* ManoPP_VisuMZ_OptionCore対応を実装。
*
* 2021/08/30 ver6.1.2
* 一部環境でラムダ式がエラーを起こすため、使用しない形に修正
* 一部テキストが日本語のままだったのを英語対応
*
* 2021/07/17 ver6.1.1
* 拡張入力の上書き設定が機能していないのを修正
*
* 2021/06/13 ver6.1.0
* シンボルからボタンの名称を取得するプラグインコマンドを追加(MZのみ)
*
* 2021/05/23 ver 6.0.0
* ゲームパッドにシンボルに対してボタンを割り当てる機能を実装。
*
*
* 2021/04/22 ver 5.4.0
* MZのみ:タッチボタンの表示機能を試験的に実装
*
* 2021/04/15 ver 5.3.1
* コモンイベント呼び出しを修正(簡単にしました)
* イベントコマンドでコンフィグを開くと保存されない不具合を修正
*
* 2021/02/23 ver 5.3.0
* ボタン入力がある時にコモンイベントを呼び出すプラグインコマンドを追加
*
* 2021/01/27 ver 5.2.0
* 不明なシンボルの表示機能を強化
*
* 2021/01/23 ver5.1.0
* 画面レイアウトを変更
* 必須シンボルの扱いを調整
* 不明なシンボルがある場合、画面上部へ表示するようにした
*
* 2020/12/25 ver5.0.3
* 必須シンボルチェックの動作が正しくなかったのを修正
* バージョン管理を修正し、番号付けを変更。
*
* 2020/12/25 ver5.0.2(旧5.2)
* 拡張シンボル設定にバグがあったので修正
*
* 2020/11/26 ver5.0.1(旧5.1)
* プラグインが起動できないバグがあったので修正
*
* 2020/11/24 ver5.0
* プラグインパラメータを再設計。
* 内部実装であるsymbolを意識する必要が無くなりました。
*
* 2020/08/23 ver4.0
* ツクールMZに対応。
* 基本システムはMZ向けに最適化し、MVはラッパーで調整
*
* 2020/05/25 ver 3.2
* YEP_OptionCoreと競合するので、対策処理を追加。
*
* 2020/04/01 ver 3.1
* 英語対応につきヘルプを追加。
*
* 2020/03/14 ver3.0
* WASD移動を設定できる機能を追加。
* キーコンフィグの内部実装を大幅改造。
*
* 2020/02/26 ver2.9
* コンフィグから抜けた際にボタンが連打されてしまう問題を対策。
* RPGアツマールにおいて、他のゲームとコンフィグ設定が混ざる問題を修正。
* 別プラグインとの競合があったので対策
* symbolAutoSelectがキーコンフィグで機能していなかったのを修正。
*
* 2019/07/12 ver2.8.1
* ゲームパッドのハードごとの識別情報を表示する機能を追加。
*
* 2019/07/06 ver2.8
* 外部プラグインによって追加されたmapperのsymbolを強制的に取り込む機能。
* プラグインパラメータで無効化できます。
*
* 2019/03/19 ver2.7
* キーボードに任意の初期設定を割り当てる機能を追加。
*
* 2018/09/28 ver2.6
* ゲームパッドコンフィグを改造すると誤作動があったので、誤作動を減らす修正。
* プラグインの位置に関わらず初期設定の変更を捕まえられるように。
*
* 2018/06/25 ver 2.5
* 色々あった細かいバグ修正を重ねた最新版。
*
* 2017/10/21 ver 2.2 更新
* 外部から追加したシンボルがsymbolsと重複していた場合、追加しないようにした。
* USキー配列に仮対応。
*
* 2017/10/18 ver 2.1 更新
* キーボードで目立ったバグの報告がなかったため、2.0に。
* 外部からコンフィグを改造できる機能を導入。
*
* 2017/10/13 ver 1.9 更新
* キーボードのコンフィグにも対応。
* 仕様が固まっていないので、1.9とします。
* 2017/10/05 ver 1.0 公開
*
*/
/*~struct~BasicSymbol:
* @param mandatory
* @text 必須扱い/mandatory
* @type boolean
* @default true
*
* @param name
* @type struct<MultiLangString>
* @default {"jp":"","en":""}
*
* @param keyText
* @text キーの表示/keyText
* @desc キーコンフィグの際の表示名を定義します(空欄OK)
* Define the display name for key config (blank OK)
* @type struct<MultiLangString>
* @default {"jp":"","en":""}
*
* @param helpText
* @text 詳細/helpText
* @desc 画面上部に表示する説明文
* Description to be displayed at the top of the screen
* @type struct<MultiLangNote>
* @default {"jp":"","en":""}
*
*/
/*~struct~TouchButton:
* @param image
* @type file
* @dir img/
* @desc 通常時は上の半分、押されている間は下の半分が使われます。
* upper is used normally, and lower is used when pressed.
* @default system
*
* @param x
* @type number
* @default 0
*
* @param y
* @type number
* @default 0
*
*/
/*~struct~EventCaller:
* @param id
* @text 呼び出すイベント/event
* @desc ボタンを押した際に呼び出すコモンイベント(マップのみ)
* Common event to call when a button is pressed(MapOnly)
* @type common_event
* @default 0
*
* @param inputType
* @text 入力方式/inputType
* @desc 呼び出し時のボタンの入力形式。
* Button input format when calling.
* @type select
* @option 押されている/pressed
* @value 0
* @option トリガー/triggerd
* @value 1
* @option リピート/repeated
* @value 2
* @default 0
*/
/*~struct~KeyboradSetting:
* @param keys
* @type string
* @desc 半角英字で設定。例 Ef65
* Set the key corresponding to the action (ex:Ef65)
*
* @param exKeys
* @text 追加のキー
* @desc 文字以外の特殊なキーを割り当てる場合に使用します。
* @type select[]
* @option Tab(9)
* @value 9
* @option Shift(16)
* @value 16
* @option CTRL(17)
* @value 17
* @option Alt(18)
* @value 18
* @option pageup(33)
* @value 33
* @option PageDown(34)
* @value 34
* @option End(35)
* @value 35
* @default []
*
* @param text
* @text キーの表示/keyText
* @desc キーコンフィグの際の表示名を定義します(空欄OK)
* Define the display name for key config (blank OK)
* @type struct<MultiLangString>
* @default {"jp":"","en":""}
*
*/
/*
* TODO:あとでキー設定にカラーを追加
* @param color
* @type combo
* @option #FF00FF
* @default
*
*/
/*~struct~AdvancedSetting:
* @param symbol
* @text シンボル/symbol
* @desc ボタンを押した場合の動作(上級者向け)
* Operation when the button is pressed (for advanced users)
* @type string
* @default
*
* @param overwrite
* @text 上書き/overwrite
* @desc どのボタンのシンボルを基準にするか
* Which button symbol to base on
* @type select
* @option 上書きしない/none
* @value 0
* @option ゲームパッド/gamepad
* @value 1
* @option キーボード/Keyboard
* @value 2
* @option イベント/event
* @value 3
* @default 0
*
* @param mandatory
* @text 必須フラグ/mandatory
* @type boolean
* @default false
*/
/*~struct~EventDefine:
*
* @param key
* @type select
* @option none/設定無し
* @value
* @option A
* @option B
* @option C
* @option D
* @option E
* @option F
* @option G
* @option H
* @option I
* @option J
* @option K
* @option L
* @option M
* @option N
* @option O
* @option P
* @option Q
* @option R
* @option S
* @option T
* @option U
* @option V
* @option W
* @option X
* @option Y
* @option Z
* @default
*
* @param keyText
* @desc キーコンフィグの際に表示するテキスト
* @type struct<MultiLangString>
* @default {"jp":"","en":""}
*
*
* @param button
* @text パッドボタン/padButton
* @desc ボタン設定。配置と名前は任天堂のスタイルを想定。
* Button settings. The layout and name the style of Nintendo.
* @type select
* @default NaN
* @option none
* @value NaN
* @option 0(B/×)
* @value 0
* @option 1(A/○)
* @value 1
* @option 2(X/□)
* @value 2
* @option 3(Y/△)
* @value 3
* @option 4(L1)
* @value 4
* @option 5(R1)
* @value 5
* @option 6(L2)
* @value 6
* @option 7(R2)
* @value 7
* @option 8(select)
* @value 8
* @option 9(start)
* @value 9
* @option 10(L3)
* @value 10
* @option 11(R3)
* @value 11
* @option 16(center)
* @value 16
*
* @param name
* @text 行動名/actionName
* @desc 言語別に行動の説明を入力します
* Enter a description of the action by language
* @type struct<MultiLangString>
* @default {"jp":"","en":""}
*
* @param helpText
* @text 詳細/helpText
* @desc 画面上部に表示する説明文
* Description to be displayed at the top of the screen
* @type struct<MultiLangString>
* @default {"jp":"","en":""}
*
* @param event
* @text イベント/event
* @desc ボタンを押した際にコモンイベントを実行します。
* Executes a common event when the button is pressed.
* @type struct<EventCaller>
* @default {"id":"0","inputType":"0"}
*
* @param enabled
* @text 有効化
* @desc テスト用に一時的に無効化したい場合などで使います。
* @type boolean
* @default true
*/
/*~struct~InputDefine:
*
*
* @param keySetting
* @text キー設定/keySetting
* @type struct<KeyboradSetting>
* @default {"keys":"","color":"","text":"{\"jp\":\"\",\"en\":\"\"}"}
*
* @param button
* @text パッドボタン/padButton
* @desc ボタン設定。配置と名前は任天堂のスタイルを想定。
* Button settings. The layout and name the style of Nintendo.
* @type select
* @default NaN
* @option none
* @value NaN
* @option 0(B/×)
* @value 0
* @option 1(A/○)
* @value 1
* @option 2(X/□)
* @value 2
* @option 3(Y/△)
* @value 3
* @option 4(L1)
* @value 4
* @option 5(R1)
* @value 5
* @option 6(L2)
* @value 6
* @option 7(R2)
* @value 7
* @option 8(select)
* @value 8
* @option 9(start)
* @value 9
* @option 10(L3)
* @value 10
* @option 11(R3)
* @value 11
* @option 16(center)
* @value 16
*
* @param name
* @text 行動名/actionName
* @desc 言語別に行動の説明を入力します
* Enter a description of the action by language
* @type struct<MultiLangString>
* @default {"jp":"","en":""}
*
* @param helpText
* @text 詳細/helpText
* @desc 画面上部に表示する説明文
* Description to be displayed at the top of the screen
* @type struct<MultiLangString>
* @default {"jp":"","en":""}
*
* @param event
* @text イベント/CommonEvent
* @desc ボタンを押した際にコモンイベントを実行します。
* Executes a common event when the button is pressed.
* @type struct<EventCaller>
* @default {"id":"0","inputType":"0"}
*
* @param touchButton
* @text タッチボタン/touchButton
* @type struct<TouchButton>
* @desc MZのみ:画面上にタッチUI向けのボタンを追加します
*
* @param adovanced
* @text 上級者向け/adovanced
* @desc 多くの場合、これを変更する必要はありません。
* In most cases you do not need to change this.
* @type struct<AdvancedSetting>
* @default {"symbol":"","overwrite":"0","mandatory":"false"}
*
* @param enabled
* @text 有効化
* @desc テスト用に一時的に無効化したい場合などで使います。
* @type boolean
* @default true
*/
/*
* @param sourcePlugin
* @desc 指定した名前のプラグインがONの場合のみ、有効化します
* @type combo
* @default
*/
/*~struct~MultiLangNote:
* @param jp
* @text 日本語
* @type multiline_string
* @type note
* @param en
* @type multiline_string
* @type note
*/
/*~struct~MultiLangNoteFull:
* @param jp
* @text 日本語
* @type multiline_string
* @type note
* @param en
* @type multiline_string
* @type note
* @param ch
* @text 中文
* @type multiline_string
* @type note
* @param ko
* @text 한국
* @type multiline_string
* @type note
* @param ge
* @text Deutsche
* @type multiline_string
* @type note
* @param fr
* @text français
* @type multiline_string
* @type note
* @param ru
* @text русский
* @type multiline_string
* @type note
*/
/*~struct~MultiLangString:
* @param jp
* @text 日本語
* @param en
* @text English
*/
/*~struct~MultiLangStringFull:
* @param jp
@text 日本語
@param en
@text English
@param ch
@text 中文
@param ko
@text 한국
@param ge
@text Deutsche
@param fr
@text français
@param ru
@text русский
*/
/*~struct~ColorManager:
*
* @param normal
* @default #880000
*
* @param mandatory
* @text 必須シンボル/mandatory
* @default #22e488
*
* @param move
* @text 移動/move
* @default #22e488
*
* @param extends
* @text 拡張シンボル/extends
* @default #22e488
*
*
*/
/*~struct~DisguiseAsYEP:
* @param gamepad
* @desc Impersonate the configuration as if it were GamepadConfig.js (by Yanfly).
* @type boolean
* @default true
*
* @param Keyboard
* @desc Impersonate the configuration as if it were YEP_KeyboardConfig.js (by Yanfly).
* @type boolean
* @default true
*/
//@ts-ignore
var Imported = Imported || {};
if(Imported.Mano_InputConfig){
throw new Error("Mano_InputConfig is Duplicate")
}
Imported.Mano_InputConfig = true;
const Mano_InputConfig=( function(){
'use strict'
//型Conceptp宣言 クラスの前方宣言みたいなやつ
/**
* @typedef {Object} MyRectType
* @property {Number} x
* @property {Number} y
* @property {Number} width
* @property {Number} height
* @property {()=>MyRectType} clone
*/
/**
*
* @typedef {object} CommandConcept
* @property {()=>string} handle
* @property {()=>string} name
*
*/
/**
* @typedef {object} KeyConfigWindowConcept
* @property {(index:number)=>Rectangle} baseRect
* @property {(index:number)=>Rectangle} itemRect
* @property {(commandName:string,rect:Rectangle)=>void} drawCommandXX
* @property {(keyNumber:number)=>I_SymbolDefine} symbolObjectFromKeyNumber
* @property {(key,inputDef:I_SymbolDefine,rect:Rectangle)=>void} drawInputDefine
*/