forked from peon2/fbneo-training-mode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathguipages.lua
889 lines (855 loc) · 27.5 KB
/
guipages.lua
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
assert(rb,"Run fbneo-training-mode.lua")
guielements = { -- some shorthands/parts of interactiveguipages that can be moved in or out
leftarrow = {
text = "<<",
x = 0,
y = 0,
olcolour = "black",
func = function()
changeInteractiveGuiPage(interactivegui.page-1)
end,
info = "Moves back one page",
},
rightarrow = {
text = ">>",
x = interactivegui.boxx2 - interactivegui.boxx - 12,
y = 0,
olcolour = "black",
func = function()
changeInteractiveGuiPage(interactivegui.page+1)
end,
info = "Moves forward one page",
},
falseleftarrow = {
text = "<<",
x = 0,
y = 0,
olcolour = "black",
},
falserightarrow = {
text = ">>",
x = interactivegui.boxx2 - interactivegui.boxx - 12,
y = 0,
olcolour = "black",
},
p1health = {
text = "Health settings",
x = 40,
y = 25,
olcolour = "black",
info = "Controls how P1 health is handled",
func = function()
CIG("p1health", inputs.properties.scrollinginput.state) -- SHOULDNT BE LIKE THIS???
end,
autofunc = function(this)
if not combovars.p1.refillhealthenabled then
this.text = "No Health Refill"
this.x = 136-#this.text*4
elseif combovars.p1.refillhealthenabled and combovars.p1.instantrefillhealth then
this.text = "Health Always Full"
this.x = 136-#this.text*4
else
this.text = "Fill Health after Combo"
this.x = 136-#this.text*4
end
end,
},
p1healthmax = {
text = "Max Health",
x = 80,
y = 40,
fillpercent = 0,
olcolour = "black",
info = "Controls how much health P1 gains",
func = function()
CIG("p1maxhealth")
end,
autofunc = function(this)
this.text = "Max Health: "..modulevars.p1.maxhealth
this.x = 136-#this.text*4
this.fillpercent = modulevars.p1.maxhealth/modulevars.p1.constants.maxhealth
end,
},
p1meter = {
text = "Meter settings",
x = 40,
y = 55,
olcolour = "black",
info = "Controls how P1 meter is handled",
func = function()
CIG("p1meter", inputs.properties.scrollinginput.state)
end,
autofunc = function(this)
if not combovars.p1.refillmeterenabled then
this.text = "No Meter Refill"
this.x = 136-#this.text*4
elseif combovars.p1.refillmeterenabled and combovars.p1.instantrefillmeter then
this.text = "Meter Always Full"
this.x = 136-#this.text*4
else
this.text = "Fill Meter after Combo"
this.x = 136-#this.text*4
end
end,
},
p1metermax = {
text = "Max Meter",
x = 80,
y = 70,
fillpercent = 0,
olcolour = "black",
info = "Controls how much meter P1 gains",
func = function()
CIG("p1maxmeter")
end,
autofunc = function(this)
this.text = "Max Meter: "..modulevars.p1.maxmeter
this.x = 136-#this.text*4
this.fillpercent = modulevars.p1.maxmeter/modulevars.p1.constants.maxmeter
end,
},
p2health = {
text = "Health settings",
x = 40,
y = 105,
olcolour = "black",
info = "Controls how P2 health is handled",
func = function()
CIG("p2health", inputs.properties.scrollinginput.state)
end,
autofunc = function(this)
if not combovars.p2.refillhealthenabled then
this.text = "No Health Refill"
this.x = 136-#this.text*4
elseif combovars.p2.refillhealthenabled and combovars.p2.instantrefillhealth then
this.text = "Health Always Full"
this.x = 136-#this.text*4
else
this.text = "Fill Health after Combo"
this.x = 136-#this.text*4
end
end,
},
p2healthmax = {
text = "Max Health",
x = 80,
y = 120,
fillpercent = 0,
olcolour = "black",
info = "Controls how much health P2 gains",
func = function()
CIG("p2healthmax")
end,
autofunc = function(this)
this.text = "Max Health: "..modulevars.p2.maxhealth
this.x = 136-#this.text*4
this.fillpercent = modulevars.p2.maxhealth/modulevars.p2.constants.maxhealth
end,
},
p2meter = {
text = "Meter settings",
x = 40,
y = 135,
olcolour = "black",
info = "Controls how P2 meter is handled",
func = function()
CIG("p2meter", inputs.properties.scrollinginput.state)
end,
autofunc = function(this)
if not combovars.p2.refillmeterenabled then
this.text = "No Meter Refill"
this.x = 136-#this.text*4
elseif combovars.p2.refillmeterenabled and combovars.p2.instantrefillmeter then
this.text = "Meter Always Full"
this.x = 136-#this.text*4
else
this.text = "Fill Meter after Combo"
this.x = 136-#this.text*4
end
end,
},
p2metermax = {
text = "Max Meter",
x = 80,
y = 150,
fillpercent = 0,
olcolour = "black",
info = "Controls how much meter P2 gains",
func = function()
CIG("p2metermax")
end,
autofunc = function(this)
this.text = "Max Meter: "..modulevars.p2.maxmeter
this.x = 136-#this.text*4
this.fillpercent = modulevars.p2.maxmeter/modulevars.p2.constants.maxmeter
end,
},
scrollinginputsettings = {
text = "Change scrolling input settings",
x = 4,
y = 45,
olcolour = "black",
info = "Change scrolling input settings",
func = function() CIG("scrollingtextsettings", 2) end,
},
scrollinginputframestoggle = {
text = "Display scrolling input frame numbers",
x = 76,
y = 90,
info = "Toggles frame numbers displayed along with scrolling inputs",
olcolour = "black",
func = function()
inputs.properties.scrollinginput.frames = not inputs.properties.scrollinginput.frames
changeConfig("inputs", "framenumbersenabled", inputs.properties.scrollinginput.frames)
scrollingInputReload()
end,
autofunc = function(this)
if inputs.properties.scrollinginput.frames then
this.text = "Frame number display on"
this.x = 20
else
this.text = "Frame number display off"
this.x = 16
end
end,
},
replayautoturn = {
text = "Auto-Turn",
x = 29,
y = 105,
olcolour = "black",
info = "Allows you to control whether or not a replay will reverse directions while playing",
func = function()
recording.autoturn = not recording.autoturn
end,
autofunc = function(this)
if recording.autoturn then
this.text = "Auto-Turn"
this.x = 29
else
this.text = "Don't Auto-Turn"
this.x = 5
end
end,
},
hudsettings = {
text = "HUD Settings",
x = 80,
y = 15,
olcolour = "black",
info = "Move and hide parts of the HUD",
func = function()
toggleMoveHUD(true, {})
end,
},
coininputleniency = {
text = "Coin leniency",
x = 64,
y = 30,
fillpercent = 0,
olcolour = "black",
info = "This controls how many frames you have between each coin input.10 frames allows for faster usage but 15 might be easier.",
func = function()
CIG("coininputleniency", inputs.properties.coinleniency-9)
end,
autofunc = function(this)
this.text = "Coin leniency "..(inputs.properties.coinleniency)
this.fillpercent = (inputs.properties.coinleniency-10)/5
end,
},
hitplayback = {
main = {
text = "Select Hit Slot",
x = 5,
y = 120,
olcolour = "black",
info = "Plays back the respective replay slot after hit",
func = function()
if recording.hitslot then
CIG("hitslot", recording.hitslot)
else
CIG("hitslot", 6)
end
end,
autofunc = function(this)
if not recording.hitslot then
this.text = "Select Hit Slot"
this.x = 5
else
this.text = "Hit Slot "..recording.hitslot
this.x = 25
end
end,
},
},
replaysaveload = {
text = "Save/Load",
x = 29,
y = 135,
olcolour = "black",
info = "Save and Load replays (current slot)",
func = function() CIG("replaysaveload", 1) end,
},
replayeditortoggle = {
text = "Replay Editor",
x = 13,
y = 150,
olcolour = "black",
info = "View and set replay inputs",
func = function() toggleReplayEditor(nil, {}) end,
},
hitboxsettings = {
text = "Change hitbox settings",
x = 40,
y = 60,
olcolour = "black",
func = function() CIG("hitboxsettings", 2) end,
info = "Change hitbox settings",
},
hitboxstate = {
text = "Hitboxes On",
x = 76,
y = 50,
func = function()
changeConfig("hitbox", "enabled", not hitboxes.enabled, hitboxes)
end,
info = "Toggles hitboxes on and off",
autofunc = function(this)
if hitboxes.enabled then
this.text = "Hitboxes On"
this.x = 76
else
this.text = "Hitboxes Off"
this.x = 72
end
end
},
}
guipagesformatted = {}
guipages = { -- interactiveguipages
{ -- Main
title = {
text = "Basic Settings",
x = interactivegui.boxxlength/2 - 28,
y = 1,
},
guielements.leftarrow,
guielements.rightarrow,
guielements.hudsettings,
--guielements.hotkeys,
guielements.coininputleniency,
},
{ -- Players
title = {
text = "Player Settings",
x = interactivegui.boxxlength/2 - 30,
y = 1,
},
guielements.leftarrow,
guielements.rightarrow,
p1 = {
text = "P1",
x = 2,
y = 15,
},
p2 = {
text = "P2",
x = 2,
y = 95,
},
},
{ -- Dummy
title = {
text = "Dummy Settings",
x = interactivegui.boxxlength/2 - 30,
y = 1,
},
guielements.leftarrow,
guielements.rightarrow,
{
text = "Set the direction P2 is holding",
x = 12,
y = 70,
info = "Allows you to set the direction P2 is holding",
func = function() CIG("setdirectionp2", 1) end,
olcolour = "black",
autofunc = function(this)
local str = "P2 holding "
for i, v in pairs(inputs.properties.p2hold) do
if v then
str = str .. i .. " "
end
end
str = str:sub(1, #str-1)
if #str > 11 then
this.text = str -- 124
this.x = 12 + (31-#str)*4
else
this.text = "Set the direction P2 is holding"
this.x = 12
end
end,
},
},
{ -- Recording
guielements.leftarrow,
guielements.rightarrow,
title = {
text = "Recording Menu",
x = interactivegui.boxxlength/2 - 28,
y = 1,
},
{
text = "Don't Loop",
x = 25,
y = 30,
info = "Controls whether or not playback loops until you press play again",
olcolour = "black",
func = function()
recording.loop = not recording.loop
end,
autofunc = function(this)
if recording.loop then
this.text = "Loop"
this.x = 49
else
this.text = "Don't Loop"
this.x = 25
end
end,
},
{
text = "Slot ",
x = 41,
y = 45,
olcolour = "black",
func = function()
CIG("recordingslot", recording.recordingslot)
end,
autofunc = function(this) -- calls every frame this is visible
this.text = "Slot "..recording.recordingslot
end,
info = "Set the current recording slot",
},
{
text = "Don't Randomise",
x = 5,
y = 60,
info = "Random playback between all slots that have been recorded into",
olcolour = "black",
func = function()
recording.randomise = not recording.randomise
end,
autofunc = function(this)
if recording.randomise then
this.text = "Randomise"
this.x = 29
else
this.text = "Don't Randomise"
this.x = 5
end
end,
},
{
text = "Snipping Replays", -- clean this up in future
x = 5,
y = 75,
olcolour = "black",
info = "Controls whether there's a space at the start or end of replays",
func = function()
if recording.skiptostart and recording.skiptofinish then
changeConfig("recording","skiptostart", false, recording) -- turn both off
changeConfig("recording","skiptofinish", false, recording)
elseif not recording.skiptostart and not recording.skiptofinish then
changeConfig("recording","skiptostart", true, recording)-- turn skiptostart on
elseif recording.skiptostart and not recording.skiptofinish then
changeConfig("recording","skiptostart", false, recording)--turn skiptostart off and skiptofinish on
changeConfig("recording","skiptofinish", true, recording)
else
changeConfig("recording","skiptostart", true, recording) -- turn both on
changeConfig("recording","skiptofinish", true, recording)
end
end,
autofunc = function(this)
if recording.skiptostart and recording.skiptofinish then
this.text = "Skip start & end"
this.x = 1
elseif recording.skiptostart then
this.text = "Skip start"
this.x = 25
elseif recording.skiptofinish then
this.text = "Skip end"
this.x = 33
else
this.text = "Snipping Replays"
this.x = 1
end
end,
},
{
text = "Player Recording",
x = 5,
y = 90,
olcolour = "black",
info = "Controls which player(s) are recorded and played back",
func = function()
CIG("playerrecording", 2)
end,
autofunc = function(this)
if recording.replayP1 and recording.replayP2 then
this.text = "Replay P1 and P2"
elseif recording.replayP1 then
this.text = "Replay P1"
elseif recording.replayP2 then
this.text = "Replay P2"
end
this.x = 65 - #this.text*4
end,
},
other_func = drawReplayInfo
},
setdirectionp2 = {
left = guielements.falseleftarrow,
right = guielements.falserightarrow,
title = {
text = "Dummy Settings",
x = interactivegui.boxxlength/2 - 30,
y = 1,
},
button = {
text = "Set the direction P2 is holding",
x = 12,
y = 70,
},
{
text = "",
x = -200, -- should be 'invisible'
y = -200,
func = function()
local a = function(b) if b then return 1 end return 0 end -- bool to num
local dir = 5+a(guiinputs.P1["up"])*3 + a(guiinputs.P1["left"])*-1 + a(guiinputs.P1["right"])*1 + a(guiinputs.P1["down"])*-3
setDirection(2, dir)
CIG(interactivegui.previouspage, interactivegui.previousselection)
end,
autofunc = function() displayStick(interactivegui.boxx + 140, interactivegui.boxy + 55) end,
},
},
scrollingtextsettings = {
title = {
text = "Scrolling Input Settings",
x = interactivegui.boxxlength/2 - 48,
y = 1,
},
{
text = "<",
olcolour = "black",
info = "Back",
func = function() CIG(1,3) end,
},
{
text = "Scrolling input text size ",
x = 4,
y = 70,
info = "Sets the size of the scrolling input text images",
fillpercent = 0,
olcolour = "black",
func = function()
CIG("scrollingtextsettingssizepopup", inputs.properties.scrollinginput.iconsize-7)
end,
autofunc = function(this)
this.text = "Scrolling input text size "..(inputs.properties.scrollinginput.iconsize-7)
this.fillpercent = (inputs.properties.scrollinginput.iconsize-8)/12
end,
},
guielements.scrollinginputframestoggle,
},
hitboxsettings = {
title = {
text = "Hitbox Settings",
x = interactivegui.boxxlength/2 - 28,
y = 1,
},
{
text = "<",
olcolour = "black",
info = "Back",
func = function() CIG(1,3) end,
},
guielements.hitboxstate,
},
}
if scrollingInputReg then -- if scrolling-input-display.lua is loaded
table.insert(guipages[1], guielements.scrollinginputsettings)
end
if hitboxesReg then -- if a hitbox file is loaded
table.insert(guipages[1], guielements.hitboxsettings)
end
-- if health is set up in file
if availablefunctions.writeplayeronehealth and modulevars.p1.constants.maxhealth then -- if health is set up in file
table.insert(guipages[2], guielements.p1health)
table.insert(guipages[2], guielements.p1healthmax)
end
-- if meter is set up in file
if modulevars.p1.constants.maxmeter and availablefunctions.readplayeronemeter and availablefunctions.writeplayeronemeter then
table.insert(guipages[2], guielements.p1meter)
table.insert(guipages[2], guielements.p1metermax)
end
if availablefunctions.writeplayertwohealth and modulevars.p2.constants.maxhealth then -- if health is set up in file
table.insert(guipages[2], guielements.p2health)
table.insert(guipages[2], guielements.p2healthmax)
end
if modulevars.p2.constants.maxmeter and availablefunctions.readplayertwometer and availablefunctions.writeplayertwometer then
table.insert(guipages[2], guielements.p2meter)
table.insert(guipages[2], guielements.p2metermax)
end
if availablefunctions.playertwofacingleft then
table.insert(guipages[4], guielements.replayautoturn)
end
if availablefunctions.readplayertwohealth and availablefunctions.playertwoinhitstun then
table.insert(guipages[4], guielements.hitplayback.main)
end
if availablefunctions.tablesave and availablefunctions.tableload then
table.insert(guipages[4], guielements.replaysaveload)
end
if modulevars.constants.translationtable then -- replay editor
table.insert(guipages[4], guielements.replayeditortoggle)
end
if fexists("games/"..dirname.."/guipages.lua") then
dofile("games/"..dirname.."/guipages.lua")
table.insert(guipages, guicustompage)
end
-- pop up menus and stuff that can be pre-computed
if availablefunctions.writeplayeronehealth and modulevars.p1.constants.maxhealth then -- p1health
local Elements = {
{text = "No Health Refill", selectfunc = function() return function() changeConfig("p1", "refillhealthenabled", false, combovars.p1) end end},
{text = "Health Always Full", selectfunc = function() return
function()
changeConfig("p1", "refillhealthenabled", true, combovars.p1)
changeConfig("p1", "instantrefillhealth", true, combovars.p1)
end
end},
}
if availablefunctions.playeroneinhitstun then -- won't always be available
Elements[3] = {text = "Fill Health after Combo", selectfunc = function() return
function()
changeConfig("p1", "refillhealthenabled", true, combovars.p1)
changeConfig("p1", "instantrefillhealth", false, combovars.p1)
end
end}
end
guipages.p1health = createPopUpMenu(guipages[2], nil, nil, nil, Elements, 144, 25, nil)
end
if availablefunctions.writeplayeronehealth and modulevars.p1.constants.maxhealth then -- p1maxhealth
local uf = function(n)
if n then
modulevars.p1.maxhealth = modulevars.p1.maxhealth+n
end
return modulevars.p1.maxhealth
end
guipages.p1maxhealth = createScrollingBar(guipages[2], 145, 40, 1, modulevars.p1.constants.maxhealth, uf, interactivegui.boxxlength/2)
end
if modulevars.p1.constants.maxmeter and availablefunctions.readplayeronemeter and availablefunctions.writeplayeronemeter then -- p1meter
local Elements = {
{text = "No Meter Refill", selectfunc = function() return function() changeConfig("p1", "refillmeterenabled", false, combovars.p1) end end},
{text = "Meter Always Full", selectfunc = function() return
function()
changeConfig("p1", "refillmeterenabled", true, combovars.p1)
changeConfig("p1", "instantrefillmeter", true, combovars.p1)
end
end},
}
if availablefunctions.playertwoinhitstun then -- won't always be available
Elements[3] = {text = "Fill Meter after Combo", selectfunc = function() return
function()
changeConfig("p1", "refillmeterenabled", true, combovars.p1)
changeConfig("p1", "instantrefillmeter", false, combovars.p1)
end
end}
end
guipages.p1meter = createPopUpMenu(guipages[2], nil, nil, nil, Elements, 144, 55, nil)
end
if modulevars.p1.constants.maxmeter and availablefunctions.readplayeronemeter and availablefunctions.writeplayeronemeter then-- p1maxmeter
local uf = function(n)
if n then
modulevars.p1.maxmeter = modulevars.p1.maxmeter+n
end
return modulevars.p1.maxmeter
end
guipages.p1maxmeter = createScrollingBar(guipages[2], 144, 70, 0, modulevars.p1.constants.maxmeter, uf, interactivegui.boxxlength/2-4)
end
if availablefunctions.writeplayertwohealth and modulevars.p2.constants.maxhealth then-- p2health
local Elements = {
{text = "No Health Refill", selectfunc = function() return function() changeConfig("p2", "refillhealthenabled", false, combovars.p2) end end},
{text = "Health Always Full", selectfunc = function() return
function()
changeConfig("p2", "refillhealthenabled", true, combovars.p2)
changeConfig("p2", "instantrefillhealth", true, combovars.p2)
end
end},
}
if availablefunctions.playertwoinhitstun then -- won't always be available
Elements[3] = {text = "Fill Health after Combo", selectfunc = function() return
function()
changeConfig("p2", "refillhealthenabled", true, combovars.p2)
changeConfig("p2", "instantrefillhealth", false, combovars.p2)
end
end}
end
guipages.p2health = createPopUpMenu(guipages[2], nil, nil, nil, Elements, 144, 105, nil)
end
if availablefunctions.writeplayertwohealth and modulevars.p2.constants.maxhealth then-- p2healthmax
local uf = function(n)
if n then
modulevars.p2.maxhealth = modulevars.p2.maxhealth+n
end
return modulevars.p2.maxhealth
end
guipages.p2healthmax = createScrollingBar(guipages[2], 145, 120, 1, modulevars.p2.constants.maxhealth, uf, interactivegui.boxxlength/2)
end
if modulevars.p2.constants.maxmeter and availablefunctions.readplayertwometer and availablefunctions.writeplayertwometer then-- p2meter
local Elements = {
{text = "No Meter Refill", selectfunc = function() return function() changeConfig("p2", "refillmeterenabled", false, combovars.p2) end end},
{text = "Meter Always Full", selectfunc = function() return
function()
changeConfig("p2", "refillmeterenabled", true, combovars.p2)
changeConfig("p2", "instantrefillmeter", true, combovars.p2)
end
end},
}
if availablefunctions.playertwoinhitstun then -- won't always be available
Elements[3] = {text = "Fill Meter after Combo", selectfunc = function() return
function()
changeConfig("p2", "refillmeterenabled", true, combovars.p2)
changeConfig("p2", "instantrefillmeter", false, combovars.p2)
end
end}
end
guipages.p2meter = createPopUpMenu(guipages[2], nil, nil, nil, Elements, 144, 135, nil)
end
if modulevars.p2.constants.maxmeter and availablefunctions.readplayertwometer and availablefunctions.writeplayertwometer then-- p2metermax
local uf = function(n)
if n then
modulevars.p2.maxmeter = modulevars.p2.maxmeter+n
end
return modulevars.p2.maxmeter
end
guipages.p2metermax = createScrollingBar(guipages[2], 144, 150, 0, modulevars.p2.constants.maxmeter, uf, interactivegui.boxxlength/2)
end
do -- coininputleniency
local Elements = {
{text = "10"},
{text = "11"},
{text = "12"},
{text = "13"},
{text = "14"},
{text = "15"},
}
local sf = function(n) return function() changeConfig("inputs", "coinleniency", n+9, inputs.properties) end end
guipages.coininputleniency = createPopUpMenu(guipages[1], nil, sf, nil, Elements, 136, 30, nil)
end
if availablefunctions.readplayertwohealth and availablefunctions.playertwoinhitstun then -- hitslot
local Elements = {
{},
{},
{},
{},
{},
{y = 90, text = "None", releasefunc = function() return function() recording.hitslot = nil CIG(interactivegui.previouspage, interactivegui.previousselection) end end, autofunc = function() end}
}
local rf = function(n) return function() recording.hitslot = n CIG(interactivegui.previouspage, interactivegui.previousselection) end end
local af = function(n) return
function(this)
if recording[n][1] then -- if something is in the slot
this.textcolour = "yellow"
else
this.textcolour = "white"
end
end
end
guipages.hitslot = createPopUpMenu(guipages[4], rf, nil, af, Elements, 72, 100, nil)
end
do -- replaysaveload
local Elements = {
{text = "Save", releasefunc = function() return function() replaySave() CIG(interactivegui.previouspage, interactivegui.previousselection) end end},
{text = "Load", releasefunc = function() return function() replayLoad() CIG(interactivegui.previouspage, interactivegui.previousselection) end end},
}
guipages.replaysaveload = createPopUpMenu(guipages[4], nil, nil, nil, Elements, 72, 135)
end
do -- recordingslot
local rf = function(n) return function() recording.recordingslot = n CIG(interactivegui.previouspage, interactivegui.previousselection) end end
local af = function(n) return
function(this)
if recording[n][1] then -- if something is in the slot
this.textcolour = "yellow"
else
this.textcolour = "white"
end
end
end
guipages.recordingslot = createPopUpMenu(guipages[4], rf, nil, af, nil, 72, 25, 5)
end
if scrollingInputReg then -- scrollingtextsettingsinputpopup
local Elements = {
{text = "P1 inputs"},
{text = "P2 inputs"},
{text = "P1 & P2 inputs"},
{text = "Off"},
}
local rf = function(n) return function()
changeConfig("inputs","state",n,inputs.properties.scrollinginput)
scrollingInputReload()
CIG("scrollingtextsettings",2)
end
end
guipages.scrollingtextsettingsinputpopup = createPopUpMenu(guipages.scrollingtextsettings, rf, nil, nil, Elements, 120, 30, nil)
-- scrollingtextsettingssizepopup
local rf = function() return function() CIG("scrollingtextsettings", 2) end end
local sf = function(n) return function() changeConfig("inputs", "iconsize", n+7, inputs.properties.scrollinginput) scrollingInputReload() end end
guipages.scrollingtextsettingssizepopup = createPopUpMenu(guipages.scrollingtextsettings, rf, sf, nil, nil, 120, 10, 13)
end
local playerrecelements = {
{text = "P1", selectfunc = function() return function() recording.replayP1=true recording.replayP2=false end end},
{text = "P2", selectfunc = function() return function() recording.replayP1=false recording.replayP2=true end end},
{text = "P1&P2", selectfunc = function() return function() recording.replayP1=true recording.replayP2=true end end},
}
guipages.playerrecording = createPopUpMenu(guipages[4], nil, nil, nil, playerrecelements, 144, 55, nil)
--[[
guipagesformatted[1] = {guiTableFormatting}
guipagesformatted[2] = {guiTableFormatting}
guipagesformatted[hitboxsettings] = {guiTableFormatting}
.
.
.
--]]
-- format the tables for better navigation and format the info to fit the screen better
do
local tab, str, str2, r, b
local infomax = interactivegui.boxxlength/4
for i,v in pairs(guipages) do
tab = {}
for j,k in ipairs(v) do
local t = {id=j,x=k.x,y=k.y}
if not t.x then t.x=0 end -- failsafe
if not t.y then t.y=0 end
table.insert(tab, t)
if k.info and type(k.info)=="string" then -- if its not in a string format assume its already formatted
str = k.info
k.info = {}
while (#str>infomax) do
str2 = str:sub(1,infomax-1):reverse()
str = str:sub(infomax)
b = false
r=str2:find("\n")
if r then str = str2:reverse():sub(infomax-r+1) .. str table.insert(k.info,str2:reverse():sub(1,infomax-r-1)) b=true end
r=str2:find("%.")
if r and not b then str = str2:reverse():sub(infomax-r+1) .. str table.insert(k.info,str2:reverse():sub(1,infomax-r)) b=true end
r=str2:find(" ")
if r and not b then str = str2:reverse():sub(infomax-r+1) .. str table.insert(k.info,str2:reverse():sub(1,infomax-r-1)) b=true end
if not b then table.insert(k.info,str2:reverse()) end -- couldn't find a delimiter
end
table.insert(k.info,str)
end
end
guipagesformatted[i] = guiTableFormatting(tab)
end
end