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
1319 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
case EXTRASMENU_RETURN_TO_TITLE
902
Object.Timer += 4
903
if Object.Timer == 384
904
Stage.ActiveList = PRESENTATION_STAGE
905
Stage.ListPos = STAGE_P_TITLE
906
LoadStage()
907
end if
908
SetScreenFade(0, 0, 0, Object.Timer)
909
break
910
911
end switch
912
end sub
913
914
915
sub ObjectDraw
916
switch Object.State
917
case EXTRASMENU_ENTER_MENU
918
case EXTRASMENU_CONTROLS
919
case EXTRASMENU_SELECTED_OPTION
920
case EXTRASMENU_LOAD_EXTRA_STAGE
921
case EXTRASMENU_EXIT_MENU
922
case EXTRASMENU_RETURN_TO_TITLE
923
Object.YPos = Screen.CenterY
924
Object.YPos -= 87
925
ArrayPos0 = 0
926
CallFunction(ExtrasMenu_DrawUnlocks) //Draw DA Garden
927
928
Object.YPos += 40
929
ArrayPos0++
930
CallFunction(ExtrasMenu_DrawUnlocks) //Draw Visual Mode
931
932
Object.YPos += 40
933
ArrayPos0++
934
CallFunction(ExtrasMenu_DrawUnlocks) //Draw Sound Test
935
936
Object.YPos += 40
937
ArrayPos0++
938
CallFunction(ExtrasMenu_DrawUnlocks) //Draw Stage Select
939
break
940
941
case EXTRASMENU_LOAD_VISUALMODE
942
ArrayPos0 = Object.CurrentButton
943
CallFunction(ExtrasMenu_DrawUnlocks)
944
break
945
946
case EXTRASMENU_VISUALMODE_FADEIN
947
case EXTRASMENU_VISUALMODE
948
case EXTRASMENU_VISUALMODE_VIDEOPLAY
949
case EXTRASMENU_VISUALMODE_FADEOUT
950
case EXTRASMENU_VISUALMODE_RETURN
951
case EXTRASMENU_FADEIN
952
TempValue0 = Screen.CenterX
953
TempValue0 -= 64
954
DrawSpriteScreenFX(4, FX_INK, TempValue0, 96)
955
956
if Helper.VMCurrentButton == 0
957
DrawSpriteScreenFX(26, FX_INK, TempValue0, 96)
958
DrawSpriteScreenFX(22, FX_INK, TempValue0, 96)
959
else
960
DrawSpriteScreenFX(18, FX_INK, TempValue0, 96)
961
end if
962
963
DrawSpriteScreenFX(6, FX_INK, TempValue0, 153)
964
965
if Helper.VMCurrentButton == 2
966
DrawSpriteScreenFX(26, FX_INK, TempValue0, 153)
967
DrawSpriteScreenFX(24, FX_INK, TempValue0, 153)
968
else
969
DrawSpriteScreenFX(20, FX_INK, TempValue0, 153)
970
end if
971
972
TempValue0 += 128
973
DrawSpriteScreenFX(5, FX_INK, TempValue0, 96)
974
if Helper.VMCurrentButton == 1
975
DrawSpriteScreenFX(26, FX_INK, TempValue0, 96)
976
DrawSpriteScreenFX(23, FX_INK, TempValue0, 96)
977
else
978
DrawSpriteScreenFX(19, FX_INK, TempValue0, 96)
979
end if
980
981
DrawSpriteScreenFX(7, FX_INK, TempValue0, 153)
982
if Helper.VMCurrentButton == 3
983
DrawSpriteScreenFX(26, FX_INK, TempValue0, 153)
984
DrawSpriteScreenFX(25, FX_INK, TempValue0, 153)
985
else
986
DrawSpriteScreenFX(21, FX_INK, TempValue0, 153)
987
end if
988
Object.Alpha = 255
989
CallFunction(ExtrasMenu_DrawUnlocks)
990
break
991
992
case EXTRASMENU_VISUALMODE_SELECTED
993
TempValue1 = Object.Timer
994
TempValue1 &= 3
995
TempValue1 >>= 1
996
997
TempValue0 = Screen.CenterX
998
TempValue0 -= 64
999
if Helper.VMCurrentButton == 0
1000
if TempValue1 == 0
1001
DrawSpriteScreenFX(4, FX_INK, TempValue0, 96)
1002
DrawSpriteScreenFX(26, FX_INK, TempValue0, 96)
1003
end if
1004
DrawSpriteScreenFX(22, FX_INK, TempValue0, 96)
1005
else
1006
DrawSpriteScreenFX(4, FX_INK, TempValue0, 96)
1007
DrawSpriteScreenFX(18, FX_INK, TempValue0, 96)
1008
end if
1009
1010
if Helper.VMCurrentButton == 2
1011
if TempValue1 == 0
1012
DrawSpriteScreenFX(6, FX_INK, TempValue0, 153)
1013
DrawSpriteScreenFX(26, FX_INK, TempValue0, 153)
1014
end if
1015
DrawSpriteScreenFX(24, FX_INK, TempValue0, 153)
1016
else
1017
DrawSpriteScreenFX(6, FX_INK, TempValue0, 153)
1018
DrawSpriteScreenFX(20, FX_INK, TempValue0, 153)
1019
end if
1020
1021
TempValue0 += 128
1022
if Helper.VMCurrentButton == 1
1023
if TempValue1 == 0
1024
DrawSpriteScreenFX(5, FX_INK, TempValue0, 96)
1025
DrawSpriteScreenFX(26, FX_INK, TempValue0, 96)
1026
end if
1027
DrawSpriteScreenFX(23, FX_INK, TempValue0, 96)
1028
else
1029
DrawSpriteScreenFX(5, FX_INK, TempValue0, 96)
1030
DrawSpriteScreenFX(19, FX_INK, TempValue0, 96)
1031
end if
1032
if Helper.VMCurrentButton == 3
1033
if TempValue1 == 0
1034
DrawSpriteScreenFX(7, FX_INK, TempValue0, 153)
1035
DrawSpriteScreenFX(26, FX_INK, TempValue0, 153)
1036
end if
1037
DrawSpriteScreenFX(25, FX_INK, TempValue0, 153)
1038
else
1039
DrawSpriteScreenFX(7, FX_INK, TempValue0, 153)
1040
DrawSpriteScreenFX(21, FX_INK, TempValue0, 153)
1041
end if
1042
Object.Alpha = 255
1043
CallFunction(ExtrasMenu_DrawUnlocks)
1044
break
1045
end switch
1046
end sub
1047
1048
1049
sub ObjectStartup
1050
switch Engine.Language
1051
case LANG_ENGLISH
1052
LoadSpriteSheet("Menu/MenuGfx2_EN.gif")
1053
break
1054
1055
case LANG_FRENCH
1056
LoadSpriteSheet("Menu/MenuGfx2_FR.gif")
1057
break
1058
1059
case LANG_ITALIAN
1060
LoadSpriteSheet("Menu/MenuGfx2_IT.gif")
1061
break
1062
1063
case LANG_DEUTSCH
1064
LoadSpriteSheet("Menu/MenuGfx2_DE.gif")
1065
break
1066
1067
case LANG_SPANISH
1068
LoadSpriteSheet("Menu/MenuGfx2_ES.gif")
1069
break
1070
1071
case LANG_JAPANESE
1072
LoadSpriteSheet("Menu/MenuGfx2_JP.gif")
1073
break
1074
1075
end switch
1076
1077
SpriteFrame(4, 2, 32, 32, 479, 34) // #0 - Gear
1078
SpriteFrame(4, 2, 32, 32, 479, 359) // #1 - Lock Gear
1079
SpriteFrame(4, 2, 32, 32, 479, 34) // #2 - Gear 2
1080
SpriteFrame(4, 2, 32, 32, 479, 34) // #3 - Gear 3
1081
1082
SpriteFrame(-18, -18, 36, 36, 476, 106) // #4 - Opening Icon
1083
SpriteFrame(-18, -18, 36, 36, 476, 143) // #5 - Pencil Test
1084
SpriteFrame(-18, -18, 36, 36, 476, 285) // #6 - Good Ending
1085
SpriteFrame(-18, -18, 36, 36, 476, 322) // #7 - Bad Ending
1086
1087
SpriteFrame(45, 12, 13, 13, 488, 1) // #8 - Orange Triangle
1088
SpriteFrame(0, 0, 250, 37, 259, 421) // #9 - Selection Border
1089
1090
ArrayPos0 = 32
1091
ArrayPos1 = 48
1092
TempValue0 = 0
1093
TempValue1 = 0
1094
while ArrayPos0 < 39
1095
TempValue0 += SaveRAM[ArrayPos1]
1096
ArrayPos1++
1097
TempValue1 += SaveRAM[ArrayPos1]
1098
ArrayPos1 += 5
1099
TempValue0 += SaveRAM[ArrayPos1]
1100
ArrayPos1 += 6
1101
TempValue0 += SaveRAM[ArrayPos1]
1102
ArrayPos1 += 6
1103
ArrayPos0++
1104
loop
1105
1106
// TempValue0 will be used to check regular zones total time in time attack
1107
// TempValue1 checks for special stages total time instead
1108
if TempValue0 == 0
1109
TempValue0 = 400000
1110
1111
TempValue1 = 400000
1112
end if
1113
1114
if TempValue0 < 224757
1115
SpriteFrame(64, 12, 128, 16, 1, 120) // #10 - D. A. Garden
1116
Options.DAGardenFlag = true
1117
else
1118
SpriteFrame(64, 12, 128, 16, 1, 426) // #10 - Locked D. A. Garden
1119
end if
1120
1121
if TempValue0 < 154612
1122
SpriteFrame(64, 12, 128, 16, 1, 137) // #11 - Visual Mode
1123
Options.VisualModeFlag = true
1124
else
1125
SpriteFrame(64, 12, 128, 16, 130, 426) // #11 - Locked Visual Mode
1126
end if
1127
1128
if TempValue1 < 24207
1129
SpriteFrame(64, 12, 128, 16, 1, 154) // #12 - Sound Test
1130
Options.SoundTestFlag = true
1131
else
1132
SpriteFrame(64, 12, 48, 16, 404, 285) // #12 - Locked Sound Test
1133
end if
1134
1135
if TempValue1 < 30125
1136
SpriteFrame(64, 12, 128, 16, 1, 171) // #13 - Stage Select
1137
Options.StageSelectFlag = true
1138
else
1139
SpriteFrame(64, 12, 48, 16, 404, 285) // #13 - Locked Stage Select
1140
end if
1141
1142
if TempValue0 < 224757
1143
SpriteFrame(64, 12, 128, 16, 130, 120) // #14 - Select D. A. Garden
1144
else
1145
SpriteFrame(64, 12, 128, 16, 1, 426) // #14 - Locked D. A. Garden
1146
end if
1147
1148
if TempValue0 < 154612
1149
SpriteFrame(64, 12, 128, 16, 130, 137) // #15 - Select Visual Mode
1150
else
1151
SpriteFrame(64, 12, 128, 16, 130, 426) // #15 - Locked Visual Mode
1152
end if
1153
1154
if TempValue1 < 24207
1155
SpriteFrame(64, 12, 128, 16, 130, 154) // #16 - Select Sound Test
1156
else
1157
SpriteFrame(64, 12, 48, 16, 404, 285) // #16 - Locked Sound Test
1158
end if
1159
1160
if TempValue1 < 30125
1161
SpriteFrame(64, 12, 128, 16, 130, 171) // #17 - Select Stage Select
1162
else
1163
SpriteFrame(64, 12, 48, 16, 404, 285) // #17 - Locked Stage Select
1164
end if
1165
1166
SpriteFrame(-48, 25, 96, 8, 1, 496) // #18 - Opening Text
1167
SpriteFrame(-48, 25, 96, 8, 1, 504) // #19 - Pencil Test Text
1168
SpriteFrame(-48, 25, 96, 8, 98, 496) // #20 - Good Ending
1169
SpriteFrame(-48, 25, 96, 8, 98, 504) // #21 - Bad Ending
1170
1171
SpriteFrame(-48, 25, 96, 8, 195, 496) // #22 - Opening Text Highlight
1172
SpriteFrame(-48, 25, 96, 8, 195, 504) // #23 - Pencil Test Text Highlight
1173
SpriteFrame(-48, 25, 96, 8, 292, 496) // #24 - Good Ending Text Highlight
1174
SpriteFrame(-48, 25, 96, 8, 292, 504) // #25 - Bad Ending Text Highlight
1175
1176
SpriteFrame(-24, -24, 48, 48, 405, 88) // #26 - Icon Border
1177
end sub
1178
1179
1180
// ========================
1181
// Editor Subs
1182
// ========================
1183
1184
sub RSDKDraw
1185
DrawSprite(0)
1186
end sub
1187
1188
1189
sub RSDKLoad
1190
LoadSpriteSheet("Menu/MenuGfx2_EN.gif")
1191
SpriteFrame(32, 0, 160, 30, 1, 708) // #8 Extras
1192
1193
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
1194
end sub
1195
1196