@@ -25,6 +25,11 @@ local function highlight(self)
25
25
self :GetChild (" refreshbutton" ):queuecommand (" Highlight" )
26
26
end
27
27
28
+ local function highlight2 (self )
29
+ self :GetChild (" refreshbutton" ):queuecommand (" Highlight" )
30
+ self :GetChild (" loginlogout" ):queuecommand (" Highlight" )
31
+ end
32
+
28
33
local function highlightIfOver (self )
29
34
if isOver (self ) then
30
35
self :diffusealpha (0.6 )
@@ -109,8 +114,9 @@ t[#t + 1] =
109
114
},
110
115
LoadFont (" Common Normal" ) ..
111
116
{
117
+ Name = " loginlogout" ,
112
118
InitCommand = function (self )
113
- self :xy (SCREEN_CENTER_X , AvatarY + 20 ):halign (0.5 ):zoom (0.5 ):diffuse (getMainColor (" positive" ))
119
+ self :xy (SCREEN_CENTER_X , AvatarY + 26 ):halign (0.5 ):zoom (0.5 ):diffuse (getMainColor (" positive" ))
114
120
end ,
115
121
BeginCommand = function (self )
116
122
self :queuecommand (" Set" )
@@ -126,29 +132,74 @@ t[#t + 1] =
126
132
if SCREENMAN :GetTopScreen ():GetName () == " ScreenSelectMusic" then
127
133
self :settext (" Click to login" )
128
134
else
129
- self :settextf (" Not logged in" )
135
+ self :settext (" Not logged in" )
136
+ end
137
+ end ,
138
+ LoginMessageCommand = function (self ) -- this seems a little clunky -mina
139
+ if SCREENMAN :GetTopScreen () and SCREENMAN :GetTopScreen ():GetName () == " ScreenSelectMusic" then
140
+ self :settextf (
141
+ " %s" ,
142
+ " Click to Logout"
143
+ )
144
+ else
145
+ self :settextf (" " )
146
+ end
147
+ end ,
148
+ OnlineUpdateMessageCommand = function (self )
149
+ self :queuecommand (" Set" )
150
+ end ,
151
+ HighlightCommand = function (self )
152
+ highlightIfOver (self )
153
+ end
154
+ },
155
+ LoadFont (" Common Normal" ) ..
156
+ {
157
+ InitCommand = function (self )
158
+ self :xy (SCREEN_CENTER_X , AvatarY + 20 ):halign (0.5 ):zoom (0.5 ):diffuse (getMainColor (" positive" ))
159
+ end ,
160
+ BeginCommand = function (self )
161
+ self :queuecommand (" Set" )
162
+ end ,
163
+ SetCommand = function (self )
164
+ if DLMAN :IsLoggedIn () then
165
+ self :queuecommand (" Login" )
166
+ else
167
+ self :queuecommand (" LogOut" )
168
+ end
169
+ end ,
170
+ LogOutMessageCommand = function (self )
171
+ if SCREENMAN :GetTopScreen ():GetName () == " ScreenSelectMusic" then
172
+ self :settextf (" " )
173
+ self :GetParent ():SetUpdateFunction (highlight2 )
174
+ else
175
+ self :settextf (" " )
176
+ self :GetParent ():SetUpdateFunction (highlight )
130
177
end
131
178
end ,
132
179
LoginMessageCommand = function (self ) -- this seems a little clunky -mina
133
180
if SCREENMAN :GetTopScreen () and SCREENMAN :GetTopScreen ():GetName () == " ScreenSelectMusic" then
134
181
self :settextf (
135
- " Logged in as %s (%5.2f: #%i) \n %s " ,
182
+ " Logged in as %s (%5.2f: #%i) \n " ,
136
183
DLMAN :GetUsername (),
137
184
DLMAN :GetSkillsetRating (" Overall" ),
138
- DLMAN :GetSkillsetRank (ms .SkillSets [1 ]),
139
- " Click to Logout"
185
+ DLMAN :GetSkillsetRank (ms .SkillSets [1 ])
140
186
)
187
+ self :GetParent ():SetUpdateFunction (highlight2 )
141
188
else
142
189
self :settextf (
143
190
" Logged in as %s (%5.2f: #%i)" ,
144
191
DLMAN :GetUsername (),
145
192
DLMAN :GetSkillsetRating (" Overall" ),
146
193
DLMAN :GetSkillsetRank (ms .SkillSets [1 ])
147
194
)
195
+ self :GetParent ():SetUpdateFunction (highlight )
148
196
end
149
197
end ,
150
198
OnlineUpdateMessageCommand = function (self )
151
199
self :queuecommand (" Set" )
200
+ end ,
201
+ HighlightCommand = function (self )
202
+ highlightIfOver (self )
152
203
end
153
204
},
154
205
Def .Quad {
0 commit comments