Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-CD-2011-Script-Decompilation
Path: blob/main/Scripts/Menu/TrophiesButton.txt
1319 views
1
//-----------------Sonic CD Exit Button Script----------------//
2
//--------Scripted by Christian Whitehead 'The Taxman'--------//
3
//-------Unpacked By Rubberduckycooly's Script Unpacker-------//
4
//-----This Object is normally only used by WP7 Data files----//
5
6
// Aliases
7
#alias Object.Value1 : Object.InputCheck
8
9
//Object[0] is Trophies Menu
10
#alias Object[0].State : ThropiesMenu.State
11
12
// Thropies Menu States
13
#alias 2 : TROPHIES_CONTROLS
14
#alias 5 : TROPHIES_EXIT
15
16
// Global SFX
17
#alias 26 : SFX_G_OUTTAHERE
18
19
//Engine & CallBacks
20
#alias 2 : MESSAGE_LOSTFOCUS
21
22
23
sub ObjectMain
24
if ThropiesMenu.State == TROPHIES_CONTROLS
25
if Engine.Message == MESSAGE_LOSTFOCUS
26
Object.InputCheck = 0
27
end if
28
TempValue0 = Object.XPos
29
TempValue0 >>= 16
30
TempValue1 = TempValue0
31
TempValue0 -= 18
32
TempValue0 -= Screen.XOffset
33
TempValue1 += 18
34
TempValue1 -= Screen.XOffset
35
CheckTouchRect(TempValue0, 0, TempValue1, 48)
36
if CheckResult > -1
37
Object.InputCheck = true
38
else
39
CheckTouchRect(0, 0, Screen.XSize, Screen.YSize)
40
if CheckResult < 0
41
if Object.InputCheck == true
42
Object.InputCheck = false
43
PlaySfx(SFX_G_OUTTAHERE, false)
44
StopMusic()
45
ThropiesMenu.State = TROPHIES_EXIT
46
end if
47
else
48
Object.InputCheck = false
49
end if
50
end if
51
end if
52
end sub
53
54
55
sub ObjectDraw
56
Object.Scale = 128
57
if Object.InputCheck == true
58
DrawSpriteFX(1, FX_SCALE, Object.XPos, Object.YPos)
59
else
60
DrawSpriteFX(0, FX_SCALE, Object.XPos, Object.YPos)
61
end if
62
end sub
63
64
65
sub ObjectStartup
66
LoadSpriteSheet("Menu/Trophies.gif")
67
68
SpriteFrame(-63, -39, 126, 78, 129, 385) //#0 - Back Button
69
SpriteFrame(-60, -37, 120, 74, 260, 387) //#1 - Pressed Back Button
70
71
TempValue0 = Screen.CenterX
72
TempValue0 -= 160
73
TempValue0 <<= 16
74
75
ArrayPos0 = 32
76
while ArrayPos0 < 1056
77
if Object[ArrayPos0].Type == TypeName[Exit Button]
78
Object[ArrayPos0].XPos += TempValue0
79
end if
80
ArrayPos0++
81
loop
82
end sub
83
84
85
// ========================
86
// Editor Subs
87
// ========================
88
89
sub RSDKDraw
90
Object.Scale = 128
91
DrawSpriteFX(0, FX_SCALE, Object.XPos, Object.YPos)
92
end sub
93
94
95
sub RSDKLoad
96
LoadSpriteSheet("Menu/Trophies.gif")
97
98
SpriteFrame(-63, -39, 126, 78, 129, 385) //#0 - Back Button
99
100
SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")
101
end sub
102
103