-
Notifications
You must be signed in to change notification settings - Fork 1
/
temenu.mod.gml
3038 lines (2615 loc) · 99.6 KB
/
temenu.mod.gml
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
#define init
mod_script_call("mod", "teassets", "ntte_init", script_ref_create(init));
// Store Script References:
scr.draw_text_bn = script_ref_create(draw_text_bn);
// Bind Events:
script_bind(CustomDraw, draw_menu, object_get_depth(Menu) - 1, true);
global.loadout_bind = ds_map_create();
global.loadout_bind[? "behind" ] = script_bind(CustomDraw, draw_loadout_behind, object_get_depth(Loadout) + 1, false);
global.loadout_bind[? "above" ] = script_bind(CustomDraw, draw_loadout_above, object_get_depth(Loadout) - 1, false);
global.loadout_bind[? "crown" ] = script_bind(CustomDraw, draw_loadout_crown, object_get_depth(LoadoutCrown) - 1, false);
global.loadout_bind[? "weapon" ] = script_bind(CustomDraw, draw_loadout_weapon, object_get_depth(LoadoutWep) - 1, false);
global.loadout_bind[? "tooltip"] = script_bind(CustomDraw, draw_loadout_tooltip, -100000, false);
// Menu Layout:
NTTEMenu = {
"open" : false,
"slct" : array_create(maxp, menu_base),
"pop" : array_create(maxp, 0),
"splat" : 0,
"splat_blink" : 0,
"splat_options" : 0,
"list" : {
"options" : {
"x" : 0,
"y" : -76,
"slct" : array_create(maxp, -1),
"list" : [
{ name : "Use Shaders",
type : opt_toggle,
text : "Used for certain visuals#@sShaders may cause the game# to @rcrash @son certain systems!",
save : "option:shaders",
sync : false
},
{ name : "Reminders",
type : opt_toggle,
text : "@sRemind you to enable#@wboss intros @s& @wmusic",
save : "option:reminders"
},
{ name : "Footprints",
type : opt_toggle,
text : "@wPlayers @sleave behind @wfootprints",
save : "option:footprints"
},
{ name : "NTTE Intros",
type : opt_toggle,
pick : ["OFF", "ON", "AUTO"],
text : "@sSet @wAUTO @sto obey the#@wboss intros @soption",
save : "option:intros"
},
{ name : "NTTE Outlines :",
type : opt_title,
text : "@sSet @wAUTO @sto#obey @w/outlines"
},
{ name : "Pets",
type : opt_toggle,
pick : ["OFF", "ON", "AUTO"],
save : "option:outline:pets",
sync : false
},
{ name : "Charm",
type : opt_toggle,
pick : ["OFF", "ON", "AUTO"],
save : "option:outline:charm",
sync : false
},
{ name : "Visual Quality :",
type : opt_title,
text : "@sReduce to improve#@wperformance"
},
{ name : "Main",
type : opt_slider,
text : "Obvious @svisuals",
save : "option:quality:main",
sync : false
},
{ name : "Minor",
type : opt_slider,
text : "@wLesser @svisuals",
save : "option:quality:minor",
sync : false
}
]
},
"stats" : {
"slct" : array_create(maxp, 0),
"list" : {
"mutants" : {
"x" : 56,
"y" : -48,
"slct" : array_create(maxp, 0),
"list" : {/*Filled in Later*/}
},
"pets" : {
"x" : 56,
"y" : -16,
"slct" : array_create(maxp, ""),
"list" : [ // Pets that show up by default
"Scorpion" + ".petlib.mod",
"Parrot" + ".petlib.mod",
"Slaughter" + ".petlib.mod",
"CoolGuy" + ".petlib.mod",
"Salamander" + ".petlib.mod",
"Mimic" + ".petlib.mod",
"Octo" + ".petlib.mod",
"Spider" + ".petlib.mod",
"Prism" + ".petlib.mod",
"Orchid" + ".petlib.mod",
"Weapon" + ".petlib.mod",
"Twins" + ".petlib.mod",
"Cuz" + ".petlib.mod",
"Guardian" + ".petlib.mod"
]
},
"unlocks" : {
"slct" : array_create(maxp, 0),
"list" : [
{ name : "UNLOCKS",
list : ["coast", "oasis", "trench", "lair", "red", "crown"]
},
{ name : "OTHER",
list : [
["Time", "time", stat_time],
["Bones", "bone", stat_base]
]
}
]
}
}
},
"credits" : {
"x" : 0,
"y" : -79,
"slct" : array_create(maxp, false),
"list" : [
{ name : "Yokin",
role : [[cred_coder, "Lead Programmer"]],
link : [[cred_twitter, "Yokinman"], [cred_discord, "Yokin\#1322"]]
},
{ name : "THX",
role : [[cred_artist, "Sprite Artist"]],
link : [[cred_twitter, "thxsprites"], [cred_discord, "THX\#0011"]]
},
{ name : "matt",
role : [[cred_artist, "Sprite Artist"], [cred_coder, "Programmer"]],
link : [[cred_twitter, "attfooy"], [cred_discord, "attfooy\#5026"]]
},
{ name : "peas",
role : [[cred_artist, "Sprite Artist"]],
link : [[cred_twitter, "realestpeas"], [cred_discord, "peas\#8304"]]
},
{ name : "jsburg",
role : [[cred_coder, "Programmer?"]],
link : [[cred_itchio, "jsburg"], [cred_discord, "Jsburg\#1045"]]
},
{ name : "karmelyth",
role : [[cred_artist, "Weapon Sprites"], [cred_coder, "Weapon Programming"]],
link : [[cred_twitter, "karmelyth"], [cred_discord, "Karmelyth\#7168"]]
},
{ name : "RENREN",
role : [[cred_music, "Music"]],
link : [[cred_twitter, "MistaJub"], [cred_bandcamp, "mistajub"], [cred_discord, "RENREN\#8521"]]
},
{ name : "Wildebee", // formerly BioOnPc
role : [[cred_music, "Sound Design"], [cred_coder, "Programmer"], "Trailers"],
link : [[cred_twitter, "Wilde_bee"], [cred_discord, "Wildebee\#6521"]]
},
{ name : "Special Thanks",
role : [[cred_yellow, "blaac"], "jordy", "Emffles", "minichibis"],
link : [[cred_twitter + cred_yellow, "blaac_"], [cred_twitter, "akimokawa"], [cred_twitter, "EmfflesTWO"], [cred_twitter, "minichibisart"]]
}
]
}
}
}
// Menu Defaulterize:
for(var i = 0; i < lq_size(MenuList); i++){
var o = lq_get_value(MenuList, i);
if("slct" in o && array_length(o.slct) > 0){
if("slct_default" not in o){
o.slct_default = o.slct[0];
}
}
}
with(MenuList.options.list){
if("name" not in self) name = "";
if("type" not in self) type = opt_title;
if("pick" not in self){
switch(type){
case opt_toggle : pick = ["OFF", "ON"]; break;
case opt_slider : pick = [0, 1]; break;
default : pick = []; break;
}
}
if("save" not in self) save = "";
if("sync" not in self) sync = true;
if("splat" not in self) splat = 0;
if("clicked" not in self) clicked = array_create(maxp, false);
}
with(MenuList.credits.list){
if("name" not in self) name = "";
if("role" not in self) role = [];
if("link" not in self) link = [];
// Role Defaulterize:
if(!is_array(role)) role = [role];
for(var i = 0; i < array_length(role); i++){
if(!is_array(role[i])) role[i] = [role[i]];
}
// Link Defaulterize:
if(!is_array(link)) link = [link];
for(var i = 0; i < array_length(link); i++){
if(!is_array(link[i])) link[i] = [link[i]];
}
if(array_length(link) >= 4){
with(link){
for(var i = 0; i < array_length(self); i++){
self[@i] = string_replace(self[i], "Twitter: ", "@@");
}
}
}
}
// Race Stats:
if(fork()){
while(mod_exists("mod", "teloader")){
wait 0;
}
with(ntte.mods.race){
var _race = self,
_path = "race:" + _race + ":",
_stat = [
{ name : "",
list : [
["Kills", _path + "kill", stat_base],
["Loops", _path + "loop", stat_base],
["Runs", _path + "runs", stat_base],
["Deaths", _path + "lost", stat_base],
["Wins", _path + "wins", stat_base],
["Time", _path + "time", stat_time]
]
},
{ name : "Best Run",
list : [
["Area", _path + "best:area", stat_area],
["Kills", _path + "best:kill", stat_base]
]
}
];
switch(_race){
case "parrot":
array_push(_stat[0].list, ["Charmed", _path + "spec", stat_base]);
break;
case "beetle":
array_push(_stat[0].list, ["Spent", _path + "spec", stat_base]);
break;
}
lq_set(MenuList.stats.list.mutants.list, _race, _stat);
}
exit;
}
// Loadout Crown System:
crownLoadout = {
compare : [],
race : {},
camp : crwn_none
};
global.clock_fix = false;
if(instance_exists(LoadoutCrown)){
with(loadbutton) instance_destroy();
with(Loadout) selected = false;
}
// Loadout Weapon System:
wepLoadout = [
{ name: "", inst: noone, hover: false, alarm: -1, addy: 0, overy: 0, dix: -0.00001, diy: 0 },
{ name: "main", inst: noone, hover: false, alarm: -1, addy: 0, overy: 0, dix: -1, diy: 0 }
];
// Mouse:
global.mouse_x_previous = array_create(maxp, 0);
global.mouse_y_previous = array_create(maxp, 0);
// Menu Command Helper:
chat_comp_add("ntte", "manually opens NT:TE's menu");
#define cleanup
mod_script_call("mod", "teassets", "ntte_cleanup", script_ref_create(cleanup));
// Remove Chat Command Helper:
chat_comp_remove("ntte");
// Fix Options:
if(MenuOpen){
with(Menu) mode = 0;
sound_volume(sndMenuCharSelect, 1);
}
// Reset Clock Parts:
if(global.clock_fix){
sprite_restore(sprClockParts);
}
// Destroy Inactive LoadoutWeps:
with(wepLoadout){
with(inst){
instance_destroy();
}
}
#macro NTTEMenu global.menu
#macro MenuOpen NTTEMenu.open
#macro MenuSlct NTTEMenu.slct
#macro MenuPop NTTEMenu.pop
#macro MenuList NTTEMenu.list
#macro MenuSplat NTTEMenu.splat
#macro MenuSplatBlink NTTEMenu.splat_blink
#macro MenuSplatOptions NTTEMenu.splat_options
#macro menu_options 0
#macro menu_stats 1
#macro menu_credits 2
#macro menu_base menu_options
#macro opt_title -1
#macro opt_toggle 0
#macro opt_slider 1
#macro stat_base 0
#macro stat_time 1
#macro stat_area 2
#macro stat_display 3
#macro cred_artist `@(color:${make_color_rgb(30, 160, 240)})`
#macro cred_coder `@(color:${make_color_rgb(250, 170, 0)})`
#macro cred_music `@(color:${make_color_rgb(255, 60, 0)})`
#macro cred_twitter cred_artist + "Twitter: @w"
#macro cred_itchio cred_coder + "Itch.io: @w"
#macro cred_bandcamp cred_music + "Bandcamp: @w"
#macro cred_discord `@(color:${make_color_rgb(160, 70, 200)})Discord: @w`
#macro cred_yellow "@y"
#macro loadoutPlayer (player_is_active(player_find_local_nonsync()) ? player_find_local_nonsync() : 0)
#macro crownLoadout global.loadout_crown
#macro crownCompare crownLoadout.compare
#macro crownRace crownLoadout.race
#macro crownCamp crownLoadout.camp
#macro crownIconW 28
#macro crownIconH 28
#macro crownPath "crownCompare/"
#macro crownPathD ""
#macro crownPathA "A"
#macro crownPathB "B"
#macro wepLoadout global.loadout_wep
#macro wepIconW 48
#macro wepIconH 48
#define chat_command(_cmd, _arg, _ind)
if(_cmd == "ntte" || _cmd == "NTTE"){
if(_cmd == "NTTE" || instance_exists(Menu) || instance_exists(BackMainMenu)){
NTTEMenu.open = !NTTEMenu.open;
// Paused:
if(instance_exists(BackMainMenu)){
// Clear Options:
if(NTTEMenu.open){
with([OptionMenuButton, AudioMenuButton, VisualsMenuButton, GameMenuButton, ControlMenuButton]){
with(self){
instance_destroy();
}
}
}
// Unpause:
else with(UberCont){
with(self){
event_perform(ev_alarm, 2);
}
}
}
}
return true;
}
#define game_start
// Reset Haste Hands:
if(global.clock_fix){
global.clock_fix = false;
sprite_restore(sprClockParts);
}
// Special Loadout Crown Selected:
var _p = loadoutPlayer,
_crown = lq_get(crownRace, player_get_race_fix(_p)),
_crownPoints = GameCont.crownpoints;
if(_crown != undefined){
if(_crown.custom.slct != -1 && crown_current == _crown.slct && _crown.custom.slct != _crown.slct){
switch(_crown.custom.slct){
case crwn_random:
// Get Unlocked Crowns:
var _listLocked = [],
_list = [];
with(_crown.icon) if(locked){
array_push(_listLocked, crwn);
}
for(var i = crwn_death; i <= crwn_protection; i++){
if(array_find_index(_listLocked, i) < 0) array_push(_list, i);
}
// Add Modded Crowns:
var _scrt = "crown_menu_avail";
with(mod_get_names("crown")){
if(!mod_script_exists("crown", self, _scrt) || mod_script_call_nc("crown", self, _scrt)){
array_push(_list, self);
}
}
// Pick Random Crown:
var _m = ((array_length(_list) > 0) ? _list[irandom(array_length(_list) - 1)] : crwn_none);
if(_m != crown_current){
crown_current = _m;
// Destiny Fix:
if(crown_current == crwn_destiny){
GameCont.skillpoints--;
}
}
break;
default:
crown_current = _crown.custom.slct;
}
// Death Fix:
if(_crown.slct == crwn_death){
with(Player) my_health = maxhealth;
}
}
}
GameCont.crownpoints = _crownPoints;
#define ntte_end_step
var _visible = false;
// NTTE Character Selection Stuff:
if(instance_exists(Menu)){
// Campfire Crown Boy:
var _inst = instances_matching(Menu, "ntte_campcrown_check", null);
if(array_length(_inst)) with(_inst){
ntte_campcrown_check = (crownCamp != crwn_none);
if(ntte_campcrown_check){
var _inst = instance_create(0, 0, Crown);
with(_inst){
alarm0 = -1;
with(self){
event_perform(ev_alarm, 0);
}
// Place by Last Played Character:
for(var i = 0; i < maxp; i++){
if(player_is_active(i)){
with(call(scr.array_combine,
instances_matching(CampChar, "num", player_get_race_id(i)),
instances_matching(CampChar, "race", player_get_race(i))
)){
other.x = x + (random_range(12, 24) * choose(-1, 1));
other.y = y + orandom(8);
}
break;
}
}
// Visual Setup:
var _crown = crownCamp;
if(is_string(_crown)){
mod_script_call("crown", _crown, "crown_object");
}
else if(is_real(_crown)){
spr_idle = asset_get_index(`sprCrown${_crown}Idle`);
spr_walk = asset_get_index(`sprCrown${_crown}Walk`);
}
depth = -2;
}
// Delete:
if(fork()){
wait 5;
with(instances_matching_ne(Crown, "id", _inst)){
instance_destroy();
}
exit;
}
}
}
// LoadoutSkin Offset:
if(instance_exists(LoadoutSkin)){
var _inst = instances_matching(LoadoutSkin, "ntte_crown_xoffset", null);
if(array_length(_inst)){
with(_inst){
ntte_crown_xoffset = -22;
xstart += ntte_crown_xoffset;
}
// Depth Sorting Fix:
var _instSort = [];
with(LoadoutSkin){
array_push(_instSort, [self, depth]);
}
array_sort_sub(_instSort, 1, true);
with(_instSort){
with(self[0]){
var _depth = depth;
depth--;
if(fork()){
wait 0;
if(instance_exists(self) && depth == _depth - 1){
depth = _depth;
}
exit;
}
}
}
}
}
// Custom Loadout Weapons:
if(instance_exists(LoadoutWep)){
// Create Inactive LoadoutWeps:
with(wepLoadout){
if(!instance_exists(inst)){
if(name == "" || call(scr.unlock_get, `loadout:wep:${player_get_race_fix(loadoutPlayer)}:${name}`) != wep_none){
inst = instance_create(0, 0, FloorMaker);
alarm = 2;
overy = 0;
addy = 2;
// Destroy FloorMaker Things:
with(instances_matching_gt(GameObject, "id", inst)){
instance_delete(self);
}
// Become LoadoutWep:
with(inst){
dix = other.dix;
instance_change(LoadoutWep, true);
other.alarm = alarm_get(0);
alarm_set(0, -1);
}
}
}
}
// Loadout Wep Selection:
with(wepLoadout){
hover = false;
with(other){
for(var i = 0; i < maxp; i++){
if(player_is_active(i) && position_meeting(mouse_x[i], mouse_y[i], other.inst)){
other.hover = true;
break;
}
}
}
}
for(var i = 0; i < maxp; i++){
if(player_is_active(i) && button_pressed(i, "fire")){
if(position_meeting(mouse_x[i], mouse_y[i], LoadoutWep)){
var _race = player_get_race_fix(i),
_slctPath = `loadout:wep:${_race}`,
_slctSnd = sndMenuGoldwep,
_slct = "";
with(wepLoadout) if(hover){
_slct = name;
if(_slct == ""){
switch(_race){
case "venuz" : _slctSnd = sndMenuGoldwep; break;
case "chicken" : _slctSnd = sndMenuSword; break;
default : _slctSnd = sndMenuRevolver; break;
}
}
break;
}
// Selected:
if(_slct != call(scr.save_get, _slctPath, "")){
call(scr.save_set, _slctPath, _slct);
sound_play(_slctSnd);
}
}
}
}
}
// Initialize Crown Selection:
var _mods = mod_get_names("race");
for(var i = 0; i < 17 + array_length(_mods); i++){
var _race = ((i < 17) ? race_get_name(i) : _mods[i - 17]);
if(_race not in crownRace){
lq_set(crownRace, _race, {
"icon" : [],
"slct" : crwn_none,
"custom" : { "icon" : [], "slct" : -1 }
});
}
}
// Loadout Drawing Visibility:
var _players = 0;
for(var i = 0; i < maxp; i++){
_players += player_is_active(i);
}
if(_players <= 1){
_visible = true;
}
}
// Remember Last Crown:
else crownCamp = crown_current;
// Loadout Drawing Visibility:
with(ds_map_values(global.loadout_bind)){
if(instance_exists(id)){
id.visible = _visible;
}
}
if(_visible && instance_exists(Loadout)){
with(global.loadout_bind[? "behind"].id) depth = Loadout.depth + 1;
with(global.loadout_bind[? "above" ].id) depth = Loadout.depth - 1;
}
#define draw_gui_end
// Save Previous Mouse Position:
for(var i = 0; i < maxp; i++){
global.mouse_x_previous[i] = mouse_x[i];
global.mouse_y_previous[i] = mouse_y[i];
}
#define draw_pause
// NTTE Options Button:
if(!MenuOpen){
if(instance_exists(OptionMenuButton)){
var _draw = true;
with(OptionMenuButton) if(alarm_get(0) > 0 || alarm_get(1) > 0){
_draw = false;
break;
}
if(_draw){
var _vx = view_xview_nonsync,
_vy = view_yview_nonsync,
_gw = game_width,
_gh = game_height,
_x = (_gw / 2),
_y = (_gh / 2) + 59,
_hover = false;
// Button Clicking:
for(var i = 0; i < maxp; i++){
if(point_in_rectangle(mouse_x[i] - view_xview[i], mouse_y[i] - view_yview[i], _x - 57, _y - 12, _x + 57, _y + 12)){
_hover = true;
if(button_pressed(i, "fire")){
MenuOpen = true;
with(OptionMenuButton) instance_destroy();
sound_play(sndClick);
break;
}
}
}
// Splat:
MenuSplatOptions += (_hover ? 1 : -1) * current_time_scale;
MenuSplatOptions = clamp(MenuSplatOptions, 0, sprite_get_number(sprMainMenuSplat) - 1);
draw_sprite(sprMainMenuSplat, MenuSplatOptions, _vx + (_gw / 2), _vy + _y);
// Gray Out Other Options:
if(MenuSplatOptions > 0){
var _spr = sprOptionsButtons;
for(var j = 0; j < sprite_get_number(_spr); j++){
var _dx = _vx + (_gw / 2),
_dy = _vy + (_gh / 2) - 36 + (j * 24);
draw_sprite_ext(_spr, j, _dx, _dy, 1, 1, 0, make_color_hsv(0, 0, 155), 1);
}
}
// Button:
draw_set_fog(true, c_black, 0, 0);
draw_sprite(spr.OptionNTTE, 0, _vx + _x + 1, _vy + _y);
draw_sprite(spr.OptionNTTE, 0, _vx + _x, _vy + _y + 1);
draw_sprite(spr.OptionNTTE, 0, _vx + _x + 1, _vy + _y + 1);
draw_set_fog(false, 0, 0, 0);
draw_sprite_ext(spr.OptionNTTE, 0, _vx + _x, _vy + _y, 1, 1, 0, (_hover ? c_white : make_color_hsv(0, 0, 155)), 1);
}
else MenuSplatOptions = 0;
}
}
else if(instance_exists(menubutton)){
MenuOpen = false;
}
// Main Code:
ntte_menu();
#define draw_menu
// Animate NTTE Splat:
var _add = 1;
if(mod_exists("mod", "teloader")){
if(mod_variable_exists("mod", "teloader", "load")){
if(mod_variable_get("mod", "teloader", "load").total > 0){
_add *= -1;
}
}
}
MenuSplat = clamp(MenuSplat + (_add * current_time_scale), 0, sprite_get_number(sprBossNameSplat) - 1);
// Campfire Menu Button:
if(instance_exists(Menu)){
if(Menu.mode == 1){
var _vx = view_xview_nonsync,
_vy = view_yview_nonsync,
_gw = game_width,
_gh = game_height;
if(MenuOpen){
// Hide Things:
with(Menu){
mode = 0;
alarm0 = -1;
charsplat = 1;
for(var i = 0; i < array_length(charx); i++){
charx[i] = 0;
}
sound_volume(sndMenuCharSelect, 0);
}
with(Loadout) instance_destroy();
with(loadbutton) instance_destroy();
with(menubutton) instance_destroy();
with(BackFromCharSelect) noinput = 10;
// Dim Screen:
draw_set_color(c_black);
draw_set_alpha(0.75);
draw_rectangle(_vx, _vy, _vx + _gw, _vy + _gh, 0);
draw_set_alpha(1);
// Leave:
for(var i = 0; i < maxp; i++){
with(BackFromCharSelect){
if(position_meeting((mouse_x[i] - (view_xview[i] + xstart)) + x, (mouse_y[i] - (view_yview[i] + ystart)) + y, self)){
if(button_pressed(i, "fire")){
MenuOpen = false;
break;
}
}
}
if(button_pressed(i, "spec") || button_pressed(i, "paus")){
MenuOpen = false;
break;
}
}
// Closed:
if(!MenuOpen){
MenuSplat = 1;
sound_play(sndClickBack);
// Reset Menu:
with(Menu) with(self){
mode = 0;
event_perform(ev_step, ev_step_end);
sound_volume(sndMenuCharSelect, 1);
sound_stop(sndMenuCharSelect);
with(CharSelect) alarm0 = 2;
}
with(Loadout) selected = 0;
// Tiny Partial Fix:
draw_loadout_behind();
}
}
// Open:
else if(MenuSplat > 0){
var _x = _gw - 40,
_y = 40,
_w = 40,
_h = 24;
// Co-op Offset:
var _max = 0;
for(var i = 0; i < array_length(Menu.charx); i++){
if(Menu.charx[i] != 0){
_max = i;
}
}
if(_max >= 2){
_x = (_gw / 2) - 20;
_y += 2;
}
// Player Clicky:
var _hover = false;
if(!instance_exists(Loadout) || !Loadout.selected){
for(var i = 0; i < maxp; i++){
if(point_in_rectangle(mouse_x[i] - view_xview[i], mouse_y[i] - view_yview[i], _x, _y - 8, _x + _w, _y + _h)){
_hover = true;
if(button_pressed(i, "fire")){
sound_play_pitch(sndMenuCredits, 1 + orandom(0.1));
MenuOpen = true;
MenuSplat = 1;
break;
}
}
}
}
// Button Visual:
draw_sprite_ext(sprBossNameSplat, MenuSplat, _vx + _x + 17, _vy + _y + 12 + MenuSplat, 1, 1, 90, c_white, 1);
if(!MenuOpen){
var _wave = (MenuSplatBlink % 300) - 60,
_col = ((_hover || (_wave >= 0 && _wave <= 5) || (_wave >= 8 && _wave <= 10)) ? c_white : c_silver);
draw_sprite_ext(spr.MenuNTTE, 0, _vx + _x + (_w / 2), _vy + _y + 8 + _hover, 1, 1, 0, _col, 1);
}
if(MenuSplatBlink >= 0){
MenuSplatBlink += current_time_scale;
if(_hover || !call(scr.option_get, "reminders")){
MenuSplatBlink = -1;
}
}
}
}
else MenuOpen = false;
}
// Main Code:
ntte_menu();
#define draw_loadout_crown
var _p = loadoutPlayer,
_race = player_get_race_fix(_p),
_crown = lq_get(crownRace, _race),
_vx = view_xview_nonsync,
_vy = view_yview_nonsync,
_gw = game_width,
_gh = game_height,
_w = 20,
_h = 20,
_cx = _gw - 102,
_cy = 75;
if(_crown != undefined && instance_exists(Loadout)){
if(array_length(instances_matching(Loadout, "selected", true)) > 0){
// Loadout Reset:
with(_crown.icon){
if("inst" not in self/*<- 9940 'with' scoping bug*/ || !instance_exists(inst)){
_crown.icon = [];
_crown.custom.icon = [];
break;
}
}
// Generate Comparison Files:
if(array_length(crownCompare) <= 0){
with(call(scr.surface_setup, "CrownCompare", _w, _h, 1)){
surface_set_target(surf);
var _x = w / 2,
_y = h / 2;
with(UberCont){
for(var i = 0; i <= 13; i++){
var a = crownPath + string(i) + crownPathA,
b = crownPath + string(i) + crownPathB;
// Selected:
draw_clear(c_black);
draw_sprite(sprLoadoutCrown, i, _x, _y - 2);
surface_save(other.surf, a);
// Locked:
draw_clear(c_black);
draw_sprite_ext(sprLockedLoadoutCrown, i, _x, _y, 1, 1, 0, c_gray, 1);
surface_save(other.surf, b);
// Store MD5 Hashes:
var _compare = { slct:"", lock:"" };
array_push(crownCompare, _compare);
file_load(a);
file_load(b);
if(fork()){
wait 0;
_compare.slct = file_md5(a);
_compare.lock = file_md5(b);
file_unload(a);
file_unload(b);
exit;
}
}
}
surface_reset_target();
}
}
// Normal Crown Icons:
if(array_length(_crown.icon) <= 0){
var _crownList = instances_matching(LoadoutCrown, "", null),
_crownCol = 2, // crwn_none column
_crownRow = -1; // crwn_none row
for(var i = array_length(_crownList) - 1; i >= 0; i--){
var n = ((array_length(_crownList) - 1) - i);
array_push(_crown.icon, {
inst : _crownList[i],
crwn : n + 1,
locked : false,
x : 0,
y : 0,
dix : _crownCol,
diy : _crownRow,
addy : 2,
visible : false
});
// Determine Position on Screen:
_crownCol++;
if((n % 4) == 0){
_crownCol = 0;
_crownRow++;
}
// Delay Crowns (Necessary for scanning the image without any overlapping):
with(_crownList[i]){
alarm_set(0, 4 - floor((n - 1) / 4));
}
}
// Another Hacky Fix:
if(fork()){
wait 2;
sprite_replace_base64(sprClockParts, "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==", 1);
global.clock_fix = true;
exit;
}
}
with(_crown.icon){
x = _vx + _cx + (dix * crownIconW);
y = _vy + _cy + (diy * crownIconH);
// Appear + Initial Crown Reading:
if(!visible){
with(inst) if(alarm_get(0) == 0){
with(other){
visible = true;
var _crwn = crwn,
_crwnX = x,
_crwnY = y + 2;
with(call(scr.surface_setup, "CrownCompareScreen", _gw, _gh, 1)){
x = _vx;
y = _vy;
// Capture Screen:
surface_set_target(surf);
draw_clear(c_black);
surface_reset_target();
draw_set_blend_mode_ext(bm_one, bm_inv_src_alpha);
surface_screenshot(surf);
draw_set_blend_mode(bm_normal);
// Capture Crown Icon:
with(call(scr.surface_setup, "CrownCompare", _w, _h, 1)){
x = (w / 2);