Skip to content

Commit 0d7f792

Browse files
committed
separate Screen out from ScreenSelectMusic out
code bloat and organization
1 parent 529d3e6 commit 0d7f792

2 files changed

Lines changed: 72 additions & 59 deletions

File tree

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
t = Def.ActorFrame {}
2-
3-
local translated_info = {
4-
PressStart = THEME:GetString("ScreenSelectMusic","PressStartForOptions"),
5-
EnteringOptions = THEME:GetString("ScreenSelectMusic","EnteringOptions"),
6-
}
1+
local t = Def.ActorFrame {}
72

83
--black fade
94
t[#t + 1] = Def.Quad {
@@ -15,57 +10,4 @@ t[#t + 1] = Def.Quad {
1510
end
1611
}
1712

18-
--enter options prompt
19-
t[#t + 1] = Def.ActorFrame {
20-
InitCommand = function(self)
21-
self:diffusealpha(0):Center()
22-
end,
23-
ShowPressStartForOptionsCommand=function(self)
24-
self:zoom(0.9):smooth(0.2):diffusealpha(1):zoom(1)
25-
end,
26-
ShowEnteringOptionsCommand=function(self)
27-
--go read the comment below
28-
end,
29-
HidePressStartForOptionsCommand=function(self)
30-
self:decelerate(0.15):diffusealpha(0)
31-
end,
32-
Def.Quad {
33-
InitCommand = function(self)
34-
self:zoomto(SCREEN_WIDTH,80)
35-
self:diffusetopedge(Brightness(getMainColor("tabs"), 0.45))
36-
self:diffusebottomedge(Brightness(getMainColor("tabs"), 0.15))
37-
end,
38-
},
39-
Def.Quad {
40-
InitCommand = function(self)
41-
self:zoomto(SCREEN_WIDTH-10,70)
42-
self:diffusetopedge(Saturation(getMainColor("highlight"), 0.5))
43-
self:diffusebottomedge(Saturation(getMainColor("positive"), 0.6))
44-
end,
45-
},
46-
}
47-
t[#t + 1] = LoadFont("Common Large") .. {
48-
InitCommand=function(self)
49-
self:Center():diffusebottomedge(0.7,0.7,0.7,1):shadowlength(1.5):align(0.5,0.5)
50-
end,
51-
ShowPressStartForOptionsCommand=function(self)
52-
self:settext(translated_info["PressStart"]):diffusealpha(0):zoom(0.15)
53-
self:decelerate(0.2):zoom(0.55):diffusealpha(1)
54-
end,
55-
ShowEnteringOptionsCommand=function(self)
56-
self:finishtweening():settext(translated_info["EnteringOptions"])
57-
--for some reason, any tweens triggered by this command will get frozen after the first frame
58-
--unless you enter twice fast, that is
59-
--why? :shrug: Figure that out before putting a tween back in here -ulti_fd
60-
61-
--self:zoom(0.65):accelerate(0.2):zoom(0.55)
62-
end,
63-
HidePressStartForOptionsCommand=function(self)
64-
-- do we even need this? AllowOptionsMenu() always returns true
65-
-- we may as well hard code it in the c++ if we're gonna do that tbh
66-
self:decelerate(0.15):diffusealpha(0)
67-
end
68-
}
69-
70-
7113
return t
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
local t = Def.ActorFrame {}
2+
3+
local translated_info = {
4+
PressStart = THEME:GetString("ScreenSelectMusic","PressStartForOptions"),
5+
EnteringOptions = THEME:GetString("ScreenSelectMusic","EnteringOptions"),
6+
}
7+
8+
--black fade
9+
t[#t + 1] = Def.Quad {
10+
InitCommand = function(self)
11+
self:xy(SCREEN_CENTER_X, SCREEN_CENTER_Y):zoomto(SCREEN_WIDTH, SCREEN_HEIGHT)
12+
end,
13+
OnCommand = function(self)
14+
self:diffuse(color("0,0,0,0")):sleep(0.1):linear(0.1):diffusealpha(1)
15+
end
16+
}
17+
18+
--enter options prompt
19+
t[#t + 1] = Def.ActorFrame {
20+
InitCommand = function(self)
21+
self:diffusealpha(0):Center()
22+
end,
23+
ShowPressStartForOptionsCommand=function(self)
24+
self:zoom(0.9):smooth(0.2):diffusealpha(1):zoom(1)
25+
end,
26+
ShowEnteringOptionsCommand=function(self)
27+
--go read the comment below
28+
end,
29+
HidePressStartForOptionsCommand=function(self)
30+
self:decelerate(0.15):diffusealpha(0)
31+
end,
32+
Def.Quad {
33+
InitCommand = function(self)
34+
self:zoomto(SCREEN_WIDTH,80)
35+
self:diffusetopedge(Brightness(getMainColor("tabs"), 0.45))
36+
self:diffusebottomedge(Brightness(getMainColor("tabs"), 0.15))
37+
end,
38+
},
39+
Def.Quad {
40+
InitCommand = function(self)
41+
self:zoomto(SCREEN_WIDTH-10,70)
42+
self:diffusetopedge(Saturation(getMainColor("highlight"), 0.5))
43+
self:diffusebottomedge(Saturation(getMainColor("positive"), 0.6))
44+
end,
45+
},
46+
}
47+
t[#t + 1] = LoadFont("Common Large") .. {
48+
InitCommand=function(self)
49+
self:Center():diffusebottomedge(0.7,0.7,0.7,1):shadowlength(1.5):align(0.5,0.5)
50+
end,
51+
ShowPressStartForOptionsCommand=function(self)
52+
self:settext(translated_info["PressStart"]):diffusealpha(0):zoom(0.15)
53+
self:decelerate(0.2):zoom(0.55):diffusealpha(1)
54+
end,
55+
ShowEnteringOptionsCommand=function(self)
56+
self:finishtweening():settext(translated_info["EnteringOptions"])
57+
--for some reason, any tweens triggered by this command will get frozen after the first frame
58+
--unless you enter twice fast, that is
59+
--why? :shrug: Figure that out before putting a tween back in here -ulti_fd
60+
61+
--self:zoom(0.65):accelerate(0.2):zoom(0.55)
62+
end,
63+
HidePressStartForOptionsCommand=function(self)
64+
-- do we even need this? AllowOptionsMenu() always returns true
65+
-- we may as well hard code it in the c++ if we're gonna do that tbh
66+
self:decelerate(0.15):diffusealpha(0)
67+
end
68+
}
69+
70+
71+
return t

0 commit comments

Comments
 (0)