From 206ee3e8a0f1ef7359721636072237664c48aa26 Mon Sep 17 00:00:00 2001 From: MinaciousGrace Date: Fri, 28 Apr 2017 15:15:59 -0400 Subject: [PATCH] set the chartkey for scoregoals as they're being handed to lua and give lua access to it --- src/Profile.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Profile.cpp b/src/Profile.cpp index f363932b25..86a95d1ecc 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -3718,6 +3718,7 @@ class LunaProfile : public Luna auto &sgv = i->second; FOREACH(ScoreGoal, sgv, sg) { ScoreGoal &tsg = *sg; + tsg.chartkey = ck; tsg.PushSelf(L); lua_rawseti(L, -2, idx + 1); idx++; @@ -3821,8 +3822,9 @@ class LunaScoreGoal : public Luna DEFINE_METHOD( GetPriority, priority ); DEFINE_METHOD( IsAchieved, achieved ); DEFINE_METHOD( GetComment, comment ); + DEFINE_METHOD( GetChartKey, chartkey); DEFINE_METHOD( WhenAssigned, timeassigned.GetString() ); - + static int WhenAchieved(T* p, lua_State *L) { if (p->achieved) lua_pushstring(L, p->timeachieved.GetString()); @@ -3846,6 +3848,7 @@ class LunaScoreGoal : public Luna ADD_METHOD( GetComment ); ADD_METHOD( WhenAssigned ); ADD_METHOD( WhenAchieved ); + ADD_METHOD( GetChartKey ); } }; LUA_REGISTER_CLASS(ScoreGoal)