Skip to content

Commit

Permalink
add lua/internal functions for checking if replaydata exists
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed May 1, 2017
1 parent 8936fcf commit d7c17dc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/HighScore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ bool HighScoreImpl::WriteReplayData(bool duringload) {
return true;
}

// should just get rid of impl -mina
bool HighScore::LoadReplayData(bool duringload) {
// already exists
if (m_Impl->vNoteRowVector.size() > 4 && m_Impl->vOffsetVector.size() > 4)
Expand Down Expand Up @@ -578,6 +579,12 @@ bool HighScore::LoadReplayData(bool duringload) {
return true;
}

bool HighScore::HasReplayData() {
RString profiledir = PROFILEMAN->GetProfileDir(ProfileSlot_Player1).substr(1);
RString path = profiledir + "ReplayData/" + m_Impl->ScoreKey;
return DoesFileExist(path);
}

REGISTER_CLASS_TRAITS( HighScoreImpl, new HighScoreImpl(*pCopy) )

HighScore::HighScore()
Expand Down Expand Up @@ -1140,12 +1147,13 @@ class LunaHighScore: public Luna<HighScore>
}

DEFINE_METHOD( GetGrade, GetGrade() )
DEFINE_METHOD( GetWifeGrade, GetWifeGrade())
DEFINE_METHOD( ConvertDpToWife, ConvertDpToWife())
DEFINE_METHOD( GetWifeGrade, GetWifeGrade() )
DEFINE_METHOD( ConvertDpToWife, ConvertDpToWife() )
DEFINE_METHOD( GetStageAward, GetStageAward() )
DEFINE_METHOD( GetPeakComboAward, GetPeakComboAward() )
DEFINE_METHOD( GetChordCohesion, GetChordCohesion() )
DEFINE_METHOD( GetEtternaValid , GetEtternaValid())
DEFINE_METHOD( GetEtternaValid , GetEtternaValid() )
DEFINE_METHOD( HasReplayData, HasReplayData() )
LunaHighScore()
{
ADD_METHOD( GetName );
Expand Down Expand Up @@ -1174,6 +1182,7 @@ class LunaHighScore: public Luna<HighScore>
ADD_METHOD( GetPeakComboAward );
ADD_METHOD( ToggleEtternaValidation );
ADD_METHOD( GetEtternaValid );
ADD_METHOD( HasReplayData );
ADD_METHOD( GetOffsetVector );
ADD_METHOD( GetNoteRowVector );
}
Expand Down
1 change: 1 addition & 0 deletions src/HighScore.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ struct HighScore

bool WriteReplayData(bool duringload);
bool LoadReplayData(bool duringload);
bool HasReplayData();
void UnloadReplayData();

RString GetDisplayName() const;
Expand Down

0 comments on commit d7c17dc

Please sign in to comment.