Skip to content

Commit 2008720

Browse files
use scoreman to grab the most recent score when hitting eval
1 parent 46c1b90 commit 2008720

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Themes/Til Death/BGAnimations/ScreenEvaluation decorations/default.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function scoreBoard(pn,position)
8787

8888
local judge = GetTimingDifficulty()
8989
local pss = STATSMAN:GetCurStageStats():GetPlayerStageStats(pn)
90-
local score = getScoreFromTable(getScoreList(PLAYER_1),pss:GetPersonalHighScoreIndex()+1)
90+
local score = SCOREMAN:GetMostRecentScore()
9191

9292
t[#t+1] = Def.Quad{InitCommand=cmd(xy,frameX-5,frameY;zoomto,frameWidth+10,220;halign,0;valign,0;diffuse,color("#333333CC"))};
9393
t[#t+1] = Def.Quad{InitCommand=cmd(xy,frameX,frameY+30;zoomto,frameWidth,2;halign,0;diffuse,getMainColor('highlight');diffusealpha,0.5)};

src/ScoreManager.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ class LunaScoreManager : public Luna<ScoreManager>
556556
return 1;
557557
}
558558

559-
static int GetTopSSRHighScore(T* p, lua_State *L) {
559+
static int GetTopSSRHighScore(T* p, lua_State *L) {
560560
HighScore* ths = p->GetTopSSRHighScore(IArg(1) - 1, Enum::Check<Skillset>(L, 2));
561561
if (ths)
562562
ths->PushSelf(L);
@@ -565,12 +565,20 @@ class LunaScoreManager : public Luna<ScoreManager>
565565
return 1;
566566
}
567567

568+
static int GetMostRecentScore(T* p, lua_State *L) {
569+
// this _should_ always be viable if only called from eval
570+
HighScore* last = p->GetMostRecentScore();
571+
last->PushSelf(L);
572+
return 1;
573+
}
574+
568575
LunaScoreManager()
569576
{
570577
ADD_METHOD(GetScoresByKey);
571578
ADD_METHOD(SortSSRs);
572579
ADD_METHOD(ValidateAllScores);
573580
ADD_METHOD(GetTopSSRHighScore);
581+
ADD_METHOD(GetMostRecentScore);
574582
}
575583
};
576584

src/ScoreManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class ScoreManager
122122
vector<string> GetSortedKeys();
123123

124124
void PushSelf(lua_State *L);
125-
125+
HighScore* GetMostRecentScore() { return AllScores.back(); }
126126
vector<HighScore*> GetAllScores() { return AllScores; }
127127
void RegisterScore(HighScore* hs) { AllScores.emplace_back(hs); }
128128
void AddToKeyedIndex(HighScore* hs) { ScoresByKey.emplace(hs->GetScoreKey(), hs); }

0 commit comments

Comments
 (0)