Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/Menu/AboutMenu.txt
1319 views
1
//-----------------Sonic CD About Menu Script-----------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
//---This Object is normally only used by Mobile Data files---//
5
6
// Aliases
7
#alias Object.Value1 : Object.ButtonSelected
8
#alias Object.Value2 : Object.DrawHeight
9
#alias Object[-10].Alpha : Object.OptionsAlpha //a.k.a the alpha value from the menu that called this
10
11
// States
12
#alias 0 : ABOUTMENU_CONTROLS
13
#alias 1 : ABOUTMENU_OPTION_SELECTED
14
15
// Global SFX
16
#alias 23 : SFX_G_MENUBUTTON
17
#alias 27 : SFX_G_SELECT
18
19
// Engine States & Callbacks
20
#alias 9 : CALLBACK_TERMS_SELECTED
21
#alias 10 : CALLBACK_PRIVACY_SELECTED
22
23
// Text Info type
24
#alias 0 : TEXTINFO_TEXTDATA
25
#alias 1 : TEXTINFO_TEXTSIZE
26
27
28
sub ObjectMain
29
Object.Alpha = Object.OptionsAlpha
30
#platform: Mobile
31
if Object.Alpha > 254
32
switch Object.State
33
case ABOUTMENU_CONTROLS
34
if Options.PhysicalControls == true
35
if KeyPress[0].Up == true
36
Object.ButtonSelected--
37
if Object.ButtonSelected < 0
38
Object.ButtonSelected = 1
39
end if
40
PlaySfx(SFX_G_MENUBUTTON, false)
41
end if
42
43
if KeyPress[0].Down == true
44
Object.ButtonSelected++
45
if Object.ButtonSelected > 1
46
Object.ButtonSelected = 0
47
end if
48
PlaySfx(SFX_G_MENUBUTTON, false)
49
end if
50
51
CheckTouchRect(0, 0, Screen.XSize, Screen.YSize) //Touch input reset
52
if CheckResult > -1
53
Options.PhysicalControls = false
54
Object.ButtonSelected = -1
55
end if
56
else
57
CheckTouchRect(0, 0, Screen.XSize, Screen.YSize) //Touch input reset
58
TempValue3 = CheckResult
59
60
TempValue0 = Screen.CenterX
61
TempValue0 += 36
62
TempValue1 = Screen.CenterX
63
TempValue1 += 110
64
CheckTouchRect(TempValue0, 124, TempValue1, 152) //Terms button press
65
if CheckResult > -1
66
Object.ButtonSelected = 0
67
else
68
if TempValue3 < 0
69
if Object.ButtonSelected == 0
70
KeyPress[0].Start = true
71
end if
72
else
73
if Object.ButtonSelected == 0
74
Object.ButtonSelected = -1
75
end if
76
end if
77
end if
78
79
TempValue0 = Screen.CenterX
80
TempValue0 += 36
81
TempValue1 = Screen.CenterX
82
TempValue1 += 110
83
CheckTouchRect(TempValue0, 152, TempValue1, 180) //Privacy button press
84
if CheckResult > -1
85
Object.ButtonSelected = 1
86
else
87
if TempValue3 < 0
88
if Object.ButtonSelected == 1
89
KeyPress[0].Start = true
90
end if
91
else
92
if Object.ButtonSelected == 1
93
Object.ButtonSelected = -1
94
end if
95
end if
96
end if
97
98
CallFunction(MenuHeading_CheckTouchBack)
99
if KeyPress[0].Up == true
100
Object.ButtonSelected = 1
101
Options.PhysicalControls = true
102
end if
103
104
if KeyPress[0].Down == true
105
Object.ButtonSelected = 0
106
Options.PhysicalControls = true
107
end if
108
109
end if
110
111
CheckResult = false
112
if Object.ButtonSelected > -1
113
if KeyPress[0].Start == true
114
CheckResult = true
115
end if
116
117
if KeyPress[0].ButtonA == true
118
CheckResult = true
119
end if
120
end if
121
122
if CheckResult == true
123
PlaySfx(SFX_G_SELECT, false)
124
Object.State++
125
end if
126
break
127
128
case ABOUTMENU_OPTION_SELECTED
129
if Object.AnimationTimer < 30
130
Object.AnimationTimer++
131
else
132
Object.AnimationTimer = 0
133
Object.State = ABOUTMENU_CONTROLS
134
switch Object.ButtonSelected
135
case 0
136
EngineCallback(CALLBACK_TERMS_SELECTED)
137
break
138
case 1
139
EngineCallback(CALLBACK_PRIVACY_SELECTED)
140
break
141
end switch
142
Object.ButtonSelected = -1
143
end if
144
break
145
146
end switch
147
else
148
if Options.PhysicalControls == false
149
Object.ButtonSelected = -1
150
end if
151
152
Object.AnimationTimer = 0
153
Object.State = ABOUTMENU_CONTROLS
154
end if
155
#endplatform
156
157
#platform: Use_Origins
158
if Object.Alpha > 254
159
if Options.PhysicalControls == false
160
CallFunction(MenuHeading_CheckTouchBack)
161
end if
162
else
163
if Options.PhysicalControls == false
164
Object.ButtonSelected = -1
165
end if
166
Object.AnimationTimer = 0
167
Object.State = ABOUTMENU_CONTROLS
168
end if
169
#endplatform
170
end sub
171
172
173
sub ObjectDraw
174
TempValue0 = Screen.CenterX
175
TempValue0 -= 120
176
DrawSpriteScreenFX(0, FX_INK, TempValue0, 72)
177
178
TempValue0 = Screen.CenterX
179
TempValue0 += 72
180
DrawSpriteScreenFX(1, FX_INK, TempValue0, 82)
181
182
TempValue0 = Screen.CenterX
183
TempValue0 += 72
184
if Object.ButtonSelected == 0
185
TempValue2 = Object.AnimationTimer
186
TempValue2 &= 3
187
TempValue2 >>= 1
188
TempValue2 += 44
189
DrawSpriteScreenFX(TempValue2, FX_INK, TempValue0, 128)
190
else
191
DrawSpriteScreenFX(45, FX_INK, TempValue0, 128)
192
end if
193
if Object.ButtonSelected == 1
194
TempValue2 = Object.AnimationTimer
195
TempValue2 &= 3
196
TempValue2 >>= 1
197
TempValue2 += 46
198
DrawSpriteScreenFX(TempValue2, FX_INK, TempValue0, 156)
199
else
200
DrawSpriteScreenFX(47, FX_INK, TempValue0, 156)
201
end if
202
203
ArrayPos0 = 0
204
GetTextInfo(TempValue1, MENU_1, TEXTINFO_TEXTSIZE, 0, 0) //Gets version numbers
205
TempValue2 = TempValue1
206
TempValue2 <<= 2
207
FlipSign(TempValue2)
208
TempValue2 += Screen.CenterX
209
TempValue2 += 72
210
Object.DrawHeight = 102
211
212
//This handles the drawing of the game version
213
while TempValue1 > 0
214
GetTextInfo(TempValue0, MENU_1, TEXTINFO_TEXTDATA, 0, ArrayPos0)
215
switch TempValue0
216
default
217
Object.Frame = 0
218
if TempValue0 > 64
219
if TempValue0 < 91
220
Object.Frame = TempValue0
221
Object.Frame -= 63
222
end if
223
end if
224
if TempValue0 > 96
225
if TempValue0 < 123
226
Object.Frame = TempValue0
227
Object.Frame -= 95
228
end if
229
end if
230
if TempValue0 > 47
231
if TempValue0 < 58
232
Object.Frame = TempValue0
233
Object.Frame -= 18
234
end if
235
end if
236
if Object.Frame > 0
237
DrawSpriteScreenFX(Object.Frame, FX_INK, TempValue2, Object.DrawHeight)
238
end if
239
break
240
241
case 38
242
DrawSpriteScreenFX(33, FX_INK, TempValue2, Object.DrawHeight)
243
break
244
245
case 39
246
DrawSpriteScreenFX(31, FX_INK, TempValue2, Object.DrawHeight)
247
break
248
249
case 44
250
DrawSpriteScreenFX(29, FX_INK, TempValue2, Object.DrawHeight)
251
break
252
253
case 46
254
DrawSpriteScreenFX(28, FX_INK, TempValue2, Object.DrawHeight)
255
break
256
257
end switch
258
ArrayPos0++
259
TempValue1--
260
TempValue2 += 8
261
loop
262
end sub
263
264
265
sub ObjectStartup
266
LoadSpriteSheet("Menu/MenuGfx1_EN.gif")
267
268
SpriteFrame(0, 0, 132, 113, 154, 235) // #0 - Sonic CD Mini Logo
269
SpriteFrame(-28, 0, 56, 16, 154, 349) // #1 - Version
270
271
TempValue1 = 366
272
while TempValue1 < 417
273
TempValue0 = 154
274
while TempValue0 < 280
275
SpriteFrame(-3, 0, 8, 16, TempValue0, TempValue1) // #2 to #44 - Alphabet and Numbers
276
TempValue0 += 9
277
loop
278
TempValue1 += 17
279
loop
280
281
SpriteFrame(-32, 0, 64, 21, 195, 476) // #45 - Terms Highlight
282
SpriteFrame(-32, 0, 64, 21, 130, 476) // #46 - Terms
283
SpriteFrame(-32, 0, 64, 21, 195, 454) // #47 - Privacy Highlight
284
SpriteFrame(-32, 0, 64, 21, 130, 454) // #48 - Privacy
285
SpriteFrame(-32, 0, 42, 21, 418, 439) // #49 - Facebook Log
286
SpriteFrame(-32, 0, 42, 21, 418, 461) // #50 - Facebook Log Highlight
287
SpriteFrame(10, 0, 22, 21, 464, 395) // #51 - Facebook Log In
288
SpriteFrame(10, 0, 22, 21, 464, 417) // #52 - Facebook Log In Highlight
289
SpriteFrame(10, 0, 22, 21, 464, 439) // #53 - Facebook Log Out
290
SpriteFrame(10, 0, 22, 21, 464, 461) // #54 - Facebook Log Out Highlight
291
end sub
292
293
294
// ========================
295
// Editor Subs
296
// ========================
297
298
sub RSDKDraw
299
DrawSprite(0)
300
end sub
301
302
303
sub RSDKLoad
304
LoadSpriteSheet("Global/Display.gif")
305
SpriteFrame(-16, -16, 32, 32, 1, 143) // #0 - "Script" Icon
306
307
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
308
end sub
309
310