diff --git a/stepmania/src/MenuTimer.cpp b/stepmania/src/MenuTimer.cpp index b13fcbca20..a3e047f616 100644 --- a/stepmania/src/MenuTimer.cpp +++ b/stepmania/src/MenuTimer.cpp @@ -23,6 +23,7 @@ MenuTimer::MenuTimer() : m_fStallSeconds = 0; m_fStallSecondsLeft = MAX_STALL_SECONDS; m_bPaused = false; + m_bSilent = false; } void MenuTimer::Load() @@ -45,10 +46,7 @@ void MenuTimer::Load() void MenuTimer::EnableStealth( bool bStealth ) { - if( bStealth ) - m_soundBeep.Unload(); // unload the sound - else - m_soundBeep.Load( THEME->GetPathS("MenuTimer","tick") ); // reload the sound + EnableSilent( bStealth ); for( int i=0; iSetSeconds(FArg(1)); return 0; } static int pause( T* p, lua_State *L ) { p->Pause(); return 0; } static int stop( T* p, lua_State *L ) { p->Stop(); return 0; } + static int silent( T* p, lua_State *L ) { p->EnableSilent(BArg(1)); return 0; } + static int stealth( T* p, lua_State *L ) { p->EnableStealth(BArg(1)); return 0; } LunaMenuTimer() { ADD_METHOD( setseconds ); ADD_METHOD( pause ); ADD_METHOD( stop ); + ADD_METHOD( silent ); + ADD_METHOD( stealth ); } }; diff --git a/stepmania/src/MenuTimer.h b/stepmania/src/MenuTimer.h index f2182098b4..f39ef44690 100644 --- a/stepmania/src/MenuTimer.h +++ b/stepmania/src/MenuTimer.h @@ -22,6 +22,7 @@ public: void Stop(); // set to "00" and pause void Disable(); // set to "99" and pause void Stall(); // pause countdown for a sec + void EnableSilent( bool bSilent ) { m_bSilent = bSilent; } // make timer silent void EnableStealth( bool bStealth ); // make timer invisible and silent // @@ -38,6 +39,8 @@ protected: #define NUM_MENU_TIMER_TEXTS 2 + bool m_bSilent; + BitmapText m_text[NUM_MENU_TIMER_TEXTS]; LuaReference m_exprFormatText[NUM_MENU_TIMER_TEXTS];