1
1
local update = false
2
2
local showOnline = false
3
+ local recentactive = false
3
4
local function BroadcastIfActive (msg )
4
5
if update then
5
6
MESSAGEMAN :Broadcast (msg )
@@ -131,7 +132,7 @@ local function rankingLabel(i)
131
132
self :visible (false )
132
133
end ,
133
134
UpdateRankingMessageCommand = function (self )
134
- if rankingSkillset > 1 and update then
135
+ if rankingSkillset > 1 and update and not recentactive then
135
136
if not showOnline then
136
137
ths = SCOREMAN :GetTopSSRHighScoreForGame (i + (scoresperpage * (rankingPage - 1 )), ms .SkillSets [rankingSkillset ])
137
138
if ths then
@@ -366,14 +367,15 @@ local function rankingButton(i)
366
367
self :zoomto (rankingTitleSpacing , 30 ):diffuse (getMainColor (" frames" )):diffusealpha (0.35 )
367
368
end ,
368
369
SetCommand = function (self )
369
- if i == rankingSkillset then
370
+ if i == rankingSkillset and not recentactive then
370
371
self :diffusealpha (1 )
371
372
else
372
373
self :diffusealpha (0.35 )
373
374
end
374
375
end ,
375
376
MouseLeftClickMessageCommand = function (self )
376
377
if ButtonActive (self ) then
378
+ recentactive = false
377
379
rankingSkillset = i
378
380
rankingPage = 1
379
381
SCOREMAN :SortSSRsForGame (ms .SkillSets [rankingSkillset ])
@@ -397,6 +399,222 @@ local function rankingButton(i)
397
399
return t
398
400
end
399
401
402
+
403
+ local function recentLabel (i )
404
+ local ths -- aAAAAAAAA
405
+ local ck
406
+ local thssteps
407
+ local thssong
408
+ local xoffset
409
+ local onlineScore
410
+
411
+ local t =
412
+ Def .ActorFrame {
413
+ InitCommand = function (self )
414
+ self :xy (rankingX - 38 , rankingY + offsetY + 10 + (i - 1 ) * scoreYspacing )
415
+ self :visible (false )
416
+ end ,
417
+ UpdateRankingMessageCommand = function (self )
418
+ if recentactive and update then
419
+ ths = SCOREMAN :GetRecentScoreForGame (i + (scoresperpage * (rankingPage - 1 )))
420
+ if ths then
421
+ self :visible (true )
422
+ ck = ths :GetChartKey ()
423
+ thssong = SONGMAN :GetSongByChartKey (ck )
424
+ thssteps = SONGMAN :GetStepsByChartKey (ck )
425
+ MESSAGEMAN :Broadcast (" DisplayProfileRankingLabels" )
426
+ else
427
+ self :visible (false )
428
+ end
429
+ else
430
+ onlinesScore = nil
431
+ self :visible (false )
432
+ end
433
+ end ,
434
+ LoadFont (" Common Large" ) ..
435
+ {
436
+ InitCommand = function (self )
437
+ self :halign (0 ):zoom (fontScale )
438
+ self :maxwidth (100 )
439
+ end ,
440
+ DisplayProfileRankingLabelsMessageCommand = function (self )
441
+ if ths then
442
+ self :halign (0.5 )
443
+ self :settext (((rankingPage - 1 ) * 25 ) + i .. " ." )
444
+ self :diffuse (byValidity (ths :GetEtternaValid ()))
445
+ end
446
+ end
447
+ },
448
+ LoadFont (" Common Large" ) ..
449
+ {
450
+ InitCommand = function (self )
451
+ self :halign (0 ):zoom (fontScale )
452
+ self :x (15 ):maxwidth (160 )
453
+ end ,
454
+ DisplayProfileRankingLabelsMessageCommand = function (self )
455
+ if ths then
456
+ self :settextf (" %5.2f" , ths :GetSkillsetSSR (ms .SkillSets [1 ]))
457
+ self :diffuse (byValidity (ths :GetEtternaValid ()))
458
+ else
459
+ self :settext (" " )
460
+ end
461
+ end
462
+ },
463
+ LoadFont (" Common Large" ) ..
464
+ {
465
+ InitCommand = function (self )
466
+ self :halign (0 ):zoom (fontScale )
467
+ self :x (55 ):maxwidth (580 )
468
+ end ,
469
+ DisplayProfileRankingLabelsMessageCommand = function (self )
470
+
471
+ if thssong then
472
+ self :settext (thssong :GetDisplayMainTitle ())
473
+ self :diffuse (byValidity (ths :GetEtternaValid ()))
474
+ else
475
+ self :settext (" " )
476
+ end
477
+
478
+
479
+ end
480
+ },
481
+ LoadFont (" Common Large" ) ..
482
+ {
483
+ InitCommand = function (self )
484
+ self :halign (0 ):zoom (fontScale )
485
+ self :x (220 )
486
+ end ,
487
+ DisplayProfileRankingLabelsMessageCommand = function (self )
488
+
489
+ if ths then
490
+ self :halign (0.5 )
491
+ local ratestring = string.format (" %.2f" , ths :GetMusicRate ()):gsub (" %.?0+$" , " " ) .. " x"
492
+ self :settext (ratestring )
493
+ self :diffuse (byValidity (ths :GetEtternaValid ()))
494
+ else
495
+ self :settext (" " )
496
+ end
497
+ end
498
+ },
499
+ LoadFont (" Common Large" ) ..
500
+ {
501
+ InitCommand = function (self )
502
+ self :halign (0 ):zoom (fontScale )
503
+ self :x (240 ):maxwidth (160 )
504
+ end ,
505
+ DisplayProfileRankingLabelsMessageCommand = function (self )
506
+
507
+ if ths then
508
+ self :settextf (" %5.2f%%" , ths :GetWifeScore () * 100 )
509
+ if not ths :GetEtternaValid () then
510
+ self :diffuse (byJudgment (" TapNoteScore_Miss" ))
511
+ else
512
+ self :diffuse (getGradeColor (ths :GetWifeGrade ()))
513
+ end
514
+ else
515
+ self :settext (" " )
516
+ end
517
+
518
+ end
519
+ },
520
+ LoadFont (" Common Large" ) ..
521
+ {
522
+ InitCommand = function (self )
523
+ self :halign (0 ):zoom (fontScale )
524
+ self :x (300 )
525
+ end ,
526
+ DisplayProfileRankingLabelsMessageCommand = function (self )
527
+ self :halign (0.5 )
528
+ if thssteps then
529
+ local diff = thssteps :GetDifficulty ()
530
+ self :diffuse (byDifficulty (diff ))
531
+ self :settext (getShortDifficulty (diff ))
532
+ else
533
+ self :settext (" " )
534
+ end
535
+ end
536
+ },
537
+ Def .Quad {
538
+ InitCommand = function (self )
539
+ self :halign (0 ):zoom (fontScale )
540
+ self :diffusealpha (buttondiffuse )
541
+ end ,
542
+ DisplayProfileRankingLabelsMessageCommand = function (self ) -- hacky
543
+ self :visible (true )
544
+ self :zoomto (300 , scoreYspacing )
545
+ end ,
546
+ MouseLeftClickMessageCommand = function (self )
547
+ if recentactive and ButtonActive (self ) then
548
+ if ths then
549
+ local srate = ths :GetMusicRate ()
550
+ whee :SelectSong (thssong )
551
+ GAMESTATE :GetSongOptionsObject (" ModsLevel_Preferred" ):MusicRate (srate )
552
+ GAMESTATE :GetSongOptionsObject (" ModsLevel_Song" ):MusicRate (srate )
553
+ GAMESTATE :GetSongOptionsObject (" ModsLevel_Current" ):MusicRate (srate )
554
+ end
555
+ end
556
+ end
557
+ },
558
+ LoadFont (" Common Normal" ) ..
559
+ {
560
+ -- date
561
+ InitCommand = function (self )
562
+ self :x (310 ):zoom (fontScale + 0.05 ):halign (0 )
563
+ end ,
564
+ DisplayProfileRankingLabelsMessageCommand = function (self )
565
+ if ths then
566
+ self :settext (ths :GetDate ())
567
+ else
568
+ self :settext (" " )
569
+ end
570
+ end ,
571
+ },
572
+ }
573
+ return t
574
+ end
575
+
576
+ local function recentButton ()
577
+ local t =
578
+ Def .ActorFrame {
579
+ InitCommand = function (self )
580
+ self :xy (rankingX + (3.5 ) * rankingTitleSpacing , offsetY * 0.65 ):valign (1 )
581
+ end ,
582
+ Def .Quad {
583
+ InitCommand = function (self )
584
+ self :zoomto (rankingTitleSpacing , 30 ):diffuse (getMainColor (" frames" )):diffusealpha (0.35 )
585
+ end ,
586
+ SetCommand = function (self )
587
+ if recentactive then
588
+ self :diffusealpha (1 )
589
+ else
590
+ self :diffusealpha (0.35 )
591
+ end
592
+ end ,
593
+ MouseLeftClickMessageCommand = function (self )
594
+ if ButtonActive (self ) then
595
+ recentactive = true
596
+ rankingPage = 1
597
+ SCOREMAN :SortRecentScoresForGame ()
598
+ BroadcastIfActive (" UpdateRanking" )
599
+ end
600
+ end ,
601
+ UpdateRankingMessageCommand = function (self )
602
+ self :queuecommand (" Set" )
603
+ end
604
+ },
605
+ LoadFont (" Common Large" ) ..
606
+ {
607
+ InitCommand = function (self )
608
+ self :diffuse (getMainColor (" positive" )):maxwidth (rankingTitleSpacing ):maxheight (25 ):zoom (0.85 )
609
+ end ,
610
+ BeginCommand = function (self )
611
+ self :settext (" recent" )
612
+ end
613
+ }
614
+ }
615
+ return t
616
+ end
617
+
400
618
t [# t + 1 ] =
401
619
Def .ActorFrame {
402
620
InitCommand = function (self )
@@ -509,7 +727,7 @@ r[#r + 1] =
509
727
self :xy (10 , frameHeight - offsetY ):visible (false )
510
728
end ,
511
729
UpdateRankingMessageCommand = function (self )
512
- if rankingSkillset > 1 and not showOnline then
730
+ if ( rankingSkillset > 1 or recentactive ) and not showOnline then
513
731
self :visible (true )
514
732
if not self and self .GetChildren then
515
733
for child in self :GetChildren () do
@@ -577,20 +795,26 @@ for i = 1, scoresperpage do
577
795
r [# r + 1 ] = rankingLabel (i )
578
796
end
579
797
798
+ for i = 1 , scoresperpage do
799
+ r [# r + 1 ] = recentLabel (i )
800
+ end
801
+
580
802
-- Technically the "overall" skillset is used for single value display during music select/eval and isn't factored in to the profile rating
581
803
-- Only the specific skillsets are, and so overall should be used to display the specific skillset breakdowns separately - mina
582
804
for i = 1 , # ms .SkillSets do
583
805
r [# r + 1 ] = rankingButton (i )
584
806
end
585
807
808
+ r [# r + 1 ] = recentButton ()
809
+
586
810
local function littlebits (i )
587
811
local t =
588
812
Def .ActorFrame {
589
813
InitCommand = function (self )
590
814
self :xy (frameX + 30 , frameY + 50 )
591
815
end ,
592
816
UpdateRankingMessageCommand = function (self )
593
- if rankingSkillset == 1 and update then
817
+ if rankingSkillset == 1 and update and not recentactive then
594
818
self :visible (true )
595
819
else
596
820
self :visible (false )
@@ -693,7 +917,7 @@ local profilebuttons =
693
917
end
694
918
end ,
695
919
UpdateRankingMessageCommand = function (self )
696
- if rankingSkillset == 1 and update then
920
+ if rankingSkillset == 1 and update and not recentactive then
697
921
self :visible (true )
698
922
else
699
923
self :visible (false )
@@ -710,7 +934,7 @@ local profilebuttons =
710
934
self :zoomto (100 , 20 ):diffusealpha (buttondiffuse )
711
935
end ,
712
936
MouseLeftClickMessageCommand = function (self )
713
- if ButtonActive (self ) and rankingSkillset == 1 then
937
+ if ButtonActive (self ) and rankingSkillset == 1 and not recentactive then
714
938
if PROFILEMAN :SaveProfile (PLAYER_1 ) then
715
939
ms .ok (translated_info [" Success" ])
716
940
STATSMAN :UpdatePlayerRating ()
@@ -731,7 +955,7 @@ local profilebuttons =
731
955
self :x (100 ):zoomto (100 , 20 ):diffusealpha (buttondiffuse )
732
956
end ,
733
957
MouseLeftClickMessageCommand = function (self )
734
- if ButtonActive (self ) and rankingSkillset == 1 then
958
+ if ButtonActive (self ) and rankingSkillset == 1 and not recentactive then
735
959
SCREENMAN :SetNewScreen (" ScreenAssetSettings" )
736
960
end
737
961
end
@@ -747,7 +971,7 @@ local profilebuttons =
747
971
self :x (200 ):zoomto (100 , 20 ):diffusealpha (buttondiffuse )
748
972
end ,
749
973
MouseLeftClickMessageCommand = function (self )
750
- if ButtonActive (self ) and rankingSkillset == 1 then
974
+ if ButtonActive (self ) and rankingSkillset == 1 and not recentactive then
751
975
profile :UnInvalidateAllScores ()
752
976
STATSMAN :UpdatePlayerRating ()
753
977
end
@@ -764,7 +988,7 @@ local profilebuttons =
764
988
self :x (300 ):zoomto (100 , 20 ):diffusealpha (buttondiffuse )
765
989
end ,
766
990
MouseLeftClickMessageCommand = function (self )
767
- if ButtonActive (self ) and rankingSkillset == 1 then
991
+ if ButtonActive (self ) and rankingSkillset == 1 and not recentactive then
768
992
ms .ok (" Recalculating Scores... this might be slow and may or may not crash" )
769
993
profile :ForceRecalcScores ()
770
994
end
0 commit comments