@@ -3,12 +3,12 @@ local pdh = 48 * tzoom
3
3
local ygap = 2
4
4
local packspaceY = pdh + ygap
5
5
6
- local numgoals = 12
6
+ local numscores = 12
7
7
local ind = 0
8
8
local offx = 5
9
9
local width = SCREEN_WIDTH * 0.56
10
10
local dwidth = width - offx * 2
11
- local height = (numgoals + 2 ) * packspaceY
11
+ local height = (numscores + 2 ) * packspaceY
12
12
13
13
local adjx = 14
14
14
local c0x = 10
@@ -21,6 +21,7 @@ local headeroff = packspaceY/1.5
21
21
local row2yoff = 1
22
22
local moving
23
23
local cheese
24
+ local collapsed = false
24
25
25
26
-- will eat any mousewheel inputs to scroll pages while mouse is over the background frame
26
27
local function input (event )
@@ -66,7 +67,6 @@ local o = Def.ActorFrame{
66
67
Name = " GoalDisplay" ,
67
68
InitCommand = function (self )
68
69
cheese = self
69
- self :xy (0 ,0 )
70
70
self :SetUpdateFunction (highlight )
71
71
end ,
72
72
BeginCommand = function (self )
@@ -83,35 +83,94 @@ local o = Def.ActorFrame{
83
83
end ,
84
84
UpdateCommand = function (self )
85
85
if ind == # scoretable then
86
- ind = ind - numgoals
87
- elseif ind > # scoretable - (# scoretable % numgoals ) then
88
- ind = # scoretable - (# scoretable % numgoals )
86
+ ind = ind - numscores
87
+ elseif ind > # scoretable - (# scoretable % numscores ) then
88
+ ind = # scoretable - (# scoretable % numscores )
89
89
end
90
90
if ind < 0 then
91
91
ind = 0
92
92
end
93
93
end ,
94
- DFRFinishedMessageCommand = function (self )
95
- GetPlayerOrMachineProfile (PLAYER_1 ):SetFromAll ()
96
- self :queuecommand (" GoalTableRefresh" )
97
- end ,
98
94
NextPageCommand = function (self )
99
- ind = ind + numgoals
95
+ ind = ind + numscores
100
96
self :queuecommand (" Update" )
101
97
end ,
102
98
PrevPageCommand = function (self )
103
- ind = ind - numgoals
99
+ ind = ind - numscores
104
100
self :queuecommand (" Update" )
105
101
end ,
106
- WheeDoooMessageCommand = function (self )
107
- self :queuecommand (" NextPage" )
102
+ CollapseCommand = function (self )
103
+ tzoom = 0.5 * 0.75
104
+ pdh = 38 * tzoom
105
+ ygap = 2
106
+ packspaceY = pdh + ygap
107
+
108
+ numscores = 10
109
+ ind = 0
110
+ offx = 5
111
+ width = math.max (SCREEN_WIDTH * 0.25 ,240 )
112
+ dwidth = width - offx * 2
113
+ height = (numscores + 2 ) * packspaceY
114
+
115
+ adjx = 14
116
+ c0x = 10
117
+ c1x = 10 + c0x
118
+ c2x = c1x + (tzoom * 7 * adjx )
119
+ c5x = dwidth
120
+ c4x = c5x - adjx - (tzoom * 3 * adjx )
121
+ c3x = c4x - adjx - (tzoom * 10 * adjx )
122
+ headeroff = packspaceY / 1.5
123
+ row2yoff = 1
124
+ collapsed = true
125
+ self :diffusealpha (0.8 )
126
+ self :queuecommand (" Init" )
127
+ end ,
128
+ ExpandCommand = function (self )
129
+ tzoom = 0.5
130
+ pdh = 48 * tzoom
131
+ ygap = 2
132
+ packspaceY = pdh + ygap
133
+
134
+ numscores = 12
135
+ ind = 0
136
+ offx = 5
137
+ width = SCREEN_WIDTH * 0.56
138
+ dwidth = width - offx * 2
139
+ height = (numscores + 2 ) * packspaceY
140
+
141
+ adjx = 14
142
+ c0x = 10
143
+ c1x = 20 + c0x
144
+ c2x = c1x + (tzoom * 7 * adjx ) -- guesswork adjustment for epxected text length
145
+ c5x = dwidth -- right aligned cols
146
+ c4x = c5x - adjx - (tzoom * 3 * adjx ) -- right aligned cols
147
+ c3x = c4x - adjx - (tzoom * 10 * adjx ) -- right aligned cols
148
+ headeroff = packspaceY / 1.5
149
+ row2yoff = 1
150
+ collapsed = false
151
+ self :diffusealpha (1 )
152
+ self :queuecommand (" Init" )
108
153
end ,
109
154
110
155
Def .Quad {
111
- Name = " FrameDisplay" ,
112
- InitCommand = function (self )
113
- self :zoomto (width ,height - headeroff ):halign (0 ):valign (0 ):diffuse (color (" #333333" ))
114
- end
156
+ Name = " FrameDisplay" ,
157
+ InitCommand = function (self )
158
+ self :zoomto (width ,height - headeroff ):halign (0 ):valign (0 ):diffuse (color (" #333333" ))
159
+ end ,
160
+ HighlightCommand = function (self )
161
+ if isOver (self ) and collapsed then
162
+ self :diffusealpha (1 )
163
+ else
164
+ self :diffusealpha (0.8 )
165
+ end
166
+ end ,
167
+ MouseRightClickMessageCommand = function (self )
168
+ if isOver (self ) and not collapsed then
169
+ self :GetParent ():GetParent ():queuecommand (" Collapse" )
170
+ elseif isOver (self ) then
171
+ self :GetParent ():GetParent ():queuecommand (" Expand" )
172
+ end
173
+ end ,
115
174
},
116
175
117
176
-- headers
@@ -120,14 +179,6 @@ local o = Def.ActorFrame{
120
179
self :xy (offx , headeroff ):zoomto (dwidth ,pdh ):halign (0 ):diffuse (color (" #111111" ))
121
180
end ,
122
181
},
123
- LoadFont (" Common normal" ) .. { -- index
124
- InitCommand = function (self )
125
- self :xy (width / 2 , headeroff ):zoom (tzoom ):halign (0.5 )
126
- end ,
127
- UpdateCommand = function (self )
128
- self :settextf (" %i-%i" , ind + 1 , ind + numgoals )
129
- end ,
130
- },
131
182
132
183
LoadFont (" Common normal" ) .. { -- current rate toggle
133
184
InitCommand = function (self )
@@ -158,10 +209,13 @@ local function makeGoalDisplay(i)
158
209
local o = Def .ActorFrame {
159
210
InitCommand = function (self )
160
211
self :y (packspaceY * i + headeroff )
212
+ if i > numscores then
213
+ self :visible (false )
214
+ end
161
215
end ,
162
216
UpdateCommand = function (self )
163
217
hs = scoretable [(i + ind )]
164
- if hs then
218
+ if hs and i <= numscores then
165
219
self :queuecommand (" Display" )
166
220
self :visible (true )
167
221
else
@@ -175,12 +229,22 @@ local function makeGoalDisplay(i)
175
229
end ,
176
230
DisplayCommand = function (self )
177
231
self :diffuse (color (" #111111CC" ))
178
- end
232
+ end ,
233
+ HighlightCommand = function (self )
234
+ if isOver (self ) and collapsed then
235
+ self :diffusealpha (1 )
236
+ else
237
+ self :diffusealpha (0.6 )
238
+ end
239
+ end ,
179
240
},
180
241
181
242
LoadFont (" Common normal" ) .. { -- rank
182
243
InitCommand = function (self )
183
244
self :x (c0x ):zoom (tzoom ):halign (0 ):valign (0 )
245
+ if collapsed then
246
+ self :x (c0x ):zoom (tzoom ):halign (0 ):valign (0.5 )
247
+ end
184
248
end ,
185
249
DisplayCommand = function (self )
186
250
self :settextf (" %i." , i + ind )
@@ -190,27 +254,38 @@ local function makeGoalDisplay(i)
190
254
LoadFont (" Common normal" ) .. { -- ssr
191
255
InitCommand = function (self )
192
256
self :x (c2x - c1x + offx ):zoom (tzoom + 0.05 ):halign (0.5 ):valign (1 )
257
+ if collapsed then
258
+ self :x (46 ):zoom (tzoom + 0.15 ):halign (0.5 ):valign (0.5 ):maxwidth (20 / tzoom )
259
+ end
193
260
end ,
194
261
DisplayCommand = function (self )
195
262
local ssr = hs :GetSkillsetSSR (" Overall" )
196
263
self :settextf (" %.2f" ,ssr ):diffuse (byMSD (ssr ))
197
264
end ,
198
265
},
199
266
200
-
201
267
LoadFont (" Common normal" ) .. { -- rate
202
268
InitCommand = function (self )
203
269
self :x (c2x - c1x + offx ):zoom (tzoom - 0.05 ):halign (0.5 ):valign (0 ):addy (row2yoff )
270
+ if collapsed then
271
+ self :x (c4x - 14 ):zoom (tzoom ):halign (1 ):valign (0.5 ):addy (- row2yoff ):maxwidth (30 / tzoom )
272
+ end
204
273
end ,
205
274
DisplayCommand = function (self )
206
275
local ratestring = string.format (" %.2f" , hs :GetMusicRate ()):gsub (" %.?0$" , " " ).. " x"
207
276
self :settext (ratestring )
208
277
end ,
278
+ ExpandCommand = function (self )
279
+ self :addy (- row2yoff )
280
+ end ,
209
281
},
210
282
211
283
LoadFont (" Common normal" ) .. { -- name
212
284
InitCommand = function (self )
213
285
self :x (c2x ):zoom (tzoom + 0.1 ):maxwidth ((c3x - c2x - capWideScale (10 ,40 ))/ tzoom ):halign (0 ):valign (1 )
286
+ if collapsed then
287
+ self :x (c2x + 10 ):maxwidth (60 / tzoom ):zoom (tzoom + 0.2 ):valign (0.5 )
288
+ end
214
289
end ,
215
290
DisplayCommand = function (self )
216
291
self :settext (hs :GetDisplayName ())
@@ -228,12 +303,14 @@ local function makeGoalDisplay(i)
228
303
local urlstringyo = " https://etternaonline.com/user/" .. hs :GetUserid ()
229
304
GAMESTATE :ApplyGameCommand (" urlnoexit," .. urlstringyo )
230
305
end
231
- end
306
+ end ,
232
307
},
233
308
234
309
LoadFont (" Common normal" ) .. { -- judgments
235
310
InitCommand = function (self )
236
- self :x (c2x ):zoom (tzoom - 0.05 ):halign (0 ):valign (0 ):maxwidth (width / 2 / tzoom ):addy (row2yoff )
311
+ if not collapsed then
312
+ self :x (c2x ):zoom (tzoom - 0.05 ):halign (0 ):valign (0 ):maxwidth (width / 2 / tzoom ):addy (row2yoff )
313
+ end
237
314
end ,
238
315
DisplayCommand = function (self )
239
316
self :settext (hs :GetJudgmentString ())
@@ -251,12 +328,21 @@ local function makeGoalDisplay(i)
251
328
local urlstringyo = " https://etternaonline.com/score/view/" .. hs :GetScoreid ().. hs :GetUserid ()
252
329
GAMESTATE :ApplyGameCommand (" urlnoexit," .. urlstringyo )
253
330
end
254
- end
331
+ end ,
332
+ CollapseCommand = function (self )
333
+ self :visible (false )
334
+ end ,
335
+ ExpandCommand = function (self )
336
+ self :visible (true ):addy (- row2yoff )
337
+ end ,
255
338
},
256
339
257
340
LoadFont (" Common normal" ) .. { -- percent
258
341
InitCommand = function (self )
259
342
self :x (c5x ):zoom (tzoom + 0.15 ):halign (1 ):valign (1 )
343
+ if collapsed then
344
+ self :x (c5x ):zoom (tzoom + 0.15 ):halign (1 ):valign (0.5 ):maxwidth (30 / tzoom )
345
+ end
260
346
end ,
261
347
DisplayCommand = function (self )
262
348
self :settextf (" %05.2f%%" , hs :GetWifeScore ()* 10000 / 100 ):diffuse (byGrade (hs :GetWifeGrade ()))
@@ -265,17 +351,25 @@ local function makeGoalDisplay(i)
265
351
266
352
LoadFont (" Common normal" ) .. { -- date
267
353
InitCommand = function (self )
268
- self :x (c5x ):zoom (tzoom - 0.05 ):halign (1 ):valign (0 ):maxwidth (width / 4 / tzoom ):addy (row2yoff )
354
+ if not collapsed then
355
+ self :x (c5x ):zoom (tzoom - 0.05 ):halign (1 ):valign (0 ):maxwidth (width / 4 / tzoom ):addy (row2yoff )
356
+ end
269
357
end ,
270
358
DisplayCommand = function (self )
271
359
self :settext (hs :GetDate ())
272
360
end ,
361
+ CollapseCommand = function (self )
362
+ self :visible (false )
363
+ end ,
364
+ ExpandCommand = function (self )
365
+ self :visible (true ):addy (- row2yoff )
366
+ end ,
273
367
},
274
368
}
275
369
return o
276
370
end
277
371
278
- for i = 1 ,numgoals do
372
+ for i = 1 ,numscores do
279
373
o [# o + 1 ] = makeGoalDisplay (i )
280
374
end
281
375
0 commit comments