From 8c5793fd96f77aad56bb31d4e8966c8fe8eacba3 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Fri, 23 Dec 2011 13:39:28 -0600 Subject: [PATCH] [Game] Added CountNotesSeparately, GetMapJudgmentTo(TapNoteScore) Lua bindings. --- Docs/Changelog_sm5.txt | 2 ++ src/Game.cpp | 17 +++++++++++++++++ src/Game.h | 1 + 3 files changed, 20 insertions(+) diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 4661fb0254..dd889add2c 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -11,6 +11,8 @@ StepMania 5.0 $next | 20111xxx 2011/12/23 ---------- * [Song] Fixed a bug where a sample start of 0 wouldn't work. [AJ] +* [Game] Added CountNotesSeparately and GetMapJudgmentTo(TapNoteScore) + Lua bindings. [AJ] 2011/12/22 ---------- diff --git a/src/Game.cpp b/src/Game.cpp index e61074c47f..07aac354c4 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -39,6 +39,19 @@ const Game::PerButtonInfo *Game::GetPerButtonInfo( GameButton gb ) const return &m_PerButtonInfo[gb-GAME_BUTTON_NEXT]; } +TapNoteScore Game::GetMapJudgmentTo( TapNoteScore tns ) const +{ + switch(tns) + { + case TNS_W1: return m_mapW1To; + case TNS_W2: return m_mapW2To; + case TNS_W3: return m_mapW3To; + case TNS_W4: return m_mapW4To; + case TNS_W5: return m_mapW5To; + default: return TapNoteScore_Invalid; + } +} + // lua start #include "LuaBinding.h" @@ -47,10 +60,14 @@ class LunaGame: public Luna { public: static int GetName( T* p, lua_State *L ) { lua_pushstring( L, p->m_szName ); return 1; } + static int CountNotesSeparately( T* p, lua_State *L ) { lua_pushboolean( L, p->m_bCountNotesSeparately ); return 1; } + DEFINE_METHOD( GetMapJudgmentTo, GetMapJudgmentTo(Enum::Check(L, 1)) ) LunaGame() { ADD_METHOD( GetName ); + ADD_METHOD( CountNotesSeparately ); + ADD_METHOD( GetMapJudgmentTo ); } }; diff --git a/src/Game.h b/src/Game.h index 8e0e912691..8f988e3b4a 100644 --- a/src/Game.h +++ b/src/Game.h @@ -54,6 +54,7 @@ public: TapNoteScore m_mapW3To; TapNoteScore m_mapW4To; TapNoteScore m_mapW5To; + TapNoteScore GetMapJudgmentTo( TapNoteScore tns ) const; // Lua void PushSelf( lua_State *L );