diff --git a/stepmania/src/ScreenWithMenuElements.cpp b/stepmania/src/ScreenWithMenuElements.cpp index 4a572d7623..178cd6f22a 100644 --- a/stepmania/src/ScreenWithMenuElements.cpp +++ b/stepmania/src/ScreenWithMenuElements.cpp @@ -314,6 +314,24 @@ void ScreenWithMenuElements::StopTimer() m_MenuTimer->Stop(); } +REGISTER_SCREEN_CLASS( ScreenWithMenuElementsSimple ); + +void ScreenWithMenuElementsSimple::MenuStart( PlayerNumber pn ) +{ + if( IsTransitioning() ) + return; + + StartTransitioningScreen( SM_GoToNextScreen ); +} + +void ScreenWithMenuElementsSimple::MenuBack( PlayerNumber pn ) +{ + if( IsTransitioning() ) + return; + + StartTransitioningScreen( SM_GoToPrevScreen ); +} + // lua start #include "LuaBinding.h" @@ -329,6 +347,20 @@ public: }; LUA_REGISTER_DERIVED_CLASS( ScreenWithMenuElements, Screen ) + +class LunaScreenWithMenuElementsSimple: public Luna +{ +public: + LunaScreenWithMenuElementsSimple() { LUA->Register( Register ); } + + static void Register( Lua *L ) + { + Luna::Register( L ); + } +}; + +LUA_REGISTER_DERIVED_CLASS( ScreenWithMenuElementsSimple, ScreenWithMenuElements ) + // lua end /* diff --git a/stepmania/src/ScreenWithMenuElements.h b/stepmania/src/ScreenWithMenuElements.h index 0680817d59..e1f9d7a113 100644 --- a/stepmania/src/ScreenWithMenuElements.h +++ b/stepmania/src/ScreenWithMenuElements.h @@ -68,6 +68,22 @@ private: RString m_sPathToMusic; }; +class ScreenWithMenuElementsSimple: public ScreenWithMenuElements +{ +public: + void MenuStart( PlayerNumber pn ); + void MenuBack( PlayerNumber pn ); + + // + // Lua + // + virtual void PushSelf( lua_State *L ); + +protected: + virtual bool GenericTweenOn() const { return true; } + virtual bool GenericTweenOff() const { return true; } +}; + #endif /*