diff --git a/stepmania/src/Character.cpp b/stepmania/src/Character.cpp index 7138bb5560..0270eb05b4 100644 --- a/stepmania/src/Character.cpp +++ b/stepmania/src/Character.cpp @@ -198,24 +198,19 @@ void Character::UndemandGraphics() class LunaCharacter: public Luna { public: - LunaCharacter() { LUA->Register( Register ); } - static int GetCardPath( T* p, lua_State *L ) { lua_pushstring(L, p->GetCardPath() ); return 1; } static int GetIconPath( T* p, lua_State *L ) { lua_pushstring(L, p->GetIconPath() ); return 1; } static int GetSongSelectIconPath( T* p, lua_State *L ) { lua_pushstring(L, p->GetSongSelectIconPath() ); return 1; } static int GetStageIconPath( T* p, lua_State *L ) { lua_pushstring(L, p->GetStageIconPath() ); return 1; } - RString GetCardPath() const; - RString GetIconPath() const; - - static void Register( Lua *L ) + LunaCharacter() { + LUA->Register( Register ); + ADD_METHOD( GetCardPath ); ADD_METHOD( GetIconPath ); ADD_METHOD( GetSongSelectIconPath ); ADD_METHOD( GetStageIconPath ); - - Luna::Register( L ); } }; diff --git a/stepmania/src/Screen.cpp b/stepmania/src/Screen.cpp index 1a4b27ad46..4ba584cfc8 100644 --- a/stepmania/src/Screen.cpp +++ b/stepmania/src/Screen.cpp @@ -281,7 +281,6 @@ void Screen::ClearMessageQueue( const ScreenMessage SM ) class LunaScreen: public Luna { public: - LunaScreen() { LUA->Register( Register ); } static int GetNextScreen( T* p, lua_State *L ) { lua_pushstring(L, p->GetNextScreen() ); return 1; } static int lockinput( T* p, lua_State *L ) { p->SetLockInputSecs(FArg(1)); return 0; } @@ -293,13 +292,13 @@ public: return 0; } - static void Register( Lua *L ) + LunaScreen() { + LUA->Register( Register ); + ADD_METHOD( GetNextScreen ); ADD_METHOD( PostScreenMessage ); ADD_METHOD( lockinput ); - - Luna::Register( L ); } }; diff --git a/stepmania/src/ScreenGameplay.cpp b/stepmania/src/ScreenGameplay.cpp index 8c08ae076b..61c438139c 100644 --- a/stepmania/src/ScreenGameplay.cpp +++ b/stepmania/src/ScreenGameplay.cpp @@ -2634,16 +2634,15 @@ void ScreenGameplay::SaveReplay() class LunaScreenGameplay: public Luna { public: - LunaScreenGameplay() { LUA->Register( Register ); } - static int GetNextCourseSong( T* p, lua_State *L ) { p->GetNextCourseSong()->PushSelf(L); return 1; } static int Center1Player( T* p, lua_State *L ) { lua_pushboolean( L, p->Center1Player() ); return 1; } - static void Register( Lua *L ) + + LunaScreenGameplay() { + LUA->Register( Register ); + ADD_METHOD( GetNextCourseSong ); ADD_METHOD( Center1Player ); - - Luna::Register( L ); } }; diff --git a/stepmania/src/ScreenOptions.cpp b/stepmania/src/ScreenOptions.cpp index d2d43d8af4..17774368a3 100644 --- a/stepmania/src/ScreenOptions.cpp +++ b/stepmania/src/ScreenOptions.cpp @@ -1250,14 +1250,13 @@ void ScreenOptions::MenuUpDown( const InputEventPlus &input, int iDir ) class LunaScreenOptions: public Luna { public: - LunaScreenOptions() { LUA->Register( Register ); } - static int GetCurrentRow( T* p, lua_State *L ) { lua_pushnumber( L, p->GetCurrentRow(Enum::Check(L, 1)) ); return 1; } - static void Register( Lua *L ) - { - ADD_METHOD( GetCurrentRow ); - Luna::Register( L ); + LunaScreenOptions() + { + LUA->Register( Register ); + + ADD_METHOD( GetCurrentRow ); } }; diff --git a/stepmania/src/ScreenPlayerOptions.cpp b/stepmania/src/ScreenPlayerOptions.cpp index e044f39b8e..2d8025fdb1 100644 --- a/stepmania/src/ScreenPlayerOptions.cpp +++ b/stepmania/src/ScreenPlayerOptions.cpp @@ -185,14 +185,13 @@ void ScreenPlayerOptions::UpdateDisqualified( int row, PlayerNumber pn ) class LunaScreenPlayerOptions: public Luna { public: - LunaScreenPlayerOptions() { LUA->Register( Register ); } - static int GetGoToOptions( T* p, lua_State *L ) { lua_pushboolean( L, p->GetGoToOptions() ); return 1; } - static void Register( Lua *L ) - { - ADD_METHOD( GetGoToOptions ); - Luna::Register( L ); + LunaScreenPlayerOptions() + { + LUA->Register( Register ); + + ADD_METHOD( GetGoToOptions ); } }; diff --git a/stepmania/src/ScreenSelectMusic.cpp b/stepmania/src/ScreenSelectMusic.cpp index 27eac0c432..45891bdfb8 100644 --- a/stepmania/src/ScreenSelectMusic.cpp +++ b/stepmania/src/ScreenSelectMusic.cpp @@ -1028,14 +1028,13 @@ void ScreenSelectMusic::AfterMusicChange() class LunaScreenSelectMusic: public Luna { public: - LunaScreenSelectMusic() { LUA->Register( Register ); } - static int GetGoToOptions( T* p, lua_State *L ) { lua_pushboolean( L, p->GetGoToOptions() ); return 1; } - static void Register( Lua *L ) - { - ADD_METHOD( GetGoToOptions ); - Luna::Register( L ); + LunaScreenSelectMusic() + { + LUA->Register( Register ); + + ADD_METHOD( GetGoToOptions ); } }; diff --git a/stepmania/src/ScreenWithMenuElements.cpp b/stepmania/src/ScreenWithMenuElements.cpp index 6834e22fc4..04d4e79140 100644 --- a/stepmania/src/ScreenWithMenuElements.cpp +++ b/stepmania/src/ScreenWithMenuElements.cpp @@ -351,11 +351,9 @@ void ScreenWithMenuElementsSimple::MenuBack( const InputEventPlus &input ) class LunaScreenWithMenuElements: public Luna { public: - LunaScreenWithMenuElements() { LUA->Register( Register ); } - - static void Register( Lua *L ) + LunaScreenWithMenuElements() { - Luna::Register( L ); + LUA->Register( Register ); } }; @@ -364,11 +362,9 @@ LUA_REGISTER_DERIVED_CLASS( ScreenWithMenuElements, Screen ) class LunaScreenWithMenuElementsSimple: public Luna { public: - LunaScreenWithMenuElementsSimple() { LUA->Register( Register ); } - - static void Register( Lua *L ) + LunaScreenWithMenuElementsSimple() { - Luna::Register( L ); + LUA->Register( Register ); } };