Skip to content

Commit d7c17dc

Browse files
add lua/internal functions for checking if replaydata exists
1 parent 8936fcf commit d7c17dc

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/HighScore.cpp

+12-3
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,7 @@ bool HighScoreImpl::WriteReplayData(bool duringload) {
521521
return true;
522522
}
523523

524+
// should just get rid of impl -mina
524525
bool HighScore::LoadReplayData(bool duringload) {
525526
// already exists
526527
if (m_Impl->vNoteRowVector.size() > 4 && m_Impl->vOffsetVector.size() > 4)
@@ -578,6 +579,12 @@ bool HighScore::LoadReplayData(bool duringload) {
578579
return true;
579580
}
580581

582+
bool HighScore::HasReplayData() {
583+
RString profiledir = PROFILEMAN->GetProfileDir(ProfileSlot_Player1).substr(1);
584+
RString path = profiledir + "ReplayData/" + m_Impl->ScoreKey;
585+
return DoesFileExist(path);
586+
}
587+
581588
REGISTER_CLASS_TRAITS( HighScoreImpl, new HighScoreImpl(*pCopy) )
582589

583590
HighScore::HighScore()
@@ -1140,12 +1147,13 @@ class LunaHighScore: public Luna<HighScore>
11401147
}
11411148

11421149
DEFINE_METHOD( GetGrade, GetGrade() )
1143-
DEFINE_METHOD( GetWifeGrade, GetWifeGrade())
1144-
DEFINE_METHOD( ConvertDpToWife, ConvertDpToWife())
1150+
DEFINE_METHOD( GetWifeGrade, GetWifeGrade() )
1151+
DEFINE_METHOD( ConvertDpToWife, ConvertDpToWife() )
11451152
DEFINE_METHOD( GetStageAward, GetStageAward() )
11461153
DEFINE_METHOD( GetPeakComboAward, GetPeakComboAward() )
11471154
DEFINE_METHOD( GetChordCohesion, GetChordCohesion() )
1148-
DEFINE_METHOD( GetEtternaValid , GetEtternaValid())
1155+
DEFINE_METHOD( GetEtternaValid , GetEtternaValid() )
1156+
DEFINE_METHOD( HasReplayData, HasReplayData() )
11491157
LunaHighScore()
11501158
{
11511159
ADD_METHOD( GetName );
@@ -1174,6 +1182,7 @@ class LunaHighScore: public Luna<HighScore>
11741182
ADD_METHOD( GetPeakComboAward );
11751183
ADD_METHOD( ToggleEtternaValidation );
11761184
ADD_METHOD( GetEtternaValid );
1185+
ADD_METHOD( HasReplayData );
11771186
ADD_METHOD( GetOffsetVector );
11781187
ADD_METHOD( GetNoteRowVector );
11791188
}

src/HighScore.h

+1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ struct HighScore
126126

127127
bool WriteReplayData(bool duringload);
128128
bool LoadReplayData(bool duringload);
129+
bool HasReplayData();
129130
void UnloadReplayData();
130131

131132
RString GetDisplayName() const;

0 commit comments

Comments
 (0)