-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.lua
2141 lines (1827 loc) · 66 KB
/
menu.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
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
function menu_load()
loadconfig()
love.audio.stop()
editormode = false
gamestate = "menu"
for i, v in pairs(guielements) do
v.active = false
end
selection = 1
coinanimation = 1
love.graphics.setBackgroundColor(92, 148, 252)
scrollsmoothrate = 4
optionstab = 2
optionsselection = 1
skinningplayer = 1
rgbselection = 1
mappackselection = 1
onlinemappackselection = 1
mappackhorscroll = 0
mappackhorscrollsmooth = 0
colorsetedit = 1
love.graphics.setBackgroundColor(backgroundcolor[1])
controlstable = {"left", "right", "up", "down", "run", "jump", "reload", "use", "aimx", "aimy", "portal1", "portal2"}
portalanimation = 1
portalanimationtimer = 0
portalanimationdelay = 0.08
infmarioY = 0
infmarioR = 0
infmarioYspeed = 200
infmarioRspeed = 4
RGBchangespeed = 200
huechangespeed = 0.5
spriteset = 1
portalcolors = {}
for i = 1, players do
portalcolors[i] = {}
end
continueavailable = false
if love.filesystem.exists("suspend.txt") then
continueavailable = true
end
mariolevel = 1
marioworld = 1
mariosublevel = 0
--load 1-1 as background
loadbackgroundsafe("1-1.txt")
skipupdate = true
if (arcade or mkstation) and firstload then
firstload = false
if arcade then
mappack = "smb"
elseif mkstation then
-- mappack = "portal"
end
game_load()
end
end
function menu_update(dt)
--coinanimation
coinanimation = coinanimation + dt*6.75
while coinanimation > 6 do
coinanimation = coinanimation - 5
end
coinframe = math.floor(coinanimation)
--Animate animated tiles because I say so
for i = 1, #animatedtiles do
animatedtiles[i]:update(dt)
end
if mappackscroll then
--smooth the scroll
if mappackscrollsmooth > mappackscroll then
mappackscrollsmooth = mappackscrollsmooth - (mappackscrollsmooth-mappackscroll)*dt*5-0.1*dt
if mappackscrollsmooth < mappackscroll then
mappackscrollsmooth = mappackscroll
end
elseif mappackscrollsmooth < mappackscroll then
mappackscrollsmooth = mappackscrollsmooth - (mappackscrollsmooth-mappackscroll)*dt*5+0.1*dt
if mappackscrollsmooth > mappackscroll then
mappackscrollsmooth = mappackscroll
end
end
end
if onlinemappackscroll then
--smooth the scroll
if onlinemappackscrollsmooth > onlinemappackscroll then
onlinemappackscrollsmooth = onlinemappackscrollsmooth - (onlinemappackscrollsmooth-onlinemappackscroll)*dt*5-0.1*dt
if onlinemappackscrollsmooth < onlinemappackscroll then
onlinemappackscrollsmooth = onlinemappackscroll
end
elseif onlinemappackscrollsmooth < onlinemappackscroll then
onlinemappackscrollsmooth = onlinemappackscrollsmooth - (onlinemappackscrollsmooth-onlinemappackscroll)*dt*5+0.1*dt
if onlinemappackscrollsmooth > onlinemappackscroll then
onlinemappackscrollsmooth = onlinemappackscroll
end
end
end
if mappackhorscroll then
if mappackhorscrollsmooth > mappackhorscroll then
mappackhorscrollsmooth = mappackhorscrollsmooth - (mappackhorscrollsmooth-mappackhorscroll)*dt*5-0.03*dt
if mappackhorscrollsmooth < mappackhorscroll then
mappackhorscrollsmooth = mappackhorscroll
end
elseif mappackhorscrollsmooth < mappackhorscroll then
mappackhorscrollsmooth = mappackhorscrollsmooth - (mappackhorscrollsmooth-mappackhorscroll)*dt*5+0.03*dt
if mappackhorscrollsmooth > mappackhorscroll then
mappackhorscrollsmooth = mappackhorscroll
end
end
end
if gamestate == "options" and optionstab == 2 then
portalanimationtimer = portalanimationtimer + dt
while portalanimationtimer > portalanimationdelay do
portalanimation = portalanimation + 1
if portalanimation > 6 then
portalanimation = 1
end
portalanimationtimer = portalanimationtimer - portalanimationdelay
end
infmarioY = infmarioY + infmarioYspeed*dt
while infmarioY > 64 do
infmarioY = infmarioY - 64
end
infmarioR = infmarioR + infmarioRspeed*dt
while infmarioR > math.pi*2 do
infmarioR = infmarioR - math.pi*2
end
if characters[mariocharacter[skinningplayer]].colorables and optionsselection > 5 and optionsselection < 9 then
local colorRGB = optionsselection-5
if (love.keyboard.isDown("right") or love.keyboard.isDown("d")) and mariocolors[skinningplayer][colorsetedit][colorRGB] < 255 then
mariocolors[skinningplayer][colorsetedit][colorRGB] = mariocolors[skinningplayer][colorsetedit][colorRGB] + RGBchangespeed*dt
if mariocolors[skinningplayer][colorsetedit][colorRGB] > 255 then
mariocolors[skinningplayer][colorsetedit][colorRGB] = 255
end
elseif (love.keyboard.isDown("left") or love.keyboard.isDown("a")) and mariocolors[skinningplayer][colorsetedit][colorRGB] > 0 then
mariocolors[skinningplayer][colorsetedit][colorRGB] = mariocolors[skinningplayer][colorsetedit][colorRGB] - RGBchangespeed*dt
if mariocolors[skinningplayer][colorsetedit][colorRGB] < 0 then
mariocolors[skinningplayer][colorsetedit][colorRGB] = 0
end
end
elseif (characters[mariocharacter[skinningplayer]].colorables and optionsselection == 9) or (not characters[mariocharacter[skinningplayer]].colorables and optionsselection == 5) then
if (love.keyboard.isDown("right") or love.keyboard.isDown("d")) and portalhues[skinningplayer][1] < 1 then
portalhues[skinningplayer][1] = portalhues[skinningplayer][1] + huechangespeed*dt
if portalhues[skinningplayer][1] > 1 then
portalhues[skinningplayer][1] = 1
end
portalcolor[skinningplayer][1] = getrainbowcolor(portalhues[skinningplayer][1])
elseif (love.keyboard.isDown("left") or love.keyboard.isDown("a")) and portalhues[skinningplayer][1] > 0 then
portalhues[skinningplayer][1] = portalhues[skinningplayer][1] - huechangespeed*dt
if portalhues[skinningplayer][1] < 0 then
portalhues[skinningplayer][1] = 0
end
portalcolor[skinningplayer][1] = getrainbowcolor(portalhues[skinningplayer][1])
end
elseif (characters[mariocharacter[skinningplayer]].colorables and optionsselection == 10) or (not characters[mariocharacter[skinningplayer]].colorables and optionsselection == 6) then
if (love.keyboard.isDown("right") or love.keyboard.isDown("d")) and portalhues[skinningplayer][2] < 1 then
portalhues[skinningplayer][2] = portalhues[skinningplayer][2] + huechangespeed*dt
if portalhues[skinningplayer][2] > 1 then
portalhues[skinningplayer][2] = 1
end
portalcolor[skinningplayer][2] = getrainbowcolor(portalhues[skinningplayer][2])
elseif (love.keyboard.isDown("left") or love.keyboard.isDown("a")) and portalhues[skinningplayer][2] > 0 then
portalhues[skinningplayer][2] = portalhues[skinningplayer][2] - huechangespeed*dt
if portalhues[skinningplayer][2] < 0 then
portalhues[skinningplayer][2] = 0
end
portalcolor[skinningplayer][2] = getrainbowcolor(portalhues[skinningplayer][2])
end
end
elseif gamestate == "onlinemenu" then
onlinemenu_update(dt)
elseif gamestate == "lobby" then
lobby_update(dt)
end
end
function menu_draw()
--GUI LIBRARY?! Never heard of that.
--I'm not proud of this at all; But I'm even lazier than not proud. Seriously, don't take this as an example of what to do.
drawlevel()
drawui()
for j = 1, players do
local v = characters[mariocharacter[j]]
local angle = 3
if v.nopointing then
angle = 1
end
local pid = j
if pid > 4 then
pid = 5
end
local portalcolor1, portalcolor2 = portalcolor[j][1], portalcolor[j][2]
if players == 1 then
portalcolor1, portalcolor2 = {60, 188, 252}, {232, 130, 30}
end
drawplayer(nil, ((startx[pid]-xscroll)*16)+8*(j-1), ((starty[pid]-yscroll)*16-12), scale, v.smalloffsetX, v.smalloffsetY, 0, v.smallquadcenterX, v.smallquadcenterY, "idle", false, false, mariohats[j], v.animations, v.idle[angle], 0, false, false, mariocolors[j], 1, portalcolor1, portalcolor2, nil, nil, nil, nil, nil, nil, characters[mariocharacter[j]])
end
love.graphics.setColor(255, 255, 255, 255)
drawforeground()
if gamestate == "menu" then
love.graphics.draw(titleimage, 40*scale, 24*scale, 0, scale, scale)
if updatenotification then
love.graphics.setColor(255, 0, 0)
properprint("version outdated!|go to stabyourself.net|to download latest", 220*scale, 90*scale)
love.graphics.setColor(255, 255, 255, 255)
end
if selection == 0 then
love.graphics.draw(menuselection, 73*scale, (137+(selection-1)*16)*scale, 0, scale, scale)
elseif selection == 1 then
love.graphics.draw(menuselection, 73*scale, (137+(selection-1)*16)*scale, 0, scale, scale)
elseif selection == 2 then
love.graphics.draw(menuselection, 81*scale, (137+(selection-1)*16)*scale, 0, scale, scale)
elseif selection == 3 then
love.graphics.draw(menuselection, 73*scale, (137+(selection-1)*16)*scale, 0, scale, scale)
elseif selection == 4 then
love.graphics.draw(menuselection, 98*scale, (137+(selection-1)*16)*scale, 0, scale, scale)
end
if custombackground then
if continueavailable then
properprintbackground("continue game", 87*scale, 122*scale, true)
end
properprintbackground("player game", 103*scale, 138*scale, true)
properprintbackground("level editor", 95*scale, 154*scale, true)
properprintbackground("select mappack", 83*scale, 170*scale, true)
properprintbackground("options", 111*scale, 186*scale, true)
properprintbackground(players, 87*scale, 138*scale, true)
else
if continueavailable then
properprint("continue game", 87*scale, 122*scale)
end
properprint("player game", 103*scale, 138*scale)
properprint("level editor", 95*scale, 154*scale)
properprint("select mappack", 83*scale, 170*scale)
properprint("options", 111*scale, 186*scale)
properprint(players, 87*scale, 138*scale)
end
if players > 1 then
love.graphics.draw(playerselectimg, 82*scale, 138*scale, 0, scale, scale)
end
if players < 4 then
love.graphics.draw(playerselectimg, 102*scale, 138*scale, 0, -scale, scale)
end
if selectworldopen then
love.graphics.setColor(0, 0, 0)
love.graphics.rectangle("fill", 30*scale, 92*scale, 200*scale, 60*scale)
love.graphics.setColor(255, 255, 255)
drawrectangle(31, 93, 198, 58)
properprint("select world", 83*scale, 105*scale)
for i = 1, 8 do
if selectworldcursor == i then
love.graphics.setColor(255, 255, 255)
elseif reachedworlds[mappack][i] then
love.graphics.setColor(200, 200, 200)
elseif selectworldexists[i] then
love.graphics.setColor(50, 50, 50)
else
love.graphics.setColor(0, 0, 0)
end
properprint(i, (55+(i-1)*20)*scale, 130*scale)
if i == selectworldcursor then
properprint("v", (55+(i-1)*20)*scale, 120*scale)
end
end
end
elseif gamestate == "mappackmenu" then
--background
love.graphics.setColor(0, 0, 0, 100)
love.graphics.rectangle("fill", 21*scale, 16*scale, 218*scale, 200*scale)
love.graphics.setColor(255, 255, 255, 255)
--set scissor
love.graphics.setScissor(21*scale, 16*scale, 218*scale, 200*scale)
if loadingonlinemappacks then
love.graphics.setColor(0, 0, 0, 200)
love.graphics.rectangle("fill", 21*scale, 16*scale, 218*scale, 200*scale)
love.graphics.setColor(255, 255, 255, 255)
properprint("a little patience..|downloading " .. currentdownload .. " of " .. downloadcount, 50*scale, 30*scale)
drawrectangle(50, 55, 152, 10)
love.graphics.rectangle("fill", 50*scale, 55*scale, 152*((currentfiledownload-1)/(filecount-1))*scale, 10*scale)
else
love.graphics.translate(-round(mappackhorscrollsmooth*scale*mappackhorscrollrange), 0)
if mappackhorscrollsmooth < 1 then
--draw each butten (even if all you do, is press ONE. BUTTEN.)
--scrollbar offset
love.graphics.translate(0, -round(mappackscrollsmooth*60*scale))
love.graphics.setScissor(240*scale, 16*scale, 200*scale, 200*scale)
love.graphics.setColor(0, 0, 0, 200)
love.graphics.rectangle("fill", 240*scale, 81*scale, 115*scale, 61*scale)
love.graphics.setColor(255, 255, 255)
if not savefolderfailed then
properprint("press right to|access the dlc||press m to|open your|mappack folder", 241*scale, 83*scale)
else
properprint("press right to|access the dlc||could not|open your|mappack folder", 241*scale, 83*scale)
end
love.graphics.setScissor(21*scale, 16*scale, 218*scale, 200*scale)
for i = 1, #mappacklist do
--back
love.graphics.draw(mappackback, 25*scale, (20+(i-1)*60)*scale, 0, scale, scale)
--icon
if mappackicon[i] ~= nil then
local scale2w = scale*50 / math.max(1, mappackicon[i]:getWidth())
local scale2h = scale*50 / math.max(1, mappackicon[i]:getHeight())
love.graphics.draw(mappackicon[i], 29*scale, (24+(i-1)*60)*scale, 0, scale2w, scale2h)
else
love.graphics.draw(mappacknoicon, 29*scale, (24+(i-1)*60)*scale, 0, scale, scale)
end
love.graphics.draw(mappackoverlay, 29*scale, (24+(i-1)*60)*scale, 0, scale, scale)
--name
love.graphics.setColor(200, 200, 200)
if mappackselection == i then
love.graphics.setColor(255, 255, 255)
end
properprint(string.sub(mappackname[i]:lower(), 1, 17), 83*scale, (26+(i-1)*60)*scale)
--author
love.graphics.setColor(100, 100, 100)
if mappackselection == i then
love.graphics.setColor(100, 100, 100)
end
if mappackauthor[i] then
properprint(string.sub("by " .. mappackauthor[i]:lower(), 1, 16), 91*scale, (35+(i-1)*60)*scale)
end
--description
love.graphics.setColor(130, 130, 130)
if mappackselection == i then
love.graphics.setColor(180, 180, 180)
end
if mappackdescription[i] then
properprint( string.sub(mappackdescription[i]:lower(), 1, 17), 83*scale, (47+(i-1)*60)*scale)
if mappackdescription[i]:len() > 17 then
properprint( string.sub(mappackdescription[i]:lower(), 18, 34), 83*scale, (56+(i-1)*60)*scale)
end
if mappackdescription[i]:len() > 34 then
properprint( string.sub(mappackdescription[i]:lower(), 35, 51), 83*scale, (65+(i-1)*60)*scale)
end
end
love.graphics.setColor(255, 255, 255)
--highlight
if i == mappackselection then
love.graphics.draw(mappackhighlight, 25*scale, (20+(i-1)*60)*scale, 0, scale, scale)
end
end
love.graphics.translate(0, round(mappackscrollsmooth*60*scale))
local i = mappackscrollsmooth / (#mappacklist-3.233)
love.graphics.draw(mappackscrollbar, 227*scale, (20+i*160)*scale, 0, scale, scale)
end
love.graphics.translate(round(mappackhorscrollsmooth*scale*mappackhorscrollrange), 0)
----------
--ONLINE--
----------
love.graphics.translate(round(mappackhorscrollrange*scale - mappackhorscrollsmooth*scale*mappackhorscrollrange), 0)
if mappackhorscrollsmooth > 0 then
if #onlinemappacklist == 0 then
properprint("something went wrong|| sorry d:||maybe your internet|does not work right?", 40*scale, 80*scale)
end
love.graphics.setScissor()
love.graphics.setColor(0, 0, 0, 200)
love.graphics.rectangle("fill", 241*scale, 16*scale, 150*scale, 200*scale)
love.graphics.setColor(255, 255, 255, 255)
properprint("wanna contribute?|make a mappack and|send an email to|mappack at|stabyourself.net!||include your map-|pack! you can find|it in your appdata|love/mari0 dir.", 244*scale, 19*scale)
if outdated then
love.graphics.setColor(255, 0, 0, 255)
properprint("version outdated!|you have an old|version of mari0!|mappacks could not|be downloaded.|go to|stabyourself.net|to download latest", 244*scale, 130*scale)
love.graphics.setColor(255, 255, 255, 255)
elseif downloaderror then
love.graphics.setColor(255, 0, 0, 255)
properprint("download error!|something went|wrong while|downloading|mappacks.|press left and|right to try|again. sorry.", 244*scale, 130*scale)
love.graphics.setColor(255, 255, 255, 255)
end
love.graphics.setScissor(21*scale, 16*scale, 218*scale, 200*scale)
--scrollbar offset
love.graphics.translate(0, -round(onlinemappackscrollsmooth*60*scale))
for i = 1, #onlinemappacklist do
--back
love.graphics.draw(mappackback, 25*scale, (20+(i-1)*60)*scale, 0, scale, scale)
--icon
if onlinemappackicon[i] ~= nil then
love.graphics.draw(onlinemappackicon[i], 29*scale, (24+(i-1)*60)*scale, 0, scale, scale)
else
love.graphics.draw(mappacknoicon, 29*scale, (24+(i-1)*60)*scale, 0, scale, scale)
end
love.graphics.draw(mappackoverlay, 29*scale, (24+(i-1)*60)*scale, 0, scale, scale)
--name
love.graphics.setColor(200, 200, 200)
if onlinemappackselection == i then
love.graphics.setColor(255, 255, 255)
end
properprint(string.sub(onlinemappackname[i]:lower(), 1, 17), 83*scale, (26+(i-1)*60)*scale)
--author
love.graphics.setColor(100, 100, 100)
if onlinemappackselection == i then
love.graphics.setColor(100, 100, 100)
end
if onlinemappackauthor[i] then
properprint(string.sub("by " .. onlinemappackauthor[i]:lower(), 1, 16), 91*scale, (35+(i-1)*60)*scale)
end
--description
love.graphics.setColor(130, 130, 130)
if onlinemappackselection == i then
love.graphics.setColor(180, 180, 180)
end
if onlinemappackdescription[i] then
properprint( string.sub(onlinemappackdescription[i]:lower(), 1, 17), 83*scale, (47+(i-1)*60)*scale)
if onlinemappackdescription[i]:len() > 17 then
properprint( string.sub(onlinemappackdescription[i]:lower(), 18, 34), 83*scale, (56+(i-1)*60)*scale)
end
if onlinemappackdescription[i]:len() > 34 then
properprint( string.sub(onlinemappackdescription[i]:lower(), 35, 51), 83*scale, (65+(i-1)*60)*scale)
end
end
love.graphics.setColor(255, 255, 255)
--highlight
if i == onlinemappackselection then
love.graphics.draw(mappackhighlight, 25*scale, (20+(i-1)*60)*scale, 0, scale, scale)
end
end
love.graphics.translate(0, round(onlinemappackscrollsmooth*60*scale))
local i = onlinemappackscrollsmooth / (#onlinemappacklist-3.233)
love.graphics.draw(mappackscrollbar, 227*scale, (20+i*160)*scale, 0, scale, scale)
end
love.graphics.translate(- round(mappackhorscrollrange*scale - mappackhorscrollsmooth*scale*mappackhorscrollrange), 0)
end
love.graphics.setScissor()
if mappackhorscroll == 0 then
love.graphics.setColor(255, 255, 255)
love.graphics.rectangle("fill", 22*scale, 3*scale, 44*scale, 13*scale)
love.graphics.setColor(0, 0, 0)
properprint("local", 23*scale, 6*scale)
drawrectangle(22, 3, 44, 13)
love.graphics.setColor(0, 0, 0)
love.graphics.rectangle("fill", 70*scale, 3*scale, 29*scale, 13*scale)
love.graphics.setColor(255, 255, 255)
properprint("dlc", 72*scale, 6*scale)
else
love.graphics.setColor(0, 0, 0)
love.graphics.rectangle("fill", 22*scale, 3*scale, 44*scale, 13*scale)
love.graphics.setColor(255, 255, 255)
properprint("local", 23*scale, 6*scale)
love.graphics.setColor(255, 255, 255)
love.graphics.rectangle("fill", 70*scale, 3*scale, 29*scale, 13*scale)
love.graphics.setColor(0, 0, 0)
properprint("dlc", 72*scale, 6*scale)
drawrectangle(70, 3, 29, 13)
end
elseif gamestate == "options" then
love.graphics.setColor(0, 0, 0, 200)
love.graphics.rectangle("fill", 21*scale, 16*scale, 218*scale, 200*scale)
--Controls tab head
if optionstab == 1 then
love.graphics.setColor(100, 100, 100, 100)
love.graphics.rectangle("fill", 25*scale, 20*scale, 67*scale, 11*scale)
end
if optionstab == 1 and optionsselection == 1 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
properprint("controls", 26*scale, 22*scale)
--Skins tab head
if optionstab == 2 then
love.graphics.setColor(100, 100, 100, 100)
love.graphics.rectangle("fill", 96*scale, 20*scale, 43*scale, 11*scale)
end
if optionstab == 2 and optionsselection == 1 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
properprint("skins", 97*scale, 22*scale)
--Miscellaneous tab head
if optionstab == 3 then
love.graphics.setColor(100, 100, 100, 100)
love.graphics.rectangle("fill", 145*scale, 20*scale, 39*scale, 11*scale)
end
if optionstab == 3 and optionsselection == 1 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
properprint("misc.", 146*scale, 22*scale)
--Cheat tab head
if optionstab == 4 then
love.graphics.setColor(100, 100, 100, 100)
love.graphics.rectangle("fill", 190*scale, 20*scale, 43*scale, 11*scale)
end
if optionstab == 4 and optionsselection == 1 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
properprint("cheat", 191*scale, 22*scale)
love.graphics.setColor(255, 255, 255, 255)
if optionstab == 1 then
--CONTROLS
if optionsselection == 2 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
properprint("edit player:" .. skinningplayer, 74*scale, 40*scale)
if optionsselection == 3 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
if mouseowner == skinningplayer then
properprint("uses the mouse: yes", 46*scale, 52*scale)
else
properprint("uses the mouse: no", 46*scale, 52*scale)
end
for i = 1, #controlstable do
if mouseowner ~= skinningplayer or i <= 8 then
if optionsselection == 3+i then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
properprint(controlstable[i], 30*scale, (70+(i-1)*12)*scale)
local s = ""
if controls[skinningplayer][controlstable[i]] then
for j = 1, #controls[skinningplayer][controlstable[i]] do
s = s .. controls[skinningplayer][controlstable[i]][j]
end
end
if s == " " then
s = "space"
end
properprint(s, 120*scale, (70+(i-1)*12)*scale)
end
end
if keyprompt then
love.graphics.setColor(0, 0, 0, 255)
love.graphics.rectangle("fill", 30*scale, 100*scale, 200*scale, 60*scale)
love.graphics.setColor(255, 255, 255, 255)
drawrectangle(30, 100, 200, 60)
if controlstable[optionsselection-3] == "aimx" then
properprint("move stick right", 40*scale, 110*scale)
elseif controlstable[optionsselection-3] == "aimy" then
properprint("move stick down", 40*scale, 110*scale)
else
properprint("press key for \"" .. controlstable[optionsselection-3] .. "\"", 40*scale, 110*scale)
end
properprint("press \"esc\" to cancel", 40*scale, 140*scale)
if buttonerror then
love.graphics.setColor(200, 0, 0)
properprint("you can only set", 40*scale, 120*scale)
properprint("buttons for this", 40*scale, 130*scale)
elseif axiserror then
love.graphics.setColor(200, 0, 0)
properprint("you can only set", 40*scale, 120*scale)
properprint("axes for this", 40*scale, 130*scale)
end
end
elseif optionstab == 2 then
--SKINS
if optionsselection == 2 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
properprint("edit player:" .. skinningplayer, 74*scale, 32*scale)
--PREVIEW MARIO IN BIG. WITH BIG LETTERS
local v = characters[mariocharacter[skinningplayer]]
local angle = 3
if v.nopointing then
angle = 1
end
drawplayer(nil, 46, 32, scale*2, v.smalloffsetX, v.smalloffsetY, 0, v.smallquadcenterX, v.smallquadcenterY, "idle", false, false, mariohats[skinningplayer], v.animations, v.idle[angle], 0, false, false, mariocolors[skinningplayer], 1, portalcolor[skinningplayer][1], portalcolor[skinningplayer][2], nil, nil, nil, nil, nil, nil, characters[mariocharacter[skinningplayer]])
--PREVIEW PORTALS WITH FALLING MARIO BECAUSE I CAN AND IT LOOKS RAD
love.graphics.setScissor(142*scale, 42*scale, 32*scale, 32*scale)
for j = 1, 3 do
--158*scale, (2+((j-1)*32)+infmarioY)*scale
local v = characters[mariocharacter[skinningplayer]]
local angle = 3
if v.nopointing then
angle = 1
end
drawplayer(nil, 158, ((j-1)*32)+infmarioY+2, scale, v.smalloffsetX, v.smalloffsetY, infmarioR, v.smallquadcenterX, v.smallquadcenterY, "jumping", false, false, mariohats[skinningplayer], v.animations, v.jump[angle][1], 0, false, false, mariocolors[skinningplayer], 1, portalcolor[skinningplayer][1], portalcolor[skinningplayer][2], nil, nil, nil, 1, nil, nil, characters[mariocharacter[skinningplayer]])
end
local portalframe = portalanimation
love.graphics.setColor(255, 255, 255, 80 - math.abs(portalframe-3)*10)
love.graphics.draw(portalglowimg, 174*scale, 59*scale, math.pi, scale, scale)
love.graphics.draw(portalglowimg, 142*scale, 57*scale, 0, scale, scale)
love.graphics.setColor(unpack(portalcolor[skinningplayer][1]))
love.graphics.drawq(portalimg, portalquad[portalframe], 174*scale, 46*scale, math.pi, scale, scale)
love.graphics.setColor(unpack(portalcolor[skinningplayer][2]))
love.graphics.drawq(portalimg, portalquad[portalframe], 142*scale, 70*scale, 0, scale, scale)
love.graphics.setScissor()
--Character change
if optionsselection == 3 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
properprint("{", 65*scale, 54*scale)
properprint("}", 110*scale, 54*scale)
properprint(characters[mariocharacter[skinningplayer]].name, (118-#characters[mariocharacter[skinningplayer]].name*4)*scale, 80*scale)
--HAT
if optionsselection == 4 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
if mariohats[skinningplayer][1] == 0 then
properprint("hat: none", (83)*scale, 90*scale)
else
properprint("hat: " .. mariohats[skinningplayer][1], (99-string.len(mariohats[skinningplayer][1])*4)*scale, 90*scale)
end
if v.colorables then
if optionsselection == 5 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
--NEW SKIN CUSTOMIZATION
local v = characters[mariocharacter[skinningplayer]]
properprint("{ " .. v.colorables[colorsetedit] .. " }", 120*scale-string.len("{ " .. v.colorables[colorsetedit] .. " }")*4*scale, 105*scale)
if optionsselection > 5 and optionsselection < 9 then
love.graphics.setColor(255, 255, 255, 255)
love.graphics.rectangle("fill", 39*scale, 114*scale + (optionsselection-6)*10*scale, 142*scale, 10*scale)
end
love.graphics.setColor(100, 0, 0)
properprint("r", 40*scale, (116)*scale)
love.graphics.setColor(255, 0, 0)
properprint("r", 39*scale, (115)*scale)
love.graphics.setColor(0, 100, 0)
properprint("g", 40*scale, (126)*scale)
love.graphics.setColor(0, 255, 0)
properprint("g", 39*scale, (125)*scale)
love.graphics.setColor(0, 0, 100)
properprint("b", 40*scale, (136)*scale)
love.graphics.setColor(0, 0, 255)
properprint("b", 39*scale, (135)*scale)
love.graphics.setColor(100, 0, 0)
love.graphics.rectangle("fill", 51*scale, (116)*scale, math.floor(129*scale * (mariocolors[skinningplayer][colorsetedit][1]/255)), 7*scale)
love.graphics.setColor(255, 0, 0)
love.graphics.rectangle("fill", 50*scale, (115)*scale, math.floor(129*scale * (mariocolors[skinningplayer][colorsetedit][1]/255)), 7*scale)
love.graphics.setColor(100, 100, 100)
local s = math.floor(mariocolors[skinningplayer][colorsetedit][1])
properprint(s, 200*scale-string.len(s)*4*scale, 116*scale)
love.graphics.setColor(0, 100, 0)
love.graphics.rectangle("fill", 51*scale, (126)*scale, math.floor(129*scale * (mariocolors[skinningplayer][colorsetedit][2]/255)), 7*scale)
love.graphics.setColor(0, 255, 0)
love.graphics.rectangle("fill", 50*scale, (125)*scale, math.floor(129*scale * (mariocolors[skinningplayer][colorsetedit][2]/255)), 7*scale)
love.graphics.setColor(100, 100, 100)
local s = math.floor(mariocolors[skinningplayer][colorsetedit][2])
properprint(s, 200*scale-string.len(s)*4*scale, 126*scale)
love.graphics.setColor(0, 0, 100)
love.graphics.rectangle("fill", 51*scale, (136)*scale, math.floor(129*scale * (mariocolors[skinningplayer][colorsetedit][3]/255)), 7*scale)
love.graphics.setColor(0, 0, 255)
love.graphics.rectangle("fill", 50*scale, (135)*scale, math.floor(129*scale * (mariocolors[skinningplayer][colorsetedit][3]/255)), 7*scale)
love.graphics.setColor(100, 100, 100)
local s = math.floor(mariocolors[skinningplayer][colorsetedit][3])
properprint(s, 200*scale-string.len(s)*4*scale, 136*scale)
end
--Portalhuehues
--hue
local alpha = 100
if characters[mariocharacter[skinningplayer]].colorables then
if optionsselection == 9 then
alpha = 255
end
else
if optionsselection == 5 then
alpha = 255
end
end
love.graphics.setColor(255, 255, 255, alpha)
properprint("coop portal 1 color:", 31*scale, 150*scale)
love.graphics.draw(huebarimg, 32*scale, 170*scale, 0, scale, scale)
--marker
love.graphics.setColor(unpack(portalcolor[skinningplayer][1]))
love.graphics.rectangle("fill", math.floor(29 + (portalhues[skinningplayer][1])*178)*scale, 161*scale, 7*scale, 6*scale)
love.graphics.setColor(alpha, alpha, alpha)
love.graphics.draw(huebarmarkerimg, math.floor(28 + (portalhues[skinningplayer][1])*178)*scale, 160*scale, 0, scale, scale)
alpha = 100
if characters[mariocharacter[skinningplayer]].colorables then
if optionsselection == 10 then
alpha = 255
end
else
if optionsselection == 6 then
alpha = 255
end
end
love.graphics.setColor(255, 255, 255, alpha)
properprint("coop portal 2 color:", 31*scale, 180*scale)
love.graphics.draw(huebarimg, 32*scale, 200*scale, 0, scale, scale)
--marker
love.graphics.setColor(unpack(portalcolor[skinningplayer][2]))
love.graphics.rectangle("fill", math.floor(29 + (portalhues[skinningplayer][2])*178)*scale, 191*scale, 7*scale, 6*scale)
love.graphics.setColor(alpha, alpha, alpha)
love.graphics.draw(huebarmarkerimg, math.floor(28 + (portalhues[skinningplayer][2])*178)*scale, 190*scale, 0, scale, scale)
elseif optionstab == 3 then
if optionsselection == 2 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
properprint("size:", 30*scale, 40*scale)
if fullscreen then
if fullscreenmode == "touchfrominside" then
properprint("letterbox", (180-string.len("letterbox")*8)*scale, 40*scale)
else
properprint("fullscreen", (180-string.len("fullscreen")*8)*scale, 40*scale)
end
else
properprint("*" .. scale, (180-(string.len(scale)+1)*8)*scale, 40*scale)
end
if optionsselection == 3 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
properprint("shader1:", 30*scale, 55*scale)
if shaderssupported == false then
properprint("unsupported", (180-string.len("unsupported")*8)*scale, 55*scale)
else
properprint(string.lower(shaderlist[currentshaderi1]), (180-string.len(shaderlist[currentshaderi1])*8)*scale, 55*scale)
end
if optionsselection == 4 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
properprint("shader2:", 30*scale, 65*scale)
if shaderssupported == false then
properprint("unsupported", (180-string.len("unsupported")*8)*scale, 65*scale)
else
properprint(string.lower(shaderlist[currentshaderi2]), (180-string.len(shaderlist[currentshaderi2])*8)*scale, 65*scale)
end
love.graphics.setColor(100, 100, 100, 255)
properprint("shaders will really", 30*scale, 80*scale)
properprint("reduce performance!", 30*scale, 90*scale)
if optionsselection == 5 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
properprint("volume:", 30*scale, 105*scale)
drawrectangle(90, 108, 90, 1)
drawrectangle(90, 105, 1, 7)
drawrectangle(179, 105, 1, 7)
love.graphics.draw(volumesliderimg, math.floor((89+89*volume)*scale), 105*scale, 0, scale, scale)
if optionsselection == 6 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
properprint("reset game mappacks", 30*scale, 120*scale)
if optionsselection == 7 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
properprint("reset all settings", 30*scale, 135*scale)
if optionsselection == 8 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
properprint("vsync:", 30*scale, 150*scale)
if vsync then
properprint("on", (180-16)*scale, 150*scale)
else
properprint("off", (180-24)*scale, 150*scale)
end
love.graphics.setColor(100, 100, 100, 255)
properprint("you can lock the|mouse with f12", 30*scale, 165*scale)
love.graphics.setColor(255, 255, 255, 255)
properprint(versionstring, 134*scale, 207*scale)
elseif optionstab == 4 then
love.graphics.setColor(255, 255, 255, 255)
if not gamefinished then
properprint("unlock this by completing", 30*scale, 40*scale)
properprint("the original levels pack!", 30*scale, 50*scale)
else
properprint("have fun with these!", 30*scale, 45*scale)
end
if optionsselection == 2 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
properprint("mode:", 30*scale, 65*scale)
properprint("{" .. playertype .. "}", (180-(string.len(playertype)+2)*8)*scale, 65*scale)
if optionsselection == 3 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
properprint("knockback:", 30*scale, 80*scale)
if portalknockback then
properprint("on", (180-16)*scale, 80*scale)
else
properprint("off", (180-24)*scale, 80*scale)
end
if optionsselection == 4 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
properprint("bullettime:", 30*scale, 95*scale)
properprint("use mousewheel", 30*scale, 105*scale)
if bullettime then
properprint("on", (180-16)*scale, 95*scale)
else
properprint("off", (180-24)*scale, 95*scale)
end
if optionsselection == 5 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
properprint("huge mario:", 30*scale, 120*scale)
if bigmario then
properprint("on", (180-16)*scale, 120*scale)
else
properprint("off", (180-24)*scale, 120*scale)
end
if optionsselection == 6 then
love.graphics.setColor(255, 255, 255, 255)
else
love.graphics.setColor(100, 100, 100, 255)
end
properprint("goomba attack:", 30*scale, 135*scale)
if goombaattack then
properprint("on", (180-16)*scale, 135*scale)