-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathGabeMZ_MessagePlus.js
1644 lines (1536 loc) · 58 KB
/
GabeMZ_MessagePlus.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
//============================================================================
// Gabe MZ - Message Plus
//----------------------------------------------------------------------------
// 21/08/21 | Version: 1,1,1 | Some new Windowskin and Pop features
// 11/08/21 | Version: 1.1.0 | Various new features, fixes and improvements
// 27/09/20 | Version: 1.0.1 | Compatibility path with VisuMZ_1_MessageCore
// 26/09/20 | Version: 1.0.0 | Released
//----------------------------------------------------------------------------
// This software is released under the zlib License.
//============================================================================
/*:
* @target MZ
* @plugindesc [v1.1.1] Improved message system.
* @author Gabe (Gabriel Nascimento)
* @url http://patreon.com/gabriel_nfd
* @orderAfter VisuMZ_1_MessageCore
*
* @help Gabe MZ - Message Plus
* - This plugin is released under the zlib License.
*
* This plugin adds significant improvements to the default RPG Maker
* message system. Due to all the complexity of the plugin and for a
* better explanation of each command and function, the plugin's
* documentation was written directly in my page. You can read at:
* - https://comuns-rpgmaker.github.io/GabeMZ/Plugins/GMZ_MessagePlus
*
* For support and new plugins join our Discord server:
* https://discord.gg/GG85QRz
*
* @param defaultSettings
* @text Message Default Settings
* @default ===============================================
*
* @param defaultXPos
* @parent defaultSettings
* @text X Pos
* @desc Set the default X coordinate of the Message Window.
* @type text
* @default (Graphics.width - Graphics.boxWidth) / 2
*
* @param defaultYPos
* @parent defaultSettings
* @text Y Pos
* @desc Set the default Y coordinate of the Message Window.
* @type text
* @default Graphics.height - this.height
*
* @param defaultWidth
* @parent defaultSettings
* @text Window Width
* @desc Set the default width of the Message Window.
* @type text
* @default Graphics.boxWidth
*
* @param defaultHeight
* @parent defaultSettings
* @text Window Height
* @desc Set the default height of the Message Window.
* @type text
* @default this.fittingHeight(4)
*
* @param defaultPadding
* @parent defaultSettings
* @text Window Padding
* @desc Set the default padding of the Message Window.
* @type number
* @default 12
* @min 0
*
* @param defaultLineHeight
* @parent defaultSettings
* @text Window Line Height
* @desc Set the default line height of the Message Window.
* @type number
* @default 36
* @min 0
*
* @param defaultWindowskin
* @parent defaultSettings
* @text Windowskin
* @desc Set the default windowskin of the Message Window.
* @type file
* @dir img/system/
* @default Window
*
* @param pauseSignSettings
* @text Pause Sign Settings
* @default ===============================================
*
* @param defaultPauseSignXPos
* @parent pauseSignSettings
* @text X Pos
* @desc Set the default X coordinate of the Pause Sign.
* @type text
* @default this._width / 2
*
* @param defaultPauseSignYPos
* @parent pauseSignSettings
* @text Y Pos
* @desc Set the default Y coordinate of the Pause Sign.
* @type text
* @default this._height
*
* @param defaultPauseSignVisible
* @parent pauseSignSettings
* @text Visible
* @desc Set if the Pause Sign is visible by default.
* @type boolean
* @default true
*
* @param balloonModeSettings
* @text Balloon Mode Settings
* @default ===============================================
*
* @param popFilename
* @parent balloonModeSettings
* @text Balloon Pop Filename
* @desc Set the default Balloon Mode pop image filename.
* @type file
* @dir img/system/
* @default MessagePop
*
* @param popOffset
* @parent balloonModeSettings
* @text Balloon Pop Offset
* @desc Set the default Balloon Mode pop vertical offset.
* @type number
* @default 4
* @min -9999
*
* @param nameBoxDefaultSettings
* @text Name Box Default Settings
* @default ===============================================
*
* @param nameBoxDefaultX
* @parent nameBoxDefaultSettings
* @text X
* @desc Set the default X position of the name box window.
* @type text
* @default 0
*
* @param nameBoxDefaultY
* @parent nameBoxDefaultSettings
* @text Y
* @desc Set the default Y position of the name box window.
* @type text
* @default 0
*
* @param nameBoxDefaultPadding
* @parent nameBoxDefaultSettings
* @text Window Padding
* @desc Set the default padding of the name box window.
* @type number
* @default 12
* @min 0
*
* @param choiceListDefaultSettings
* @text Choice List Default Settings
* @default ===============================================
*
* @param choiceListDefaultXOffset
* @parent choiceListDefaultSettings
* @text X Offset
* @desc Set the default X offset of the choice list window.
* @type text
* @default 0
*
* @param choiceListDefaultYOffset
* @parent choiceListDefaultSettings
* @text Y Offset
* @desc Set the default Y offset of the choice list window.
* @type text
* @default 0
*
* @param choiceListDefaultPadding
* @parent choiceListDefaultSettings
* @text Window Padding
* @desc Set the default padding of the choice list window.
* @type number
* @default 12
* @min 0
*
* @param sfxSettings
* @text Message SFX Settings
* @default ===============================================
*
* @param sfxList
* @parent sfxSettings
* @text SFX List
* @desc Set a list of SFX settings to be used.
* @type struct<sfxListStruct>[]
* @default ["{\"filename\":\"Cursor1\",\"frequency\":\"2\",\"volume\":\"25\",\"pitch\":\"100\",\"pan\":\"0\"}","{\"filename\":\"Cursor2\",\"frequency\":\"2\",\"volume\":\"25\",\"pitch\":\"100\",\"pan\":\"0\"}"]
*
* @param defaultSFXId
* @parent sfxSettings
* @text Default SFX ID
* @desc Set the default SFX ID.
* @type number
* @min 1
* @default 1
*
* @param sfxCommandEnabled
* @parent sfxSettings
* @text Options Command Enabled
* @desc If true, show the message SFX command in the options menu.
* @type boolean
* @default true
*
* @param sfxCommandName
* @parent sfxSettings
* @text Options Command Name
* @desc Set the message SFX control command text
* @type text
* @default Message SFX
*
* @param otherSettings
* @text Other Settings
* @default ===============================================
*
* @param colorPicker
* @parent otherSettings
* @text Color Picker
* @desc Set real colors to be used by the \clr[id] command.
* @type text[]
* @default ["#0398fc","rgba(119, 209, 92, 255)","rgba(150, 40, 27, 1)","rgba(0, 0, 0, 100)",""]
*
* @command messageWindowSettingsEasy
* @text Window Settings (Easy)
* @desc Easy configuration mode, to set the parameters of the Message Window quickly and efficiently.
*
* @arg windowXPos
* @text Window Horizontal Pos
* @desc Changes the horizontal position of the Message Window.
* @type select
* @option Default
* @value Default
* @option Left
* @value Left
* @option Center
* @value Center
* @option Right
* @value Right
* @option Unchange
* @value Unchange
* @default Unchange
*
* @arg windowYPos
* @text Window Vertical Pos
* @desc Changes the vertical position of the Message Window.
* @type select
* @option Default
* @value Default
* @option Upper
* @value Upper
* @option Center
* @value Center
* @option Bottom
* @value Bottom
* @option Unchange
* @value Unchange
* @default Unchange
*
* @arg windowWidth
* @text Window Width
* @desc Changes the width of the Message Window.
* @type select
* @option Default
* @value Default
* @option Auto
* @value Auto
* @option Full
* @value Full
* @option Unchange
* @value Unchange
* @default Unchange
*
* @arg windowHeight
* @text Window Height
* @desc Changes the height of the Message Window.
* @type select
* @option Default
* @value Default
* @option Auto
* @value Auto
* @option Full
* @value Full
* @option Unchange
* @value Unchange
* @default Unchange
*
* @arg windowPadding
* @text Window Padding
* @desc Changes the padding of the Message Window.
* @type text
* @default Unchange
*
* @arg windowLineHeight
* @text Window Line Height
* @desc Changes the line height of the Message Window.
* @type text
* @default Unchange
*
* @arg windowskin
* @text Windowskin
* @desc Changes the windowskin of the Message Window.
* @type file
* @dir img/system/
* @default Unchange
*
* @command messageWindowSettingsAdvanced
* @text Window Settings (Advanced)
* @desc Advanced configuration mode, allows full control of the Message Window, but requires a certain level of knowledge.
*
* @arg windowXPos
* @text Window X Pos
* @desc Changes the X position of the Message Window.
* @type text
* @default Unchange
*
* @arg windowYPos
* @text Window Y Pos
* @desc Changes the Y position of the Message Window.
* @type text
* @default Unchange
*
* @arg windowWidth
* @text Window Width
* @desc Changes the width of the Message Window.
* @type text
* @default Unchange
*
* @arg windowHeight
* @text Window Height
* @desc Changes the height of the Message Window.
* @type text
* @default Unchange
*
* @arg windowPadding
* @text Window Padding
* @desc Changes the padding of the Message Window.
* @type text
* @default Unchange
*
* @arg windowLineHeight
* @text Window Line Height
* @desc Changes the line height of the Message Window.
* @type text
* @default Unchange
*
* @arg windowskin
* @text Windowskin
* @desc Changes the windowskin of the Message Window.
* @type file
* @dir img/system/
* @default Unchange
*
* @command pauseSignSettings
* @text Pause Sign Settings
* @desc Configure the Message Window Pause Sign settings.
*
* @arg pauseSignXPos
* @text Pause Sign X Pos
* @desc Changes the X position of the Pause Sign.
* @type text
* @default 0
*
* @arg pauseSignYPos
* @text Pause Sign Y Pos
* @desc Changes the Y position of the Pause Sign.
* @type text
* @default 0
*
* @arg pauseSignVisible
* @text Pause Sign Visibility
* @desc Changes the visibility of the Pause Sign.
* @type select
* @option Activate
* @value Activate
* @option Deactivate
* @value Deactivate
* @option Unchange
* @value Unchange
* @default Unchange
*
* @command nameBoxWindowSettings
* @text Name Box Settings
* @desc Configure the Name Box window settings.
*
* @arg nameBoxX
* @text Name Box X
* @desc Changes the X position of the Name Box window.
* @type text
* @default Unchange
*
* @arg nameBoxY
* @text Name Box Y
* @desc Changes the Y position of the Name Box window.
* @type text
* @default Unchange
*
* @arg nameBoxPadding
* @text Name Box Padding
* @desc Changes the padding of the Name Box window.
* @type text
* @default Unchange
*
* @command choiceListWindowSettings
* @text Choice List Settings
* @desc Configure the Choice List window settings.
*
* @arg choiceListXOffset
* @text Choice List X Offset
* @desc Changes the X offset of the Choice List window.
* @type number
* @default 0
* @min -9999
*
* @arg choiceListYOffset
* @text Choice List Y Offset
* @desc Changes the Y offset of the Choice List window.
* @type number
* @default 0
* @min -9999
*
* @arg choiceListPadding
* @text Choice List Padding
* @desc Changes the padding of the Choice List window.
* @type number
* @default 12
* @min 0
*
* @command messageWindowSettingsReset
* @text Reset Message Window Settings
* @desc Reset all Message Window settings to their default settings.
*
* @command pauseSignSettingsReset
* @text Reset Pause Sign Settings
* @desc Reset all Pause Sign settings to their default settings.
*
* @command nameBoxWindowSettingsReset
* @text Reset Name Box Window Settings
* @desc Reset all Name Box settings to their default settings.
*
* @command choiceListWindowSettingsReset
* @text Reset Choice List Window Settings
* @desc Reset all Choice List settings to their default settings.
*
* @command balloonModeSettings
* @text Balloon Mode Settings
* @desc Configure the Balloon Mode message settings.
*
* @arg balloonMode
* @text Balloon Mode
* @desc Activate or deactivate the Balloon Mode message.
* @type select
* @option Activate
* @value Activate
* @option Deactivate
* @value Deactivate
* @option Unchange
* @value Unchange
* @default Unchange
*
* @arg pop
* @text Balloon Pop
* @desc Activate or deactivate the balloon pop arrow visibility.
* @type select
* @option Activate
* @value Activate
* @option Deactivate
* @value Deactivate
* @option Unchange
* @value Unchange
* @default Unchange
*
* @arg popFilename
* @text Balloon Pop Filename
* @desc Set the default Balloon Mode pop image filename.
* @type file
* @dir img/system/
* @default Unchange
*
* @arg popOffset
* @text Balloon Pop Offset
* @desc Set the default Balloon Mode pop vertical offset.
* @type number
* @default Unchange
* @min -9999
*
* @command sfxSettings
* @text Message SFX Settings
* @desc Configure the message text SFX settings.
*
* @arg sfxId
* @text SFX ID
* @desc Set the current ID of the text SFX.
* @type number
* @min 1
* @default 1
*
* @arg sfxState
* @text SFX State
* @desc Set the current state of the text SFX.
* @type select
* @option Activate
* @value Activate
* @option Deactivate
* @value Deactivate
* @option Unchange
* @value Unchange
* @default Unchange
*
* @command inputShowFast
* @text Input Show Fast
* @desc Activate or deactivate the Input Show Fast.
*
* @arg state
* @text State
* @desc Activate or deactivate the Input Show Fast.
* @type boolean
* @default true
*
* @command customMessage
* @text Custom Message
* @desc Write a Custom Message.
*
* @arg message
* @text Message
* @desc Message
* @type note
*/
/*~struct~sfxListStruct:
* @param filename
* @text SE Filename
* @desc Set the SE filename.
* @type file
* @dir audio/se/
*
* @param frequency
* @text Frequency
* @desc Set the SE frequency.
* @type number
* @min 1
* @max 100
* @default 2
*
* @param volume
* @text Volume
* @desc Set the SE volume.
* @type number
* @min 0
* @max 100
* @default 25
*
* @param pitch
* @text Pitch
* @desc Set the SE pitch.
* @type number
* @min 50
* @max 150
* @default 100
*
* @param pan
* @text Pan
* @desc Set the SE pan.
* @type number
* @min -100
* @max 100
* @default 0
*/
var Imported = Imported || {};
Imported.GMZ_MessagePlus = true;
var GabeMZ = GabeMZ || {};
GabeMZ.MessagePlus = GabeMZ.MessagePlus || {};
GabeMZ.MessagePlus.VERSION = [1, 1, 1];
$gameMessagePlus = null;
(() => {
const pluginName = "GabeMZ_MessagePlus";
const params = PluginManager.parameters(pluginName);
// Setting the Message Window default params
GabeMZ.MessagePlus.defaultWidth = params.defaultWidth;
GabeMZ.MessagePlus.defaultHeight = params.defaultHeight;
GabeMZ.MessagePlus.defaultXPos = params.defaultXPos;
GabeMZ.MessagePlus.defaultYPos = params.defaultYPos;
GabeMZ.MessagePlus.defaultPadding = params.defaultPadding;
GabeMZ.MessagePlus.defaultLineHeight = params.defaultLineHeight;
GabeMZ.MessagePlus.defaultWindowskin = params.defaultWindowskin;
// Setting the name box default params
GabeMZ.MessagePlus.defaultNameBoxX = params.nameBoxDefaultX;
GabeMZ.MessagePlus.defaultNameBoxY = params.nameBoxDefaultY;
GabeMZ.MessagePlus.defaultNameBoxPadding = parseInt(params.nameBoxDefaultPadding);
// Setting the choice list default params
GabeMZ.MessagePlus.defaultChoiceListXOffset = parseInt(params.choiceListDefaultXOffset);
GabeMZ.MessagePlus.defaultChoiceListYOffset = parseInt(params.choiceListDefaultYOffset);
GabeMZ.MessagePlus.defaultChoiceListPadding = parseInt(params.choiceListDefaultPadding);
// Setting the message text SFX default params
GabeMZ.MessagePlus.sfxList = JSON.parse(params.sfxList);
GabeMZ.MessagePlus.defaultSfxSettings = JSON.parse(GabeMZ.MessagePlus.sfxList[parseInt(params.defaultSFXId) - 1]);
GabeMZ.MessagePlus.sfxCommandEnabled = params.sfxCommandEnabled == "true";
GabeMZ.MessagePlus.sfxCommandName = params.sfxCommandName;
// Setting the pause sign default params
GabeMZ.MessagePlus.defaultPauseSignXPos = params.defaultPauseSignXPos;
GabeMZ.MessagePlus.defaultPauseSignYPos = params.defaultPauseSignYPos;
GabeMZ.MessagePlus.defaultPauseSignVisible = JSON.parse(params.defaultPauseSignVisible);
// Setting the Balloon Mode params
GabeMZ.MessagePlus.popFilename = params.popFilename;
GabeMZ.MessagePlus.popOffset = params.popOffset;
// Settings other things
GabeMZ.MessagePlus.colorPicker = JSON.parse(params.colorPicker);
// Setting the current params with the default values
PluginManager.registerCommand(pluginName, "messageWindowSettingsEasy", args => {
GabeMZ.MessagePlus.messageWindowSetParams(args);
});
PluginManager.registerCommand(pluginName, "messageWindowSettingsAdvanced", args => {
GabeMZ.MessagePlus.messageWindowSetParams(args);
});
PluginManager.registerCommand(pluginName, "pauseSignSettings", args => {
$gameMessagePlus.pauseSignXPos = args.pauseSignXPos;
$gameMessagePlus.pauseSignYPos = args.pauseSignYPos;
$gameMessagePlus.pauseSignVisible = GabeMZ.MessagePlus.getParamState(
args.pauseSignVisible, "pauseSignVisible");
$gameMessagePlus.pauseSignUpdate = true;
});
PluginManager.registerCommand(pluginName, "nameBoxWindowSettings", args => {
$gameMessagePlus.nameBoxX = args.nameBoxX;
$gameMessagePlus.nameBoxY = args.nameBoxY;
$gameMessagePlus.nameBoxPadding = parseInt(GabeMZ.MessagePlus.getParamState(
args.nameBoxPadding, "nameBoxPadding"));
});
PluginManager.registerCommand(pluginName, "choiceListWindowSettings", args => {
$gameMessagePlus.choiceListXOffset = parseInt(args.choiceListXOffset);
$gameMessagePlus.choiceListYOffset = parseInt(args.choiceListYOffset);
$gameMessagePlus.choiceListPadding = parseInt(args.choiceListPadding);
});
PluginManager.registerCommand(pluginName, "messageWindowSettingsReset", args => {
GabeMZ.MessagePlus.messageWindowResetSettings()
});
PluginManager.registerCommand(pluginName, "pauseSignSettingsReset", args => {
$gameMessagePlus.pauseSignXPos = GabeMZ.MessagePlus.defaultPauseSignXPos;
$gameMessagePlus.pauseSignYPos = GabeMZ.MessagePlus.defaultPauseSignYPos;
$gameMessagePlus.pauseSignVisible = GabeMZ.MessagePlus.defaultPauseSignVisible;
$gameMessagePlus.pauseSignUpdate = true;
});
PluginManager.registerCommand(pluginName, "nameBoxWindowSettingsReset", args => {
$gameMessagePlus.nameBoxX = GabeMZ.MessagePlus.defaultNameBoxX;
$gameMessagePlus.nameBoxY = GabeMZ.MessagePlus.defaultNameBoxY;
$gameMessagePlus.nameBoxPadding = GabeMZ.MessagePlus.defaultNameBoxPadding;
});
PluginManager.registerCommand(pluginName, "choiceListWindowSettingsReset", args => {
$gameMessagePlus.choiceListXOffset = GabeMZ.MessagePlus.defaultChoiceListXOffset;
$gameMessagePlus.choiceListYOffset = GabeMZ.MessagePlus.defaultChoiceListYOffset;
$gameMessagePlus.choiceListPadding = GabeMZ.MessagePlus.defaultChoiceListPadding;
});
PluginManager.registerCommand(pluginName, "balloonModeSettings", args => {
$gameMessagePlus.balloonMode = GabeMZ.MessagePlus.getParamState(
args.balloonMode, "balloonMode");
$gameMessagePlus.pop = GabeMZ.MessagePlus.getParamState(
args.pop, "pop");
$gameMessagePlus.popFilename = GabeMZ.MessagePlus.getParamState(
args.popFilename, "popFilename");
$gameMessagePlus.popOffset = GabeMZ.MessagePlus.getParamState(
args.popOffset, "popOffset");
$gameMessagePlus.target = { target: $gamePlayer, type: 0 };
});
PluginManager.registerCommand(pluginName, "sfxSettings", args => {
$gameMessagePlus.sfxSettings = JSON.parse(GabeMZ.MessagePlus.sfxList[args.sfxId - 1])
$gameMessagePlus.sfxState = GabeMZ.MessagePlus.getParamState(
args.sfxState, "sfxState");
});
PluginManager.registerCommand(pluginName, "inputShowFast", args => {
$gameMessagePlus.inputShowFast = JSON.parse(args.state);
});
PluginManager.registerCommand(pluginName, "customMessage", args => {
$gameMessage.add(JSON.parse(args.message));
});
GabeMZ.MessagePlus.messageWindowSetParams = function(args) {
$gameMessagePlus.windowWidth = GabeMZ.MessagePlus.getParamState(
args.windowWidth, "windowWidth");
$gameMessagePlus.windowHeight = GabeMZ.MessagePlus.getParamState(
args.windowHeight, "windowHeight");
$gameMessagePlus.windowXPos = GabeMZ.MessagePlus.getParamState(
args.windowXPos, "windowXPos");
$gameMessagePlus.windowYPos = GabeMZ.MessagePlus.getParamState(
args.windowYPos, "windowYPos");
$gameMessagePlus.windowPadding = GabeMZ.MessagePlus.getParamState(
args.windowPadding, "windowPadding");
$gameMessagePlus.lineHeight = GabeMZ.MessagePlus.getParamState(
args.lineHeight, "lineHeight");
$gameMessagePlus.windowskin = GabeMZ.MessagePlus.getParamState(
args.windowskin, "windowskin");
GabeMZ.MessagePlus.disableBalloonMode();
};
GabeMZ.MessagePlus.messageWindowResetSettings = function() {
$gameMessagePlus.windowWidth = GabeMZ.MessagePlus.defaultWidth;
$gameMessagePlus.windowHeight = GabeMZ.MessagePlus.defaultHeight;
$gameMessagePlus.windowXPos = GabeMZ.MessagePlus.defaultXPos;
$gameMessagePlus.windowYPos = GabeMZ.MessagePlus.defaultYPos;
$gameMessagePlus.windowPadding = GabeMZ.MessagePlus.defaultPadding;
$gameMessagePlus.lineHeight = GabeMZ.MessagePlus.defaultLineHeight;
$gameMessagePlus.windowskin = GabeMZ.MessagePlus.defaultWindowskin;
$gameMessagePlus.sfxSettings = GabeMZ.MessagePlus.defaultSfxSettings;
GabeMZ.MessagePlus.disableBalloonMode();
};
GabeMZ.MessagePlus.messageWindowSaveTempSettings = function() {
$gameTemp.msgSettings = {};
$gameTemp.msgSettings.width = $gameMessagePlus.windowWidth;
$gameTemp.msgSettings.height = $gameMessagePlus.windowHeight;
$gameTemp.msgSettings.x = $gameMessagePlus.windowXPos;
$gameTemp.msgSettings.y = $gameMessagePlus.windowYPos;
$gameTemp.msgSettings.padding = $gameMessagePlus.windowPadding;
$gameTemp.msgSettings.lineHeight = $gameMessagePlus.lineHeight;
$gameTemp.msgSettings.windowskin = $gameMessagePlus.windowskin;
$gameTemp.msgSettings.sfxSettings = $gameMessagePlus.sfxSettings;
$gameTemp.msgSettings.balloonMode = $gameMessagePlus.balloonMode;
$gameTemp.msgSettings.target = $gameMessagePlus.target;
$gameTemp.msgSettings.pop = $gameMessagePlus.pop;
$gameTemp.msgSettings.popFilename = $gameMessagePlus.popFilename;
$gameTemp.msgSettings.popOffset = $gameMessagePlus.popOffset;
};
GabeMZ.MessagePlus.messageWindowLoadTempSettings = function() {
$gameMessagePlus.windowWidth = $gameTemp.msgSettings.width;
$gameMessagePlus.windowHeight = $gameTemp.msgSettings.height;
$gameMessagePlus.windowXPos = $gameTemp.msgSettings.x;
$gameMessagePlus.windowYPos = $gameTemp.msgSettings.y;
$gameMessagePlus.windowPadding = $gameTemp.msgSettings.padding;
$gameMessagePlus.lineHeight = $gameTemp.msgSettings.lineHeight;
$gameMessagePlus.windowskin = $gameTemp.msgSettings.windowskin;
$gameMessagePlus.sfxSettings = $gameTemp.msgSettings.sfxSettings;
$gameMessagePlus.balloonMode = $gameTemp.msgSettings.balloonMode;
$gameMessagePlus.target = $gameTemp.msgSettings.target;
$gameMessagePlus.pop = $gameTemp.msgSettings.pop;
$gameMessagePlus.popFilename = $gameTemp.msgSettings.popFilename;
$gameMessagePlus.popOffset = $gameTemp.msgSettings.popOffset;
};
GabeMZ.MessagePlus.disableBalloonMode = function() {
$gameMessagePlus.balloonMode = false;
$gameMessagePlus.target = null;
$gameMessagePlus.pop = false;
};
GabeMZ.MessagePlus.getParamState = function(param, oldState) {
if (!param) return $gameMessagePlus[oldState];
switch (param.toLowerCase()) {
case "activate":
return true;
case "deactivate":
return false;
case "unchange":
return $gameMessagePlus[oldState];
default:
return param;
}
};
//-----------------------------------------------------------------------------
// ColorManager
//
// The static class that handles the window colors.
ColorManager.realColor = function(id) {
if (GabeMZ.MessagePlus.colorPicker[id]) return GabeMZ.MessagePlus.colorPicker[id];
return "#ffffff";
};
//-----------------------------------------------------------------------------
// Game_Message
//
// The game object class for the state of the message window that displays text
// or selections, etc.
function Game_MessagePlus() {
this.initialize(...arguments);
}
Game_MessagePlus.prototype.initialize = function() {
this.windowWidth = GabeMZ.MessagePlus.defaultWidth;
this.windowHeight = GabeMZ.MessagePlus.defaultHeight;
this.windowXPos = GabeMZ.MessagePlus.defaultXPos;
this.windowYPos = GabeMZ.MessagePlus.defaultYPos;
this.windowPadding = GabeMZ.MessagePlus.defaultPadding;
this.lineHeight = GabeMZ.MessagePlus.defaultLineHeight;
this.windowskin = GabeMZ.MessagePlus.defaultWindowskin;
this.battleWindowWidth = this.windowWidth
this.battlewindowHeight = this.windowHeight
this.battlewindowXPos = this.windowXPos
this.battlewindowYPos = this.windowYPos
this.battlewindowPadding = this.windowPadding
this.nameBoxX = GabeMZ.MessagePlus.defaultNameBoxX;
this.nameBoxY = GabeMZ.MessagePlus.defaultNameBoxY;
this.nameBoxPadding = GabeMZ.MessagePlus.defaultNameBoxPadding;
this.choiceListXOffset = GabeMZ.MessagePlus.defaultChoiceListXOffset;
this.choiceListYOffset = GabeMZ.MessagePlus.defaultChoiceListYOffset;
this.choiceListPadding = GabeMZ.MessagePlus.defaultChoiceListPadding;
this.sfxSettings = GabeMZ.MessagePlus.defaultSfxSettings
this.pauseSignXPos = GabeMZ.MessagePlus.defaultPauseSignXPos;
this.pauseSignYPos = GabeMZ.MessagePlus.defaultPauseSignYPos;
this.pauseSignVisible = GabeMZ.MessagePlus.defaultPauseSignVisible;
this.pauseSignUpdate = false;
this.balloonMode = false;
this.currentEventId = 0;
this.target = null;
this.pop = false;
this.popFilename = GabeMZ.MessagePlus.popFilename;
this.popOffset = GabeMZ.MessagePlus.popOffset;
this.sfxState = true;
this.inputShowFast = true;
this.forceClose = false;
}
//-----------------------------------------------------------------------------
// Game_Interpreter
//
// The interpreter for running event commands.
// Show Text
const _Game_Interpreter_command101 = Game_Interpreter.prototype.command101;
Game_Interpreter.prototype.command101 = function(params) {
$gameMessagePlus.currentEventId = this.eventId();
return _Game_Interpreter_command101.call(this, params)
}
// Plugin Command
const _Game_Interpreter_command357 = Game_Interpreter.prototype.command357;
Game_Interpreter.prototype.command357 = function(params) {
if (params[1] == "customMessage") this.setWaitMode("message");
return _Game_Interpreter_command357.call(this, params);
};
//-----------------------------------------------------------------------------
// Window_Base
//
// The superclass of all windows within the game.
const _Window_Base_convertEscapeCharacters = Window_Base.prototype.convertEscapeCharacters;
Window_Base.prototype.convertEscapeCharacters = function(text) {
text = _Window_Base_convertEscapeCharacters.call(this, text)
// Return Item Name
text = text.replace(/\x1bITN\[(\d+)\]/gi, (_, p1) =>
this.itemName(parseInt(p1), 0)
);
// Return Skill Name
text = text.replace(/\x1bSKN\[(\d+)\]/gi, (_, p1) =>
this.itemName(parseInt(p1), 1)
);
// Return Weapon Name
text = text.replace(/\x1bWPN\[(\d+)\]/gi, (_, p1) =>
this.itemName(parseInt(p1), 2)
);
// Return Armor Name
text = text.replace(/\x1bARN\[(\d+)\]/gi, (_, p1) =>
this.itemName(parseInt(p1), 3)
);
// Return Item Quantity
text = text.replace(/\x1bITQ\[(\d+)\]/gi, (_, p1) =>
this.itemQuantity(parseInt(p1), 0)
);
// Return Weapon Quantity
text = text.replace(/\x1bWPQ\[(\d+)\]/gi, (_, p1) =>
this.itemQuantity(parseInt(p1), 2)
);
// Return Armor Quantity
text = text.replace(/\x1bARQ\[(\d+)\]/gi, (_, p1) =>
this.itemQuantity(parseInt(p1), 3)
);
return text;
}
Window_Base.prototype.itemName = function(id, type) {
const item = this.getItem(id, type);
return item ? item.name : "";
};
Window_Base.prototype.itemQuantity = function(id, type) {
const item = this.getItem(id, type);
return item ? $gameParty.numItems(item) : 0;
};
Window_Base.prototype.itemIconIndex = function(id, type) {
const item = this.getItem(id, type);
return item ? item.iconIndex : 0;
};
Window_Base.prototype.getItem = function(id, type) {
let item;
switch (type) {
case 0: // Item
item = id >= 1 ? $dataItems[id] : null;
break;
case 1: // Skill
item = id >= 1 ? $dataSkills[id] : null;
break;
case 2: // Weapon
item = id >= 1 ? $dataWeapons[id] : null;
break;
case 3: // Armor
item = id >= 1 ? $dataArmors[id] : null;
break;
}
return item;
}
const _Window_Base_processEscapeCharacter = Window_Base.prototype.processEscapeCharacter;
Window_Base.prototype.processEscapeCharacter = function(code, textState) {
let param;
switch (code) {
// Change Text Font
case "FNT":
param = this.obtainEscapeFullParam(textState);
this.contents.fontFace = param;
break;
// Change Text Bold State
case "B":
param = this.obtainEscapeParam(textState);
this.contents.fontBold = param;
break;
// Change Text Italic State
case "IT":
param = this.obtainEscapeParam(textState);
this.contents.fontItalic = param;
break;
// Change Text Color
case "CLR":
param = this.obtainEscapeParam(textState);
this.changeTextColor(ColorManager.realColor(param));
break;
// Change Text Outline Color
case "OLC":
param = this.obtainEscapeParam(textState);
this.changeOutlineColor(ColorManager.realColor(param));
break;
// Change Text Outline Width
case "OLW":
param = this.obtainEscapeParam(textState);
this.contents.outlineWidth = parseInt(param);
break;
// Change Message Face
case "FC":
param = this.obtainEscapeFullParam(textState);
param = param.replace(/[, ]+/g, " ").trim().split(" ");
this.redrawFace(param[0], param[1], textState)
break;
// Change Message Face (Actor ID)
case "ACTFC":
param = this.obtainEscapeParam(textState);
this.redrawFace($gameActors.actor(param).faceName(), $gameActors.actor(param).faceIndex(), textState);
break;
// Change Message Face (Party Member ID)
case "PRTFC":
param = this.obtainEscapeParam(textState) - 1;
this.redrawFace($gameParty.members()[param].faceName(), $gameParty.members()[param].faceIndex(), textState);
break;
// Display Item Icon by ID
case "ITI":
this.processDrawIcon(this.itemIconIndex(this.obtainEscapeParam(textState), 0), textState);
break;
// Display Skill Icon by ID
case "SKI":
this.processDrawIcon(this.itemIconIndex(this.obtainEscapeParam(textState), 1), textState);
break;
// Display Weapon Icon by ID
case "WPI":
this.processDrawIcon(this.itemIconIndex(this.obtainEscapeParam(textState), 2), textState);
break;
// Display Armor Icon by ID
case "ARI":
this.processDrawIcon(this.itemIconIndex(this.obtainEscapeParam(textState), 3), textState);