-
Notifications
You must be signed in to change notification settings - Fork 3
/
TsumioMenuSystem.js
2218 lines (1982 loc) · 73.3 KB
/
TsumioMenuSystem.js
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
//=============================================================================
// TsumioMenuSystem.js
// ----------------------------------------------------------------------------
// Copyright (c) 2017 Tsumio
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
// ----------------------------------------------------------------------------
// Version
// 1.1.4 2019/07/12 SVアクターが正常に表示されない不具合を修正。
// 1.1.3 2017/10/27 情報ウィンドウのリアルタイム更新機能を追加。
// 1.1.2 2017/10/13 メソッド名を修正。
// 1.1.1 2017/10/12 バグ修正。背景設定・ウィンドウスキン設定・DestinationWindow.jsとの連携機能の追加。
// 1.1.0 2017/10/11 コンテンツの高さパラメーターの追加とコードの改善。
// 1.0.2 2017/10/10 バグ修正とコードの改善。
// 1.0.1 2017/10/10 バグ修正と設定項目の追加。
// 1.0.0 2017/10/09 公開。
// ----------------------------------------------------------------------------
// [GitHub] : https://github.com/Tsumio/rmmv-plugins
// [Blog] : http://ntgame.wpblog.jp/
// [Twitter]: https://twitter.com/TsumioNtGame
//=============================================================================
/*:
* @plugindesc 選單畫面改造插件
* @author ツミオ(翻譯 : ReIris)
*
* @param ----基本的な設定----
* @text ----基本設定----
* @desc
* @default
*
* @param メニューの行数
* @text 選單行數
* @type number
* @max 10
* @desc 設置選單行數。
* @default 2
*
* @param メニューの最大列数
* @text 選單列數
* @type number
* @max 10
* @desc 設置選單列的最大數量。
* @default 5
*
* @param ステータスの最大列数
* @text 狀態最大列數
* @type number
* @max 10
* @desc 設置狀態窗口中的最大列數。推薦 3 - 5 列。
* @default 4
*
* @param 章ウィンドウを表示する
* @text 章節窗口顯示
* @type boolean
* @desc 設置是否顯示章節窗口。
* @default true
*
* @param 章ウィンドウの高さ
* @text 章節窗口高度
* @type number
* @max 1000
* @desc 設置章節窗口高度。
* @default 70
*
* @param ステータスウィンドウの高さ
* @text 狀態窗口高度
* @type number
* @max 1000
* @desc 設置狀態窗口的高度。
* @default 290
*
*
* @param 顔グラフィックのサイズ
* @text 臉圖尺寸
* @type struct<Size>
* @desc 設置臉圖的大小。
* 初期 : 105*30 / 全尺寸 : 144*144
* @default {"width":"105","height":"30"}
*
*
* @param サブウィンドウのフォントサイズ
* @text 子窗口字體大小
* @type number
* @max 1000
* @desc 設置子窗口的字體大小(小技巧窗口和訊息窗口)。
* @default 17
*
* @param ----ヘルプの設定----
* @text ----幫助窗口設定----
* @desc
* @default
*
* @param ヘルプを利用する
* @text 是否使用幫助窗口?
* @type select
* @option 利用
* @value On
* @option 開關
* @value Switching
* @option 不利用
* @value Off
* @desc 設置是否使用幫助。
* @default Switching
*
* @param ヘルプ用テキスト
* @text 幫助窗口文字內容
* @type string[]
* @desc 按命令的順序設置幫助文本。
* @default ["移動到道具頁面。", "移動到技能頁面。", "移動到裝備頁面。", "移動到狀態頁面。", "進行組隊功能。", "移動到設置頁面。", "移動到存檔頁面。", "結束遊戲"]
*
* @param ----文字列の設定----
* @text ----文字設定----
* @desc
* @default
*
* @param 項目名の色
* @text 項目名稱顏色
* @type number
* @max 31
* @desc 設置子窗口中項目名稱的顏色。
* 顏色和數字之間的對應關係基於窗口圖片(Windowskin)。
* @default 1
*
* @param 項目内容の色
* @text 項目內容顏色
* @type number
* @max 31
* @desc 設置子窗口中項目內容的顏色。
* 顏色和數字之間的對應關係基於窗口圖片(Windowskin)。
* @default 0
*
* @param 現在地を表す文字列
* @text 所在地點的顯示文字
* @type string
* @desc 設置表示所在地點的文字。
* @default 所在地點
*
* @param 所持金を表す文字列
* @text 金錢的顯示文字
* @type string
* @desc 設置表示所持金錢的文字。
* @default 金錢
*
* @param 戦闘回数を表す文字列
* @text 戰鬥次數的顯示文字
* @type string
* @desc 設置表示戰鬥次數的文字。
* @default 戰鬥次數
*
* @param プレイ時間を表す文字列
* @text 遊玩時間的顯示文字
* @type string
* @desc 設置表示遊玩時間的文字。
* @default 遊玩時間
*
* @param オプション1
* @text 項目 1
* @type string
* @desc 設置表示項目 1 的文字。
* @default 項目 1
*
* @param オプション1の内容
* @text 項目 1 的內容
* @type string
* @desc 設置項目 1 的內容。如果要指定變數內容,請輸入例如 \V[1]。
* @default \V[1]
*
* @param オプション2
* @text 項目 2
* @type string
* @desc 設置表示項目 2 的文字。
* @default 項目 2
*
* @param オプション2の内容
* @text 項目 2 的內容
* @type string
* @desc 設置項目 2 的內容。與 Chronus.js 併用的情況,分別寫入[Chronus1]或[Chronus2]。
* @default [Chronus2]
*
*
* @param ----背景の設定----
* @text ----背景設定----
* @desc
* @default
*
* @param メイン背景の画像
* @text 主選單背景圖片
* @type file
* @require 1
* @desc 設置主選單背景圖片。
* @dir img/tsumio
* @default
*
* @param メイン背景の設定
* @text 主選單背景設定
* @type struct<Background>
* @desc 設定主選單背景設置。如果為寬度和高度設置負值,則替換為畫面大小。
* @default {"x":"0", "y":"0", "width":"-1", "height":"-1", "speedX":"0.00", "speedY":"0.00"}
*
* @param サブ背景の画像
* @text 子選單背景圖片
* @type file
* @require 1
* @desc 設置子選單背景圖片。
* @dir img/tsumio
* @default
*
* @param サブ背景の設定
* @text 子選單背景設定
* @type struct<Background>
* @desc 設置子選單背景設置。如果為寬度和高度設置負值,則替換為畫面大小。
* @default {"x":"0", "y":"0", "width":"-1", "height":"-1", "speedX":"0.00", "speedY":"0.00"}
*
* @param パーティクルの画像
* @text 粒子圖片
* @type file
* @require 1
* @desc 設置粒子圖片。
* @dir img/tsumio
* @default
*
* @param パーティクルの設定
* @text 粒子設定
* @type struct<Particle>
* @desc 設定粒子設置。如果為寬度和高度設置負值,則替換為畫面大小。
* @default {"x":"0", "y":"0", "width":"-1", "height":"-1", "speedX":"-1.00", "speedY":"1.00", "opacity":"150", "blendMode":"0"}
*
* @param パーティクルの点滅
* @text 粒子是否閃爍?
* @type boolean
* @desc 設置是否使粒子閃爍。
* @default true
*
* @param ----特殊な設定----
* @text ----特殊設定----
* @desc
* @default
*
* @param 比率
* @text 比例
* @type number[]
* @max 1
* @decimals 2
* @desc 設置子窗口中文本的排列比例。
* @default ["0.00", "0.35", "0.70"]
*
* @param コンテンツの高さ
* @text 內容高度
* @type struct<LineHeight>
* @desc 設置狀態窗口中的內容高度。數字越大,顯示的越低。
* @default {"class":"-1", "face":"0", "name":"1", "level":"2", "icons":"2", "hp":"3", "mp":"4", "tp":"5", "exp":"6"}
*
* @param ウィンドウスキン
* @text 窗口樣式
* @type struct<WindowSkin>
* @desc 設置每個窗口的外觀樣式。
* @default {"command":"", "status":"", "chapter":"", "tips":"", "info":""}
*
* @param 情報ウィンドウの更新
* @text 情報窗口更新
* @type number
* @min -1
* @desc 使用指定幀數更新訊息窗口。如果設置了負值,則不會更新。
* @default -1
*
*
* @help 更改選單畫面的插件
*
* 【特色】
* 修改選單排版。
* 改進了選單的按鍵操作。
* 提供章節顯示窗口。
* 提供用於顯示小技巧的窗口。
* 可以在訊息窗口中顯示任意變數內容。
* 插件命令設置的訊息將保存在儲存檔案中。
* 可以連接トリアコンタンさん創建的 Chronus.js 插件。
*
* 【使用方法】
* 安裝插件後,您可以通過設置插件參數來使用它。
* 側視戰鬥圖繪顯示在選單畫面,但當資料庫「使用側視圖戰鬥」為關閉時不顯示。
*
* 【章節窗口】
* 您可以從插件命令設置章節標題。
* 它還可用於顯示選單幫助。
* 有關詳細信息,請參閱插件參數中的「使用幫助」。
* 可以使用控制字元。
*
* 從 v1.0.1 版本開始,可以隱藏章節窗口。
* 隱藏章節窗口的情況,參數中設定的章節窗口高度會分給其他窗口顯示。
* 此時,要放大的窗口是小技巧窗口和訊息窗口。
* 如果要放大狀態窗口,請使用插件參數更改狀態窗口的高度。
*
* 【小技巧窗口】
* 可以通過插件命令設置每個小技巧說明。
* 可以使用控制字元。
*
* 【項目】
* 可以在插件參數的「項目」中寫入任意訊息。
* 例如,如果輸入「\V[1]」,項目將顯示變數 1 的內容。
*
* 【與 Chronus.js 併用】
* 該插件支持與トリアコンタンさん的 Chronus.js 的併用。
* 如果在選項內容中輸入「[Chronus1]」,將獲取日期和時間格式 1。
* 如果輸入「[Chronus2]」,將獲取日期和時間格式 2。
*
* 参考URL:https://raw.githubusercontent.com/triacontane/RPGMakerMV/master/Chronus.js
*
* 【與 DestinationWindow.js 併用】
* 此插件支持與トリアコンタンさん的 DestinationWindow.js 的併用。
* 如果您在項目內容中輸入「[Destination]」,將獲得設定的操作目標。
*
* 参考URL:https://raw.githubusercontent.com/triacontane/RPGMakerMV/master/DestinationWindow.js
*
*【內容高度】
* 通過設置插件參數內容的高度,您可以更改狀態窗口中顯示內容的高度。
* 數字越大,顯示內容越下方。
* 請注意,高度不是以像素為單位指定,而是以行的形式指定。
*
* 【背景圖片和粒子】
* 您可以設置背景圖片和粒子。
* 子背景顯示在主背景上方。
* 通過更改 X 座標和 Y 座標速度,您還可以循環和移動圖片。
*
* 【窗口樣式】
* 如果未設置窗口樣式,則使用標準窗口樣式。
*
* 【情報窗口更新】
* 訊息窗口在指定的幀更新(如果指定了-1,則不執行更新)。
* 推薦使用 60 幀。
* 另外,使用 Chronus.js 不能更新。
*
* 【插件命令】
* 所有插件命令均以「TMS」開頭。
* 另外,在說明中,括號用於提醒,但實際輸入插件命令時不必輸入括號。
*
* 所有插件命令都區分大小寫。
* 用半形空格(不是全形)分隔每個字。
* 請注意不要犯錯誤。
*
* 「TMS setChapterName 設定的文字內容」 : 設置在章節窗口中的文本。可以使用控制字元。
* 「TMS setTips1 設定的文字內容」 : 設置在小技巧窗口上部的文本。可以使用控制字元。
* 「TMS setTips2 設定的文字內容」 : 設置在小技巧窗口下部的文本。可以使用控制字元。
*
* 【其他】
* 選單畫面上的關鍵操作規範與普通 MV 不同。
* 基本上,如果您認為可操作性已經提高,則沒有問題。
* 但如果您使用插件來改善按鍵操作,則可能會發生衝突。
*
* 此外,如果您更改解析度或更改行數或列數,您可能會遇到錯誤。
*
* 【更新紀錄】
* 1.1.4 2019/07/12 SVアクターが正常に表示されない不具合を修正。
* 1.1.3 2017/10/27 情報ウィンドウのリアルタイム更新機能を追加。
* 1.1.2 2017/10/13 メソッド名の修正。
* 1.1.1 2017/10/12 バグ修正。背景設定・ウィンドウスキン設定・DestinationWindow.jsとの連携機能の追加。
* 1.1.0 2017/10/11 コンテンツの高さパラメーターの追加とコードの改善。
* 1.0.2 2017/10/10 バグ修正とコードの改善。
* 1.0.1 2017/10/10 バグ修正と設定項目の追加。
* 1.0.0 2017/10/09 公開。
*
* 【備註】
* 對於因使用此插件而造成的任何損害,製作人不承擔任何責任。
*
* 【使用聲明】
* 除非他聲稱自己是插件作者,否則未經作者許可,可以對其進行修改和二次發布。
* 使用形式沒有限制(商業用途,18禁止使用)。
* 請自由使用。
* 作者 ツミオ 聯絡 :
* [GitHub] : https://github.com/Tsumio/rmmv-plugins
* [Blog] : http://ntgame.wpblog.jp/
* [Twitter]: https://twitter.com/TsumioNtGame
*
*/
/*~struct~Size:
*
* @param width
* @text 寬
* @type number
* @desc 寬度。
*
* @param height
* @text 高
* @type number
* @desc 高度。
*/
/*~struct~Background:
*
* @param x
* @text X 座標
* @type number
* @min -2000
* @max 2000
* @desc X座標。
*
* @param y
* @text Y 座標
* @type number
* @min -2000
* @max 2000
* @desc Y 座標。
*
* @param width
* @text 寬
* @type number
* @min -2000
* @max 2000
* @desc 寬度。
*
* @param height
* @text 高
* @type number
* @min -2000
* @max 2000
* @desc 高度。
*
* @param speedX
* @text X 座標速度
* @type number
* @min -255
* @max 255
* @decimals 2
* @desc X 座標的速度。
*
* @param speedY
* @text Y 座標速度
* @type number
* @min -255
* @max 255
* @decimals 2
* @desc Y 座標的速度。
*
*/
/*~struct~Particle:
*
* @param x
* @text X 座標
* @type number
* @min -2000
* @max 2000
* @desc X 座標。
*
* @param y
* @text Y 座標
* @type number
* @min -2000
* @max 2000
* @desc Y座標。
*
* @param width
* @text 寬
* @type number
* @min -2000
* @max 2000
* @desc 寬度。
*
* @param height
* @text 高
* @type number
* @min -2000
* @max 2000
* @desc 高度。
*
* @param speedX
* @text X 座標速度
* @type number
* @min -255
* @max 255
* @decimals 2
* @desc X 座標的速度。
*
* @param speedY
* @text Y 座標速度
* @type number
* @min -255
* @max 255
* @decimals 2
* @desc Y 座標的速度。
*
* @param opacity
* @text 透明度
* @type number
* @max 255
* @desc 透明度。
*
* @param blendMode
* @text 合成模式
* @type number
* @max 3
* @desc 合成模式。0:通常 1:加算 2:乗算 3:畫面
* (0:Normal 1:Addition 2:Multiplication 3:Screen)。
*
*/
/*~struct~LineHeight:
*
* @param class
* @text 職業
* @type number
* @min -255
* @max 255
* @desc 職業。
*
* @param face
* @text 臉圖
* @type number
* @min -255
* @max 255
* @desc 臉圖。
*
* @param name
* @text 名稱
* @type number
* @min -255
* @max 255
* @desc 名稱。
*
* @param level
* @text 等級
* @type number
* @min -255
* @max 255
* @desc 等級。
*
* @param icons
* @text 圖標
* @type number
* @min -255
* @max 255
* @desc 圖標。
*
* @param hp
* @text HP
* @type number
* @min -255
* @max 255
* @desc HP
*
* @param mp
* @text MP
* @type number
* @min -255
* @max 255
* @desc MP
*
* @param tp
* @text TP
* @type number
* @min -255
* @max 255
* @desc TP
*
* @param exp
* @text 經驗值
* @type number
* @min -255
* @max 255
* @desc 經驗值
*/
/*~struct~WindowSkin:
*
* @param command
* @text 選單命令
* @type file
* @require 1
* @desc 命令窗口樣式。
* @dir img/tsumio
*
* @param status
* @text 狀態窗口
* @type file
* @require 1
* @desc 狀態窗口樣式。
* @dir img/tsumio
*
* @param chapter
* @text 章節窗口
* @type file
* @require 1
* @desc 章節窗口樣式。
* @dir img/tsumio
*
* @param tips
* @text 小技巧窗口
* @type file
* @require 1
* @desc 小技巧窗口樣式。
* @dir img/tsumio
*
* @param info
* @text 情報窗口
* @type file
* @require 1
* @desc 情報窗口樣式。
* @dir img/tsumio
*
*/
function Game_TMenuSys() {
this.initialize.apply(this, arguments);
}
(function() {
'use strict';
var pluginName = 'TsumioMenuSystem';
////=============================================================================
//// NTMO
//// Declare NTMO namespace.
////=============================================================================
var NTMO = NTMO || {};
NTMO.TMS = function(){
};
////=============================================================================
//// Local function
//// These functions checks & formats pluguin's command parameters.
//// I borrowed these functions from Triacontane.Thanks!
////=============================================================================
var getParamString = function(paramNames) {
if (!Array.isArray(paramNames)) paramNames = [paramNames];
for (var i = 0; i < paramNames.length; i++) {
var name = PluginManager.parameters(pluginName)[paramNames[i]];
if (name) return name;
}
return '';
};
var getParamNumber = function(paramNames, min, max) {
var value = getParamString(paramNames);
if (arguments.length < 2) min = -Infinity;
if (arguments.length < 3) max = Infinity;
return (parseInt(value) || 0).clamp(min, max);
};
//This function is not written by Triacontane.Tsumio wrote this function !
var convertParam = function(param) {
if(param !== undefined){
try {
return JSON.parse(param);
}catch(e){
console.group();
console.error('%cParameter is invalid ! You should check the following parameter !','background-color: #5174FF');
console.error('Parameter:' + eval(param));
console.error('Error message :' + e);
console.groupEnd();
}
}
};
/**
* Convert to number.Receive converted JSON object.
* @param {Object} obj
*
*/
//This function is not written by Triacontane.Tsumio wrote this function !
var convertToNumber = function(obj) {
for(var prop in obj) {
obj[prop] = Number(obj[prop]);
}
return obj;
}
var _DataManager_extractSaveContents = DataManager.extractSaveContents;
DataManager.extractSaveContents = function(contents) {
_DataManager_extractSaveContents.apply(this, arguments);
$gameSystem.onLoad();
};
////=============================================================================
//// Get and set pluguin parameters.
////=============================================================================
var param = {};
//Basic Stteings
param.menuRows = getParamNumber(['MenuRows', 'メニューの行数']);
param.menuMaxCols = getParamNumber(['MenuMaxCols', 'メニューの最大列数']);
param.shouldUseChapWin = getParamString(['ShowChapterWindow', '章ウィンドウを表示する']);
param.chapWinHeight = getParamNumber(['ChapterWindowHeight', '章ウィンドウの高さ']);
param.statusWinHeight = getParamNumber(['StatusWindowHeight', 'ステータスウィンドウの高さ']);
param.faceSize = getParamString(['FaceSize', '顔グラフィックのサイズ']);
param.subWinfontSize = getParamNumber(['SubWIndowsFontSize', 'サブウィンドウのフォントサイズ']);
param.statusMaxCols = getParamNumber(['StatusMaxCols', 'ステータスの最大列数']);
//Help Settings
param.shouldUseHelp = getParamString(['UseHelp', 'ヘルプを利用する']);
param.textHelp = getParamString(['HelpText', 'ヘルプ用テキスト']);
//Chars Settings
param.colorItemName = getParamNumber(['ItemNameColor', '項目名の色']);
param.colorContents = getParamNumber(['ItemContentsColor', '項目内容の色']);
param.charsLocation = getParamString(['LocationChars', '現在地を表す文字列']);
param.charsFortune = getParamString(['FortuneChars', '所持金を表す文字列']);
param.charsCombatNum = getParamString(['CombatNumberChars', '戦闘回数を表す文字列']);
param.charsPlayTime = getParamString(['PlayTimeChars', 'プレイ時間を表す文字列']);
param.option1 = getParamString(['Option1', 'オプション1']);
param.op1Contents = getParamString(['Option1Contents', 'オプション1の内容']);
param.option2 = getParamString(['Option2', 'オプション2']);
param.op2Contents = getParamString(['Option2Contents', 'オプション2の内容']);
//Background Settings
param.mainBackImg = getParamString(['MainBackgroundImage', 'メイン背景の画像']);
param.mainBackSet = getParamString(['MainBackgroundSettings', 'メイン背景の設定']);
param.subBackImg = getParamString(['SubBackgroundImage', 'サブ背景の画像']);
param.subBackSet = getParamString(['SubBackgroundSettings', 'サブ背景の設定']);
param.particleImg = getParamString(['ParticleImage', 'パーティクルの画像']);
param.particleSet = getParamString(['ParticleSettings', 'パーティクルの設定']);
param.particleFlash = getParamString(['ParticleFlashing', 'パーティクルの点滅']);
//Special Settings
param.ratio = getParamString(['Ratio', '比率']);
param.lineHeight = getParamString(['LineHeight', 'コンテンツの高さ']);
param.windowSkin = getParamString(['WindowSkin', 'ウィンドウスキン']);
param.infoUpdateFrame = getParamNumber(['UpdateInfoWindow', '情報ウィンドウの更新']);
////==============================
//// Convert parameters.
////==============================
param.ratio = convertParam(param.ratio);
param.textHelp = convertParam(param.textHelp);
param.faceSize = convertParam(param.faceSize);
param.shouldUseChapWin = convertParam(param.shouldUseChapWin);
param.lineHeight = convertParam(param.lineHeight);
param.windowSkin = convertParam(param.windowSkin);
param.mainBackSet = convertParam(param.mainBackSet);
param.subBackSet = convertParam(param.subBackSet);
param.particleSet = convertParam(param.particleSet);
param.particleFlash = convertParam(param.particleFlash);
////==============================
//// Convert to Number.
////==============================
param.faceSize = convertToNumber(param.faceSize);
param.lineHeight = convertToNumber(param.lineHeight);
param.mainBackSet = convertToNumber(param.mainBackSet);
param.subBackSet = convertToNumber(param.subBackSet);
param.particleSet = convertToNumber(param.particleSet);
//-----------------------------------------------------------------------------
// Settings for plugin command.
//-----------------------------------------------------------------------------
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function (command, args) {
_Game_Interpreter_pluginCommand.call(this, command, args);
if (command === 'TMS') {
switch (args[0]) {
case 'setChapterName':
$gameSystem.tMenuSys().setChapterName(args);
break;
case 'setTips1':
$gameSystem.tMenuSys().setTips1(args);
break;
case 'setTips2':
$gameSystem.tMenuSys().setTips2(args);
break;
}
}
};
////==============================
//// Add tsumio folder to ImageManager.
////==============================
ImageManager.loadTsumio = function(filename) {
return this.loadBitmap('img/tsumio/', filename, 0, true);
};
////==============================
//// Scene_Boot
/// Override this class for loading images.
////==============================
var _Scene_Boot_loadSystemWindowImage = Scene_Boot.prototype.loadSystemWindowImage;
Scene_Boot.prototype.loadSystemWindowImage = function() {
_Scene_Boot_loadSystemWindowImage.call(this);
//Addtional window images.
if(param.windowSkin.command){
ImageManager.loadTsumio(param.windowSkin.command);
}
if(param.windowSkin.status){
ImageManager.loadTsumio(param.windowSkin.status);
}
if(param.windowSkin.chapter){
ImageManager.loadTsumio(param.windowSkin.chapter);
}
if(param.windowSkin.tips){
ImageManager.loadTsumio(param.windowSkin.tips);
}
if(param.windowSkin.info){
ImageManager.loadTsumio(param.windowSkin.info);
}
};
//////=============================================================================
///// NTMO.TMS.Base
///// This is static class for getting various information.
/////=============================================================================
NTMO.TMS.Base = class {
static getActorState(actor) {
if(actor.isStateAffected(1)){//If actor is died.
return 'dead';
}else if (actor.hpRate() <= 25 / 100){//If actor HP is below 25%.
return 'dying';
}else{
return 'walk';
}
}
static isNumberMinus(num) {
if(num < 0){
return true;
}
return false;
}
static convertBackgroundWidth(num) {
if(this.isNumberMinus(num)){
return Graphics.width;
}else{
return num;
}
}
static convertBackgroundHeight(num) {
if(this.isNumberMinus(num)){
return Graphics.height;
}else{
return num;
}
}
};
//////=============================================================================
///// Game_System
///// Add a game system called Game_TMenuSys.
/////==============================================================================
var _Game_System_initialize = Game_System.prototype.initialize;
Game_System.prototype.initialize = function() {
_Game_System_initialize.call(this);
this._tMenuSys = new Game_TMenuSys();
};
Game_System.prototype.tMenuSys = function() {
return this._tMenuSys;
};
var _Game_System_onLoad = Game_System.prototype.onLoad;
Game_System.prototype.onLoad = function() {
if (_Game_System_onLoad) _Game_System_onLoad.apply(this, arguments);
if (!this.tMenuSys()) this._tMenuSys = new Game_TMenuSys();
this._tMenuSys.onLoad();
};
//////=============================================================================
///// Game_TMenuSys
///// This class manage TsumioMenuSystem's data.
/////=============================================================================
Game_TMenuSys.prototype = Object.create(Game_TMenuSys.prototype);
Game_TMenuSys.prototype.constructor = Game_TMenuSys;
Game_TMenuSys.prototype.initialize = function() {
this._chapterName = null;
this._tips1 = null;
this._tips2 = null;
};
Game_TMenuSys.prototype.onLoad = function() {
//When system is loaded, execute any function if necessary.
};
Game_TMenuSys.prototype.getChapterName = function() {
return this._chapterName;
};
Game_TMenuSys.prototype.setChapterName = function(name) {
this._chapterName = '';
name.forEach(function(element, index) {
if(index > 0){
this._chapterName += element + ' ';
}
}, this);
};
Game_TMenuSys.prototype.setTips1 = function(content) {
this._tips1 = '';
content.forEach(function(element, index) {
if(index > 0){
this._tips1 += element + ' ';
}
}, this);
};
Game_TMenuSys.prototype.getTips1 = function() {
return this._tips1;
};
Game_TMenuSys.prototype.setTips2 = function(content) {
this._tips2 = '';
content.forEach(function(element, index) {
if(index > 0){
this._tips2 += element + ' ';
}
}, this);
};
Game_TMenuSys.prototype.getTips2 = function() {
return this._tips2;
};
//////=============================================================================
///// Scene_Menu
///// Override this class for creating original menu.
/////=============================================================================
var _Scene_Menu_create = Scene_Menu.prototype.create;
Scene_Menu.prototype.create = function() {
//Call original create method.
_Scene_Menu_create.call(this);
//Create original windows.
this.createChapterWindow();
this.createTipsWindow();
this.createInfoWindow();
/*
Note : Create Particle.
Should be created with createBackground() or here.
I can not decide which is better.
*/
//this.createParticle();
//Hide unnecessary window.
this.hideUnnecessaryWindows();
//Reset and refresh windows position.
this.resetWindowsPosAndSize();
this.refreshWindow_TMS();
//Add eventListener.
this.addEventListenerToCommandWindow();
this.addEventListenerToStatusWindow();
};
var _Scene_Menu_update = Scene_Menu.prototype.update;
Scene_Menu.prototype.update = function() {
_Scene_Menu_update.call(this);
this.scrollBackImages.update();
this.particleImage.update();
};
var _Scene_Menu_createBackground = Scene_Menu.prototype.createBackground;
Scene_Menu.prototype.createBackground = function() {
_Scene_Menu_createBackground.call(this);
this.createScrollBackground();
this.createParticle();//Refer -> Note : Create Particle.
};
Scene_Menu.prototype.createScrollBackground = function() {
//Initialize background settings.
var main_x = param.mainBackSet.x;
var main_y = param.mainBackSet.y;
var main_width = NTMO.TMS.Base.convertBackgroundWidth(param.mainBackSet.width);
var main_height = NTMO.TMS.Base.convertBackgroundHeight(param.mainBackSet.height);
var sub_x = param.subBackSet.x;
var sub_y = param.subBackSet.y;
var sub_width = NTMO.TMS.Base.convertBackgroundWidth(param.subBackSet.width);
var sub_height = NTMO.TMS.Base.convertBackgroundHeight(param.subBackSet.height);
//Create scrolling background.You should 'move()' each image, if you want to draw a certain range.
this.scrollBackImages = new ScrollBackImages(this, param.mainBackImg, param.subBackImg);
this.scrollBackImages.setMainSpeed(param.mainBackSet.speedX, param.mainBackSet.speedY);
this.scrollBackImages.setSubSpeed(param.subBackSet.speedX, param.subBackSet.speedY);
this.scrollBackImages.moveMainSprite(main_x, main_y, main_width, main_height);
this.scrollBackImages.moveSubSprite(sub_x, sub_y, sub_width, sub_height);
};
Scene_Menu.prototype.createParticle = function() {
//Initialize particle settings.
var fileName = param.particleImg;
var opacity = param.particleSet.opacity;
var blendMode = param.particleSet.blendMode;
var flashing = param.particleFlash;
var x = param.particleSet.x;
var y = param.particleSet.y;
var width = NTMO.TMS.Base.convertBackgroundWidth(param.particleSet.width);
var height = NTMO.TMS.Base.convertBackgroundHeight(param.particleSet.height);
//Create particle.You should 'move()' each image, if you want to draw a certain range.
this.particleImage = new ParticleImage(this, fileName, opacity, blendMode, flashing);
this.particleImage.setSpeed(param.particleSet.speedX, param.particleSet.speedY);
this.particleImage.moveSprite(x, y, width, height);
};
var _Scene_Menu_createStatusWindow = Scene_Menu.prototype.createStatusWindow;
Scene_Menu.prototype.createStatusWindow = function() {
_Scene_Menu_createStatusWindow.call(this);
this._genSwapSVActors = this.genSkipFirstCalling(this._statusWindow.swapSVActors.bind(this._statusWindow));
};
Scene_Menu.prototype.createChapterWindow = function() {
//Initialize.
var x = 0;
var y = 0;
var width = Graphics.boxWidth;
var height = param.chapWinHeight;