Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/Menu/ExtrasMenu.txt
1831 views
1
//----------------Sonic CD Extras Menu Script-----------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
5
// Aliases
6
#alias Object.Value0 : Object.Timer
7
#alias Object.Value1 : Object.CurrentButton
8
9
//Object[+4] and [+ArrayPos0] are blank objects just to add values
10
#alias Object[+4].Value1 : Helper.VMCurrentButton
11
#alias Object.Value2 : Helper.FlickerState
12
13
//Object[33] is MenuHeading
14
#alias Object[33].State : MenuHeading.State
15
#alias Object[33].PropertyValue : MenuHeading.Header
16
17
//Object[-1] is MenuWindow
18
#alias Object[-1].State : MenuWindow.State
19
#alias Object[1].Value4 : MenuWindow.BackTouchPress
20
21
// States
22
#alias 0 : EXTRASMENU_ENTER_MENU
23
#alias 1 : EXTRASMENU_CONTROLS
24
#alias 2 : EXTRASMENU_SELECTED_OPTION
25
#alias 3 : EXTRASMENU_LOAD_EXTRA_STAGE
26
#alias 4 : EXTRASMENU_LOAD_VISUALMODE
27
#alias 5 : EXTRASMENU_VISUALMODE_FADEIN
28
#alias 6 : EXTRASMENU_VISUALMODE
29
#alias 7 : EXTRASMENU_VISUALMODE_SELECTED
30
#alias 8 : EXTRASMENU_VISUALMODE_VIDEOPLAY
31
#alias 9 : EXTRASMENU_VISUALMODE_FADEOUT
32
#alias 10 : EXTRASMENU_VISUALMODE_RETURN
33
#alias 11 : EXTRASMENU_EXIT_MENU
34
#alias 12 : EXTRASMENU_FADEIN
35
#alias 13 : EXTRASMENU_RETURN_TO_TITLE
36
37
// Menu Heading States
38
#alias 1 : MENUHEADING_LEAVE_SCREEN
39
40
// Menu Heading Property Values
41
#alias 5 : MAINMENU_HEADER
42
43
// Menu Window States
44
#alias 3 : MENUWINDOW_SHRINK
45
46
// Menu Button States
47
#alias 1 : MENUBUTTON_BUTTONS_IN
48
49
// Presentation Stages
50
#alias 0 : STAGE_P_TITLE
51
#alias 3 : STAGE_P_STAGESELECT
52
#alias 4 : STAGE_P_SOUNDTEST
53
#alias 5 : STAGE_P_DAGARDEN
54
55
// Global SFX
56
#alias 23 : SFX_G_MENUBUTTON
57
#alias 27 : SFX_G_SELECT
58
59
// Stage SFX
60
#alias 1 : SFX_S_BACKBUTTON
61
62
// Languages
63
#alias 0 : LANG_ENGLISH
64
#alias 1 : LANG_FRENCH
65
#alias 2 : LANG_ITALIAN
66
#alias 3 : LANG_DEUTSCH
67
#alias 4 : LANG_SPANISH
68
#alias 5 : LANG_JAPANESE
69
70
// Soundtrack
71
#alias 0 : OST_JP
72
73
//Engine & CallBacks
74
#alias 2 : MESSAGE_LOSTFOCUS
75
76
// Function declarations
77
#function ExtrasMenu_DrawUnlocks
78
79
80
function ExtrasMenu_DrawUnlocks
81
switch Helper[+ArrayPos0].FlickerState
82
case false
83
if ArrayPos0 == Object.CurrentButton
84
DrawSpriteScreenFX(9, FX_INK, Object.XPos, Object.YPos)
85
TempValue0 = ArrayPos0
86
TempValue0 += 14
87
DrawSpriteScreenFX(TempValue0, FX_INK, Object.XPos, Object.YPos)
88
else
89
TempValue0 = ArrayPos0
90
TempValue0 += 10
91
DrawSpriteScreenFX(TempValue0, FX_INK, Object.XPos, Object.YPos)
92
end if
93
break
94
95
case true
96
TempValue0 = Object.Timer
97
TempValue0 &= 3
98
TempValue0 >>= 1
99
DrawSpriteScreenFX(9, FX_INK, Object.XPos, Object.YPos)
100
if TempValue0 == 0
101
TempValue0 = ArrayPos0
102
TempValue0 += 14
103
DrawSpriteScreenFX(TempValue0, FX_INK, Object.XPos, Object.YPos)
104
end if
105
break
106
107
end switch
108
109
DrawSpriteScreenFX(8, FX_INK, Object.XPos, Object.YPos)
110
switch ArrayPos0
111
case 0
112
if Options.DAGardenFlag == true
113
DrawSpriteScreenFX(0, FX_INK, Object.XPos, Object.YPos)
114
else
115
DrawSpriteScreenFX(1, FX_INK, Object.XPos, Object.YPos)
116
end if
117
break
118
119
case 1
120
if Options.VisualModeFlag == true
121
DrawSpriteScreenFX(0, FX_INK, Object.XPos, Object.YPos)
122
else
123
DrawSpriteScreenFX(1, FX_INK, Object.XPos, Object.YPos)
124
end if
125
break
126
127
case 2
128
if Options.SoundTestFlag == true
129
DrawSpriteScreenFX(0, FX_INK, Object.XPos, Object.YPos)
130
else
131
DrawSpriteScreenFX(1, FX_INK, Object.XPos, Object.YPos)
132
end if
133
break
134
135
case 3
136
if Options.StageSelectFlag == true
137
DrawSpriteScreenFX(0, FX_INK, Object.XPos, Object.YPos)
138
else
139
DrawSpriteScreenFX(1, FX_INK, Object.XPos, Object.YPos)
140
end if
141
break
142
end switch
143
end function
144
145
146
sub ObjectMain
147
switch Object.State
148
case EXTRASMENU_ENTER_MENU
149
150
#platform: Use_Origins
151
if Options.PhysicalControls == false
152
Object.CurrentButton = -1
153
end if
154
#endplatform
155
156
#platform: Mobile
157
if Options.PhysicalControls == false
158
Object.CurrentButton = -1
159
end if
160
#endplatform
161
162
Object.XPos = Screen.CenterX
163
Object.XPos -= 126
164
if Object.Timer < 256
165
Object.Alpha = Object.Timer
166
Object.Timer += 6
167
else
168
Object.Timer = 0
169
Object.Alpha = 255
170
Object.State++
171
end if
172
break
173
174
case EXTRASMENU_CONTROLS
175
176
#platform: Standard
177
CheckResult = true
178
#endplatform
179
180
#platform: Mobile
181
CheckEqual(Options.PhysicalControls, true)
182
#endplatform
183
184
#platform: Use_Origins
185
CheckEqual(Options.PhysicalControls, true)
186
#endplatform
187
188
// 2011 Steam lacks Options.PhysicalControls, so we force it here first and the other platforms can override it
189
if CheckResult == true
190
if KeyPress[0].Up == true
191
Object.CurrentButton--
192
if Object.CurrentButton < 0
193
Object.CurrentButton = 3
194
end if
195
PlaySfx(SFX_G_MENUBUTTON, false)
196
end if
197
198
if KeyPress[0].Down == true
199
Object.CurrentButton++
200
if Object.CurrentButton > 3
201
Object.CurrentButton = 0
202
end if
203
PlaySfx(SFX_G_MENUBUTTON, false)
204
end if
205
206
CheckTouchRect(0, 0, Screen.XSize, Screen.YSize) //Touch Behaviour Check
207
if CheckResult > -1
208
#platform: Mobile
209
Options.PhysicalControls = false
210
Object.CurrentButton = -1
211
#endplatform
212
#platform: Use_Origins
213
Options.PhysicalControls = false
214
Object.CurrentButton = -1
215
#endplatform
216
end if
217
else
218
CheckTouchRect(0, 0, Screen.XSize, Screen.YSize) //Touch Press Reset
219
TempValue3 = CheckResult
220
221
TempValue0 = 0
222
CallFunction(LoadSaveMenu_CheckTouchSave) //D. A. Garden Touch Press
223
if CheckResult > -1
224
Object.CurrentButton = 0
225
else
226
if TempValue3 < 0
227
if Object.CurrentButton == 0
228
KeyPress[0].Start = true
229
end if
230
else
231
if Object.CurrentButton == 0
232
Object.CurrentButton = -1
233
end if
234
end if
235
end if
236
237
TempValue0 = 1
238
CallFunction(LoadSaveMenu_CheckTouchSave) //Visual Mode Touch Press
239
if CheckResult > -1
240
Object.CurrentButton = 1
241
else
242
if TempValue3 < 0
243
if Object.CurrentButton == 1
244
KeyPress[0].Start = true
245
end if
246
else
247
if Object.CurrentButton == 1
248
Object.CurrentButton = -1
249
end if
250
end if
251
end if
252
253
TempValue0 = 2
254
CallFunction(LoadSaveMenu_CheckTouchSave) //Sound Test Touch Press
255
if CheckResult > -1
256
Object.CurrentButton = 2
257
else
258
if TempValue3 < 0
259
if Object.CurrentButton == 2
260
KeyPress[0].Start = true
261
end if
262
else
263
if Object.CurrentButton == 2
264
Object.CurrentButton = -1
265
end if
266
end if
267
end if
268
269
TempValue0 = 3
270
CallFunction(LoadSaveMenu_CheckTouchSave) //Stage Select Touch Press
271
if CheckResult > -1
272
Object.CurrentButton = 3
273
else
274
if TempValue3 < 0
275
if Object.CurrentButton == 3
276
KeyPress[0].Start = true
277
end if
278
else
279
if Object.CurrentButton == 3
280
Object.CurrentButton = -1
281
end if
282
end if
283
end if
284
285
CallFunction(MenuHeading_CheckTouchBack) //Back Button Touch Press
286
if KeyPress[0].Up == true
287
Object.CurrentButton = 3
288
#platform: Mobile
289
Options.PhysicalControls = true
290
#endplatform
291
292
#platform: Use_Origins
293
Options.PhysicalControls = true
294
#endplatform
295
end if
296
297
if KeyPress[0].Down == true
298
Object.CurrentButton = 0
299
#platform: Mobile
300
Options.PhysicalControls = true
301
#endplatform
302
303
#platform: Use_Origins
304
Options.PhysicalControls = true
305
#endplatform
306
end if
307
end if
308
309
CheckResult = false
310
if Object.CurrentButton > -1
311
if KeyPress[0].Start == true
312
CheckResult = true
313
end if
314
315
if KeyPress[0].ButtonA == true
316
CheckResult = true
317
end if
318
end if
319
320
if CheckResult == true
321
if Object.CurrentButton < 4
322
switch Object.CurrentButton
323
case 0
324
if Options.DAGardenFlag == true
325
ArrayPos0 = Object.CurrentButton
326
Helper[+ArrayPos0].FlickerState = true
327
Object.State++
328
StopMusic()
329
PlaySfx(SFX_G_SELECT, false)
330
else
331
#platform: Use_Origins
332
if Options.PhysicalControls == false
333
Object.CurrentButton = -1
334
end if
335
#endplatform
336
337
#platform: Mobile
338
if Options.PhysicalControls == false
339
Object.CurrentButton = -1
340
end if
341
#endplatform
342
end if
343
break
344
345
case 1
346
if Options.VisualModeFlag == true
347
ArrayPos0 = Object.CurrentButton
348
Helper[+ArrayPos0].FlickerState = true
349
Object.State++
350
PlaySfx(SFX_G_SELECT, false)
351
else
352
#platform: Use_Origins
353
if Options.PhysicalControls == false
354
Object.CurrentButton = -1
355
end if
356
#endplatform
357
358
#platform: Mobile
359
if Options.PhysicalControls == false
360
Object.CurrentButton = -1
361
end if
362
#endplatform
363
end if
364
break
365
366
case 2
367
if Options.SoundTestFlag == true
368
ArrayPos0 = Object.CurrentButton
369
Helper[+ArrayPos0].FlickerState = true
370
Object.State++
371
StopMusic()
372
PlaySfx(SFX_G_SELECT, false)
373
else
374
#platform: Use_Origins
375
if Options.PhysicalControls == false
376
Object.CurrentButton = -1
377
end if
378
#endplatform
379
380
#platform: Mobile
381
if Options.PhysicalControls == false
382
Object.CurrentButton = -1
383
end if
384
#endplatform
385
end if
386
break
387
388
case 3
389
if Options.StageSelectFlag == true
390
ArrayPos0 = Object.CurrentButton
391
Helper[+ArrayPos0].FlickerState = true
392
Object.State++
393
StopMusic()
394
PlaySfx(SFX_G_SELECT, false)
395
else
396
#platform: Use_Origins
397
if Options.PhysicalControls == false
398
Object.CurrentButton = -1
399
end if
400
#endplatform
401
402
#platform: Mobile
403
if Options.PhysicalControls == false
404
Object.CurrentButton = -1
405
end if
406
#endplatform
407
end if
408
break
409
410
end switch
411
end if
412
end if
413
414
#platform: Use_Origins
415
if KeyPress[0].ButtonB == true
416
Object.State = EXTRASMENU_RETURN_TO_TITLE
417
Object.Timer = 0
418
StopMusic()
419
end if
420
#endplatform
421
422
#platform: Use_Standalone
423
if KeyPress[0].ButtonB == true
424
Object.Timer = 248
425
Object.State = EXTRASMENU_EXIT_MENU
426
PlayStageSfx(SFX_S_BACKBUTTON, false)
427
end if
428
#endplatform
429
break
430
431
case EXTRASMENU_SELECTED_OPTION
432
if Object.Timer < 30
433
Object.Timer++
434
else
435
Object.Timer = 0
436
ArrayPos0 = Object.CurrentButton
437
Helper[+ArrayPos0].FlickerState = false
438
switch Object.CurrentButton
439
case 0
440
Object.State = EXTRASMENU_LOAD_EXTRA_STAGE
441
break
442
443
case 1
444
Object.State = EXTRASMENU_LOAD_VISUALMODE
445
Object.YPos = 40
446
Object.YPos *= Object.CurrentButton
447
Object.YPos += Screen.CenterY
448
Object.YPos -= 87
449
break
450
451
case 2
452
Object.State = EXTRASMENU_LOAD_EXTRA_STAGE
453
break
454
455
case 3
456
Object.State = EXTRASMENU_LOAD_EXTRA_STAGE
457
break
458
459
end switch
460
end if
461
break
462
463
case EXTRASMENU_LOAD_EXTRA_STAGE
464
if Object.Timer < 320
465
Object.Timer += 8
466
else
467
468
#platform: Use_Origins
469
game.callbackParam0 = true
470
EngineCallback(NOTIFY_LEVEL_SELECT_MENU)
471
game.callbackParam0 = 0
472
EngineCallback(NOTIFY_PLAYER_SET)
473
Stage.PlayerListPos = PLAYER_SONIC
474
#endplatform
475
476
switch Object.CurrentButton
477
case 0
478
Stage.ListPos = STAGE_P_DAGARDEN
479
LoadStage()
480
break
481
482
case 2
483
Stage.ListPos = STAGE_P_SOUNDTEST
484
LoadStage()
485
break
486
487
case 3
488
Stage.ListPos = STAGE_P_STAGESELECT
489
LoadStage()
490
break
491
492
end switch
493
end if
494
495
TempValue0 = Object.Timer
496
if TempValue0 > 255
497
TempValue0 = 255
498
end if
499
SetScreenFade(0, 0, 0, TempValue0)
500
break
501
502
case EXTRASMENU_LOAD_VISUALMODE
503
TempValue0 = Screen.CenterY
504
TempValue0 -= 87
505
if Object.YPos > TempValue0
506
Object.YPos -= 8
507
if Object.YPos < TempValue0
508
Object.YPos = TempValue0
509
end if
510
else
511
Object.State++
512
Object.Alpha = 0
513
Helper.VMCurrentButton = 0
514
515
#platform: Mobile
516
if Options.PhysicalControls == false
517
Helper.VMCurrentButton = -1
518
end if
519
#endplatform
520
521
end if
522
break
523
524
case EXTRASMENU_VISUALMODE_FADEIN
525
if Object.Timer < 256
526
Object.Alpha = Object.Timer
527
Object.Timer += 8
528
else
529
Object.Timer = 0
530
Object.Alpha = 255
531
Object.State++
532
end if
533
break
534
535
case EXTRASMENU_VISUALMODE
536
ArrayPos0 = Object.CurrentButton
537
#platform: Standard
538
CheckResult = true
539
#endplatform
540
541
#platform: Mobile
542
CheckEqual(Options.PhysicalControls,true)
543
#endplatform
544
545
#platform: Use_Origins
546
CheckEqual(Options.PhysicalControls,true)
547
#endplatform
548
549
// 2011 Steam lacks Options.PhysicalControls, so we force it here first and the other platforms can override it
550
if CheckResult == true
551
if KeyPress[0].Left == true
552
Helper.VMCurrentButton--
553
PlaySfx(SFX_G_MENUBUTTON, false)
554
if Helper.VMCurrentButton < 0
555
Helper.VMCurrentButton = 3
556
end if
557
end if
558
559
if KeyPress[0].Right == true
560
Helper.VMCurrentButton++
561
PlaySfx(SFX_G_MENUBUTTON, false)
562
if Helper.VMCurrentButton > 3
563
Helper.VMCurrentButton = 0
564
end if
565
end if
566
567
if KeyPress[0].Up == true
568
Helper.VMCurrentButton -= 2
569
PlaySfx(SFX_G_MENUBUTTON, false)
570
if Helper.VMCurrentButton < 0
571
Helper.VMCurrentButton += 4
572
end if
573
end if
574
575
if KeyPress[0].Down == true
576
Helper.VMCurrentButton += 2
577
PlaySfx(SFX_G_MENUBUTTON, false)
578
if Helper.VMCurrentButton > 3
579
Helper.VMCurrentButton -= 4
580
end if
581
end if
582
583
end if
584
585
#platform: Mobile
586
// Just to make it look neat, instead of continuing the code from an open if on another platform, we ask again for a check in the physical controls
587
if Options.PhysicalControls == true
588
CheckTouchRect(0, 0, Screen.XSize, Screen.YSize) //Touch Behaviour Check
589
if CheckResult > -1
590
Options.PhysicalControls = false
591
Helper.VMCurrentButton = -1
592
end if
593
594
else
595
if Engine.Message == MESSAGE_LOSTFOCUS
596
Helper.VMCurrentButton = -1
597
end if
598
CheckTouchRect(0, 0, Screen.XSize, Screen.YSize) //Touch Input Reset
599
TempValue3 = CheckResult
600
601
TempValue0 = Screen.CenterX
602
TempValue0 -= 88
603
TempValue1 = Screen.CenterX
604
TempValue1 -= 40
605
CheckTouchRect(TempValue0, 72, TempValue1, 120) //Opening Touch Press
606
if CheckResult > -1
607
Helper.VMCurrentButton = 0
608
else
609
if TempValue3 < 0
610
if Helper.VMCurrentButton == 0
611
KeyPress[0].Start = true
612
end if
613
else
614
if Helper.VMCurrentButton == 0
615
Helper.VMCurrentButton = -1
616
end if
617
end if
618
end if
619
620
CheckTouchRect(TempValue0, 129, TempValue1, 177) //Good Ending Touch Press
621
if CheckResult > -1
622
Helper.VMCurrentButton = 2
623
else
624
if TempValue3 < 0
625
if Helper.VMCurrentButton == 2
626
KeyPress[0].Start = true
627
end if
628
else
629
if Helper.VMCurrentButton == 2
630
Helper.VMCurrentButton = -1
631
end if
632
end if
633
end if
634
635
TempValue0 = Screen.CenterX
636
TempValue0 += 40
637
TempValue1 = Screen.CenterX
638
TempValue1 += 88
639
CheckTouchRect(TempValue0, 72, TempValue1, 120) //Pencil Test Touch Press
640
if CheckResult > -1
641
Helper.VMCurrentButton = 1
642
else
643
if TempValue3 < 0
644
if Helper.VMCurrentButton == 1
645
KeyPress[0].Start = true
646
end if
647
else
648
if Helper.VMCurrentButton == 1
649
Helper.VMCurrentButton = -1
650
end if
651
end if
652
end if
653
654
CheckTouchRect(TempValue0, 129, TempValue1, 177) //Bad Ending Touch Press
655
if CheckResult > -1
656
Helper.VMCurrentButton = 3
657
else
658
if TempValue3 < 0
659
if Helper.VMCurrentButton == 3
660
KeyPress[0].Start = true
661
end if
662
else
663
if Helper.VMCurrentButton == 3
664
Helper.VMCurrentButton = -1
665
end if
666
end if
667
end if
668
669
TempValue0 = Screen.XSize
670
TempValue0 -= 96
671
CheckTouchRect(TempValue0, 192, Screen.XSize, Screen.YSize) //Back Touch Press
672
if CheckResult > -1
673
Helper.VMCurrentButton = 4
674
MenuWindow.BackTouchPress = true
675
else
676
MenuWindow.BackTouchPress = false
677
if TempValue3 < 0
678
if Helper.VMCurrentButton == 4
679
KeyPress[0].ButtonB = true
680
end if
681
else
682
if Helper.VMCurrentButton == 4
683
Helper.VMCurrentButton = -1
684
end if
685
end if
686
end if
687
//Turn on Physical Controls
688
if KeyPress[0].Left == true
689
Helper.VMCurrentButton = 1
690
Options.PhysicalControls = true
691
end if
692
693
if KeyPress[0].Right == true
694
Helper.VMCurrentButton = 0
695
Options.PhysicalControls = true
696
end if
697
698
if KeyPress[0].Up == true
699
Helper.VMCurrentButton = 3
700
Options.PhysicalControls = true
701
end if
702
703
if KeyPress[0].Down == true
704
Helper.VMCurrentButton = 0
705
Options.PhysicalControls = true
706
end if
707
end if
708
#endplatform
709
710
CheckResult = false
711
712
if Helper.VMCurrentButton > -1
713
if KeyPress[0].Start == true
714
CheckResult = true
715
end if
716
717
if KeyPress[0].ButtonA == true
718
CheckResult = true
719
end if
720
end if
721
722
if CheckResult == true
723
PlaySfx(SFX_G_SELECT, false)
724
StopMusic()
725
Object.State++
726
end if
727
728
if KeyPress[0].ButtonB == true
729
Object.State = EXTRASMENU_VISUALMODE_FADEOUT
730
Object.Timer = 248
731
PlayStageSfx(SFX_S_BACKBUTTON, false)
732
end if
733
break
734
735
case EXTRASMENU_VISUALMODE_SELECTED
736
if Object.Timer < 30
737
Object.Timer++
738
else
739
Object.Timer = 0
740
Object.State++
741
end if
742
743
break
744
745
case EXTRASMENU_VISUALMODE_VIDEOPLAY
746
if Object.Timer < 384
747
Object.Timer += 8
748
else
749
#platform: Use_Origins
750
game.callbackParam0 = 1
751
EngineCallback(NOTIFY_EXTRAS_MODE)
752
#endplatform
753
754
switch Helper.VMCurrentButton
755
case 0
756
LoadVideo("Opening")
757
break
758
759
case 1
760
LoadVideo("Pencil_Test")
761
break
762
763
case 2
764
LoadVideo("Good_Ending")
765
break
766
767
case 3
768
LoadVideo("Bad_Ending")
769
break
770
771
end switch
772
// Because of the way mobile cd worked (using the phone's native video player)
773
// it needed to reproduce separated videos depending of the soundtrack option
774
// for the sake of clarity and simplicity, the mobile code got commented out
775
//
776
// switch Helper.VMCurrentButton
777
// case 0
778
// if Options.Soundtrack == OST_JP
779
// LoadVideo("Opening")
780
// else
781
// LoadVideo("OpeningUS")
782
// end if
783
// break
784
//
785
// case 1
786
// LoadVideo("Pencil_Test")
787
// break
788
//
789
// case 2
790
// if Options.Soundtrack == OST_JP
791
// LoadVideo("Good_Ending")
792
// else
793
// LoadVideo("Good_EndingUS")
794
// end if
795
// break
796
//
797
// case 3
798
// if Options.Soundtrack == OST_JP
799
// LoadVideo("Bad_Ending")
800
// else
801
// LoadVideo("Bad_EndingUS")
802
// end if
803
// break
804
//
805
// end switch
806
807
#platform: Use_Origins
808
game.callbackParam0 = 0
809
EngineCallback(NOTIFY_EXTRAS_MODE)
810
#endplatform
811
812
#platform: Mobile
813
Helper.VMCurrentButton = -1
814
#endplatform
815
816
Object.State = EXTRASMENU_FADEIN
817
end if
818
819
TempValue0 = Object.Timer
820
if TempValue0 > 255
821
TempValue0 = 255
822
end if
823
SetScreenFade(0, 0, 0, TempValue0)
824
break
825
826
case EXTRASMENU_VISUALMODE_FADEOUT
827
if Object.Timer > 0
828
Object.Alpha = Object.Timer
829
Object.Timer -= 8
830
else
831
Object.Alpha = 0
832
Object.State++
833
end if
834
break
835
836
case EXTRASMENU_VISUALMODE_RETURN
837
TempValue0 = Object.CurrentButton
838
TempValue0 *= 40
839
TempValue0 += Screen.CenterY
840
TempValue0 -= 87
841
if Object.YPos < TempValue0
842
Object.YPos += 8
843
if Object.YPos > TempValue0
844
Object.YPos = TempValue0
845
end if
846
Object.Alpha = 0
847
else
848
#platform: Use_Origins
849
if Options.PhysicalControls == false
850
Object.CurrentButton = -1
851
end if
852
#endplatform
853
854
#platform: Mobile
855
if Options.PhysicalControls == false
856
Object.CurrentButton = -1
857
end if
858
#endplatform
859
Object.State = EXTRASMENU_CONTROLS
860
Object.Alpha = 255
861
end if
862
break
863
864
case EXTRASMENU_EXIT_MENU
865
if Object.Timer > 0
866
Object.Alpha = Object.Timer
867
Object.Timer -= 8
868
else
869
Object.Type = TypeName[Blank Object]
870
MenuWindow.State = MENUWINDOW_SHRINK
871
//All of this is MenuButton objects
872
Object[34].State = MENUBUTTON_BUTTONS_IN
873
Object[35].State = MENUBUTTON_BUTTONS_IN
874
Object[36].State = MENUBUTTON_BUTTONS_IN
875
Object[37].State = MENUBUTTON_BUTTONS_IN
876
Object[38].State = MENUBUTTON_BUTTONS_IN
877
Object[39].State = MENUBUTTON_BUTTONS_IN
878
Object[40].State = MENUBUTTON_BUTTONS_IN
879
Object[41].State = MENUBUTTON_BUTTONS_IN
880
Object[42].State = MENUBUTTON_BUTTONS_IN
881
//End
882
MenuHeading.State = MENUHEADING_LEAVE_SCREEN
883
MenuHeading.Header = MAINMENU_HEADER
884
end if
885
break
886
887
case EXTRASMENU_FADEIN
888
if Object.Timer > 0
889
Object.Timer -= 8
890
else
891
Object.State = EXTRASMENU_VISUALMODE
892
PlayMusic(Options.Soundtrack)
893
end if
894
TempValue0 = Object.Timer
895
if TempValue0 > 255
896
TempValue0 = 255
897
end if
898
SetScreenFade(0, 0, 0, TempValue0)
899
break
900
901
#platform: Use_Origins
902
case EXTRASMENU_RETURN_TO_TITLE
903
Object.Timer += 4
904
if Object.Timer == 384
905
Stage.ActiveList = PRESENTATION_STAGE
906
Stage.ListPos = STAGE_P_TITLE
907
LoadStage()
908
end if
909
SetScreenFade(0, 0, 0, Object.Timer)
910
break
911
#endplatform
912
end switch
913
end sub
914
915
916
sub ObjectDraw
917
switch Object.State
918
case EXTRASMENU_ENTER_MENU
919
case EXTRASMENU_CONTROLS
920
case EXTRASMENU_SELECTED_OPTION
921
case EXTRASMENU_LOAD_EXTRA_STAGE
922
case EXTRASMENU_EXIT_MENU
923
#platform: Use_Origins
924
case EXTRASMENU_RETURN_TO_TITLE
925
#endplatform
926
Object.YPos = Screen.CenterY
927
Object.YPos -= 87
928
ArrayPos0 = 0
929
CallFunction(ExtrasMenu_DrawUnlocks) //Draw DA Garden
930
931
Object.YPos += 40
932
ArrayPos0++
933
CallFunction(ExtrasMenu_DrawUnlocks) //Draw Visual Mode
934
935
Object.YPos += 40
936
ArrayPos0++
937
CallFunction(ExtrasMenu_DrawUnlocks) //Draw Sound Test
938
939
Object.YPos += 40
940
ArrayPos0++
941
CallFunction(ExtrasMenu_DrawUnlocks) //Draw Stage Select
942
break
943
944
case EXTRASMENU_LOAD_VISUALMODE
945
ArrayPos0 = Object.CurrentButton
946
CallFunction(ExtrasMenu_DrawUnlocks)
947
break
948
949
case EXTRASMENU_VISUALMODE_FADEIN
950
case EXTRASMENU_VISUALMODE
951
case EXTRASMENU_VISUALMODE_VIDEOPLAY
952
case EXTRASMENU_VISUALMODE_FADEOUT
953
case EXTRASMENU_VISUALMODE_RETURN
954
case EXTRASMENU_FADEIN
955
TempValue0 = Screen.CenterX
956
TempValue0 -= 64
957
DrawSpriteScreenFX(4, FX_INK, TempValue0, 96)
958
959
if Helper.VMCurrentButton == 0
960
DrawSpriteScreenFX(26, FX_INK, TempValue0, 96)
961
DrawSpriteScreenFX(22, FX_INK, TempValue0, 96)
962
else
963
DrawSpriteScreenFX(18, FX_INK, TempValue0, 96)
964
end if
965
966
DrawSpriteScreenFX(6, FX_INK, TempValue0, 153)
967
968
if Helper.VMCurrentButton == 2
969
DrawSpriteScreenFX(26, FX_INK, TempValue0, 153)
970
DrawSpriteScreenFX(24, FX_INK, TempValue0, 153)
971
else
972
DrawSpriteScreenFX(20, FX_INK, TempValue0, 153)
973
end if
974
975
TempValue0 += 128
976
DrawSpriteScreenFX(5, FX_INK, TempValue0, 96)
977
if Helper.VMCurrentButton == 1
978
DrawSpriteScreenFX(26, FX_INK, TempValue0, 96)
979
DrawSpriteScreenFX(23, FX_INK, TempValue0, 96)
980
else
981
DrawSpriteScreenFX(19, FX_INK, TempValue0, 96)
982
end if
983
984
DrawSpriteScreenFX(7, FX_INK, TempValue0, 153)
985
if Helper.VMCurrentButton == 3
986
DrawSpriteScreenFX(26, FX_INK, TempValue0, 153)
987
DrawSpriteScreenFX(25, FX_INK, TempValue0, 153)
988
else
989
DrawSpriteScreenFX(21, FX_INK, TempValue0, 153)
990
end if
991
Object.Alpha = 255
992
CallFunction(ExtrasMenu_DrawUnlocks)
993
break
994
995
case EXTRASMENU_VISUALMODE_SELECTED
996
TempValue1 = Object.Timer
997
TempValue1 &= 3
998
TempValue1 >>= 1
999
1000
TempValue0 = Screen.CenterX
1001
TempValue0 -= 64
1002
if Helper.VMCurrentButton == 0
1003
if TempValue1 == 0
1004
DrawSpriteScreenFX(4, FX_INK, TempValue0, 96)
1005
DrawSpriteScreenFX(26, FX_INK, TempValue0, 96)
1006
end if
1007
DrawSpriteScreenFX(22, FX_INK, TempValue0, 96)
1008
else
1009
DrawSpriteScreenFX(4, FX_INK, TempValue0, 96)
1010
DrawSpriteScreenFX(18, FX_INK, TempValue0, 96)
1011
end if
1012
1013
if Helper.VMCurrentButton == 2
1014
if TempValue1 == 0
1015
DrawSpriteScreenFX(6, FX_INK, TempValue0, 153)
1016
DrawSpriteScreenFX(26, FX_INK, TempValue0, 153)
1017
end if
1018
DrawSpriteScreenFX(24, FX_INK, TempValue0, 153)
1019
else
1020
DrawSpriteScreenFX(6, FX_INK, TempValue0, 153)
1021
DrawSpriteScreenFX(20, FX_INK, TempValue0, 153)
1022
end if
1023
1024
TempValue0 += 128
1025
if Helper.VMCurrentButton == 1
1026
if TempValue1 == 0
1027
DrawSpriteScreenFX(5, FX_INK, TempValue0, 96)
1028
DrawSpriteScreenFX(26, FX_INK, TempValue0, 96)
1029
end if
1030
DrawSpriteScreenFX(23, FX_INK, TempValue0, 96)
1031
else
1032
DrawSpriteScreenFX(5, FX_INK, TempValue0, 96)
1033
DrawSpriteScreenFX(19, FX_INK, TempValue0, 96)
1034
end if
1035
if Helper.VMCurrentButton == 3
1036
if TempValue1 == 0
1037
DrawSpriteScreenFX(7, FX_INK, TempValue0, 153)
1038
DrawSpriteScreenFX(26, FX_INK, TempValue0, 153)
1039
end if
1040
DrawSpriteScreenFX(25, FX_INK, TempValue0, 153)
1041
else
1042
DrawSpriteScreenFX(7, FX_INK, TempValue0, 153)
1043
DrawSpriteScreenFX(21, FX_INK, TempValue0, 153)
1044
end if
1045
Object.Alpha = 255
1046
CallFunction(ExtrasMenu_DrawUnlocks)
1047
break
1048
end switch
1049
end sub
1050
1051
1052
sub ObjectStartup
1053
switch Engine.Language
1054
case LANG_ENGLISH
1055
LoadSpriteSheet("Menu/MenuGfx2_EN.gif")
1056
break
1057
1058
case LANG_FRENCH
1059
LoadSpriteSheet("Menu/MenuGfx2_FR.gif")
1060
break
1061
1062
case LANG_ITALIAN
1063
LoadSpriteSheet("Menu/MenuGfx2_IT.gif")
1064
break
1065
1066
case LANG_DEUTSCH
1067
LoadSpriteSheet("Menu/MenuGfx2_DE.gif")
1068
break
1069
1070
case LANG_SPANISH
1071
LoadSpriteSheet("Menu/MenuGfx2_ES.gif")
1072
break
1073
1074
case LANG_JAPANESE
1075
LoadSpriteSheet("Menu/MenuGfx2_JP.gif")
1076
break
1077
1078
end switch
1079
1080
SpriteFrame(4, 2, 32, 32, 479, 34) // #0 - Gear
1081
SpriteFrame(4, 2, 32, 32, 479, 359) // #1 - Lock Gear
1082
SpriteFrame(4, 2, 32, 32, 479, 34) // #2 - Gear 2
1083
SpriteFrame(4, 2, 32, 32, 479, 34) // #3 - Gear 3
1084
1085
SpriteFrame(-18, -18, 36, 36, 476, 106) // #4 - Opening Icon
1086
SpriteFrame(-18, -18, 36, 36, 476, 143) // #5 - Pencil Test
1087
SpriteFrame(-18, -18, 36, 36, 476, 285) // #6 - Good Ending
1088
SpriteFrame(-18, -18, 36, 36, 476, 322) // #7 - Bad Ending
1089
1090
SpriteFrame(45, 12, 13, 13, 488, 1) // #8 - Orange Triangle
1091
SpriteFrame(0, 0, 250, 37, 259, 421) // #9 - Selection Border
1092
1093
ArrayPos0 = 32
1094
ArrayPos1 = 48
1095
TempValue0 = 0
1096
TempValue1 = 0
1097
while ArrayPos0 < 39
1098
TempValue0 += SaveRAM[ArrayPos1]
1099
ArrayPos1++
1100
TempValue1 += SaveRAM[ArrayPos1]
1101
ArrayPos1 += 5
1102
TempValue0 += SaveRAM[ArrayPos1]
1103
ArrayPos1 += 6
1104
TempValue0 += SaveRAM[ArrayPos1]
1105
ArrayPos1 += 6
1106
ArrayPos0++
1107
loop
1108
1109
// TempValue0 will be used to check regular zones total time in time attack
1110
// TempValue1 checks for special stages total time instead
1111
if TempValue0 == 0
1112
TempValue0 = 400000
1113
1114
TempValue1 = 400000
1115
end if
1116
1117
if TempValue0 < 224757
1118
SpriteFrame(64, 12, 128, 16, 1, 120) // #10 - D. A. Garden
1119
Options.DAGardenFlag = true
1120
else
1121
SpriteFrame(64, 12, 128, 16, 1, 426) // #10 - Locked D. A. Garden
1122
end if
1123
1124
if TempValue0 < 154612
1125
SpriteFrame(64, 12, 128, 16, 1, 137) // #11 - Visual Mode
1126
Options.VisualModeFlag = true
1127
else
1128
SpriteFrame(64, 12, 128, 16, 130, 426) // #11 - Locked Visual Mode
1129
end if
1130
1131
if TempValue1 < 24207
1132
SpriteFrame(64, 12, 128, 16, 1, 154) // #12 - Sound Test
1133
Options.SoundTestFlag = true
1134
else
1135
SpriteFrame(64, 12, 48, 16, 404, 285) // #12 - Locked Sound Test
1136
end if
1137
1138
if TempValue1 < 30125
1139
SpriteFrame(64, 12, 128, 16, 1, 171) // #13 - Stage Select
1140
Options.StageSelectFlag = true
1141
else
1142
SpriteFrame(64, 12, 48, 16, 404, 285) // #13 - Locked Stage Select
1143
end if
1144
1145
if TempValue0 < 224757
1146
SpriteFrame(64, 12, 128, 16, 130, 120) // #14 - Select D. A. Garden
1147
else
1148
SpriteFrame(64, 12, 128, 16, 1, 426) // #14 - Locked D. A. Garden
1149
end if
1150
1151
if TempValue0 < 154612
1152
SpriteFrame(64, 12, 128, 16, 130, 137) // #15 - Select Visual Mode
1153
else
1154
SpriteFrame(64, 12, 128, 16, 130, 426) // #15 - Locked Visual Mode
1155
end if
1156
1157
if TempValue1 < 24207
1158
SpriteFrame(64, 12, 128, 16, 130, 154) // #16 - Select Sound Test
1159
else
1160
SpriteFrame(64, 12, 48, 16, 404, 285) // #16 - Locked Sound Test
1161
end if
1162
1163
if TempValue1 < 30125
1164
SpriteFrame(64, 12, 128, 16, 130, 171) // #17 - Select Stage Select
1165
else
1166
SpriteFrame(64, 12, 48, 16, 404, 285) // #17 - Locked Stage Select
1167
end if
1168
1169
SpriteFrame(-48, 25, 96, 8, 1, 496) // #18 - Opening Text
1170
SpriteFrame(-48, 25, 96, 8, 1, 504) // #19 - Pencil Test Text
1171
SpriteFrame(-48, 25, 96, 8, 98, 496) // #20 - Good Ending
1172
SpriteFrame(-48, 25, 96, 8, 98, 504) // #21 - Bad Ending
1173
1174
SpriteFrame(-48, 25, 96, 8, 195, 496) // #22 - Opening Text Highlight
1175
SpriteFrame(-48, 25, 96, 8, 195, 504) // #23 - Pencil Test Text Highlight
1176
SpriteFrame(-48, 25, 96, 8, 292, 496) // #24 - Good Ending Text Highlight
1177
SpriteFrame(-48, 25, 96, 8, 292, 504) // #25 - Bad Ending Text Highlight
1178
1179
SpriteFrame(-24, -24, 48, 48, 405, 88) // #26 - Icon Border
1180
end sub
1181
1182
1183
// ========================
1184
// Editor Subs
1185
// ========================
1186
1187
sub RSDKDraw
1188
DrawSprite(0)
1189
end sub
1190
1191
1192
sub RSDKLoad
1193
LoadSpriteSheet("Menu/MenuGfx2_EN.gif")
1194
SpriteFrame(32, 0, 160, 30, 1, 708) // #8 Extras
1195
1196
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
1197
end sub
1198
1199