From f8f4453637d4ae7a959f55e7f8c27087bed29680 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Sun, 15 May 2011 13:38:41 -0500 Subject: [PATCH 1/6] [ScreenGameplay] Removed hardcoded commands for Debug (give up text) and replace them with DebugStartOnCommand, DebugBackOnCommand, and DebugTweenOffCommand. --- Docs/Changelog_sm5.txt | 6 ++++++ Themes/_fallback/metrics.ini | 3 +++ src/ScreenGameplay.cpp | 17 +++-------------- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index daf91cd16f..91fb2ccaf9 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -8,6 +8,12 @@ ________________________________________________________________________________ StepMania 5.0 $NEXT | 20110xyy -------------------------------------------------------------------------------- +2011/05/15 +---------- +* [ScreenGameplay] Removed hardcoded commands for Debug (give up text) and + replace them with DebugStartOnCommand, DebugBackOnCommand, and + DebugTweenOffCommand. [AJ] + 2011/05/14 ---------- * [ModIcon] Added StopWords metric. [AJ] diff --git a/Themes/_fallback/metrics.ini b/Themes/_fallback/metrics.ini index 1b23a2200c..b80fa71588 100644 --- a/Themes/_fallback/metrics.ini +++ b/Themes/_fallback/metrics.ini @@ -3211,6 +3211,9 @@ SongOptionsOffCommand= DebugX=SCREEN_CENTER_X DebugY=SCREEN_BOTTOM-72 DebugOnCommand=zoom,0.75 +DebugStartOnCommand=stoptweening;diffusealpha,0;linear,1/8;diffusealpha,1 +DebugBackOnCommand=stoptweening;diffusealpha,0;linear,1/8;diffusealpha,1 +DebugTweenOffCommand=stoptweening;linear,1/8;diffusealpha,0 # SongNumberFormat="%d" SongNumberP1X=THEME:GetMetric(Var "LoadingScreen","PlayerP1OnePlayerOneSideX") - 60 diff --git a/src/ScreenGameplay.cpp b/src/ScreenGameplay.cpp index 5ffaa849db..b3dbc5a791 100644 --- a/src/ScreenGameplay.cpp +++ b/src/ScreenGameplay.cpp @@ -2156,11 +2156,7 @@ void ScreenGameplay::Input( const InputEventPlus &input ) else if( input.type==IET_FIRST_PRESS && m_GiveUpTimer.IsZero() ) { m_textDebug.SetText( GIVE_UP_START_TEXT ); - // todo: un-hardcode commands and move to metrics -aj - m_textDebug.StopTweening(); - m_textDebug.SetDiffuse( RageColor(1,1,1,0) ); - m_textDebug.BeginTweening( 1/8.f ); - m_textDebug.SetDiffuse( RageColor(1,1,1,1) ); + m_textDebug.PlayCommand( "StartOn" ); m_GiveUpTimer.Touch(); // start the timer } @@ -2187,18 +2183,11 @@ void ScreenGameplay::Input( const InputEventPlus &input ) else if( PREFSMAN->m_bDelayedBack && input.type==IET_FIRST_PRESS ) { m_textDebug.SetText( GIVE_UP_BACK_TEXT ); - // todo: un-hardcode commands and move to metrics -aj - m_textDebug.StopTweening(); - m_textDebug.SetDiffuse( RageColor(1,1,1,0) ); - m_textDebug.BeginTweening( 1/8.f ); - m_textDebug.SetDiffuse( RageColor(1,1,1,1) ); + m_textDebug.PlayCommand( "BackOn" ); } else if( PREFSMAN->m_bDelayedBack && input.type==IET_RELEASE ) { - // todo: un-hardcode commands and move to metrics -aj - m_textDebug.StopTweening(); - m_textDebug.BeginTweening( 1/8.f ); - m_textDebug.SetDiffuse( RageColor(1,1,1,0) ); + m_textDebug.PlayCommand( "TweenOff" ); } return; From 5e3aeb69c9d0d3ce7d9a36db042680a5f23ceeac Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Sun, 15 May 2011 13:49:05 -0500 Subject: [PATCH 2/6] added stepstype to an assert msg --- src/ScreenHowToPlay.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ScreenHowToPlay.cpp b/src/ScreenHowToPlay.cpp index 7deca6dd40..747a0bf18b 100644 --- a/src/ScreenHowToPlay.cpp +++ b/src/ScreenHowToPlay.cpp @@ -144,8 +144,7 @@ void ScreenHowToPlay::Init() const Style* pStyle = GAMESTATE->GetCurrentStyle(); Steps *pSteps = SongUtil::GetStepsByDescription( &m_Song, pStyle->m_StepsType, "" ); - // todo: make StepsType human readable. -aj - ASSERT_M( pSteps != NULL, "No playable steps for ScreenHowToPlay" ); + ASSERT_M( pSteps != NULL, ssprintf("No playable steps of StepsType '%s' for ScreenHowToPlay", StringConversion::ToString(pStyle->m_StepsType).c_str()) ); NoteData tempNoteData; pSteps->GetNoteData( tempNoteData ); From 13d40682c5f4bff902e2503b6a8eb34e7af584c5 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Sun, 15 May 2011 14:02:39 -0500 Subject: [PATCH 3/6] small cleanup --- src/OptionsCursor.cpp | 2 +- src/OptionsCursor.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OptionsCursor.cpp b/src/OptionsCursor.cpp index a18ce96750..b1a69a8c14 100644 --- a/src/OptionsCursor.cpp +++ b/src/OptionsCursor.cpp @@ -24,7 +24,7 @@ OptionsCursor::OptionsCursor( const OptionsCursor &cpy ): m_iOriginalCanGoLeftX( cpy.m_iOriginalCanGoLeftX ), m_iOriginalCanGoRightX( cpy.m_iOriginalCanGoRightX ) { - /* Re-add children, or m_SubActors will point to cpy's children and not our own. */ + // Re-add children, or m_SubActors will point to cpy's children and not our own. m_SubActors.clear(); this->AddChild( m_sprMiddle ); this->AddChild( m_sprLeft ); diff --git a/src/OptionsCursor.h b/src/OptionsCursor.h index cf27850d4e..9f0652fe24 100644 --- a/src/OptionsCursor.h +++ b/src/OptionsCursor.h @@ -28,11 +28,11 @@ protected: AutoActor m_sprMiddle; AutoActor m_sprLeft; AutoActor m_sprRight; - + AutoActor m_sprCanGoLeft; AutoActor m_sprCanGoRight; - // save the metrics-set X because it gets oblitterated on a call to SetBarWidth + // save the metrics-set X because it gets obliterated on a call to SetBarWidth int m_iOriginalLeftX; int m_iOriginalRightX; int m_iOriginalCanGoLeftX; From b8c3910bd18b2da71b91f144041ca05f70da5de8 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Sun, 15 May 2011 17:43:35 -0500 Subject: [PATCH 4/6] revert changes here to prevent the random theme bug --- src/ScreenOptionsMasterPrefs.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ScreenOptionsMasterPrefs.cpp b/src/ScreenOptionsMasterPrefs.cpp index 6ef345ceaf..347ecf041d 100644 --- a/src/ScreenOptionsMasterPrefs.cpp +++ b/src/ScreenOptionsMasterPrefs.cpp @@ -181,7 +181,7 @@ static void GameSel( int &sel, bool ToSel, const ConfOption *pConfOption ) sel = 0; for(unsigned i = 0; i < choices.size(); ++i) - if( !choices[i].EqualsNoCase(sCurGameName) ) + if( !stricmp(choices[i], sCurGameName) ) sel = i; } else { vector aGames; @@ -222,12 +222,12 @@ static void Language( int &sel, bool ToSel, const ConfOption *pConfOption ) { sel = -1; for( unsigned i=0; sel == -1 && i < vs.size(); ++i ) - if( !vs[i].EqualsNoCase(THEME->GetCurLanguage()) ) + if( !stricmp(vs[i], THEME->GetCurLanguage()) ) sel = i; // If the current language doesn't exist, we'll show BASE_LANGUAGE, so select that. for( unsigned i=0; sel == -1 && i < vs.size(); ++i ) - if( !vs[i].EqualsNoCase(SpecialFiles::BASE_LANGUAGE) ) + if( !stricmp(vs[i], SpecialFiles::BASE_LANGUAGE) ) sel = i; if( sel == -1 ) @@ -276,7 +276,7 @@ static void RequestedTheme( int &sel, bool ToSel, const ConfOption *pConfOption { sel = 0; for( unsigned i=1; im_sTheme.Get()) ) + if( !stricmp(vsThemeNames[i], PREFSMAN->m_sTheme.Get()) ) sel = i; } else @@ -302,7 +302,7 @@ static void Announcer( int &sel, bool ToSel, const ConfOption *pConfOption ) { sel = 0; for( unsigned i=1; iGetCurAnnouncerName()) ) + if( !stricmp(choices[i], ANNOUNCER->GetCurAnnouncerName()) ) sel = i; } else @@ -329,7 +329,7 @@ static void DefaultNoteSkin( int &sel, bool ToSel, const ConfOption *pConfOption po.FromString( PREFSMAN->m_sDefaultModifiers ); sel = 0; for( unsigned i=0; i < choices.size(); i++ ) - if( !choices[i].EqualsNoCase(po.m_sNoteSkin) ) + if( !stricmp(choices[i], po.m_sNoteSkin) ) sel = i; } else From d71c547da082fe81a902a12896cc1841e815d3ea Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Mon, 16 May 2011 00:07:06 -0500 Subject: [PATCH 5/6] [ProfileManager] Added ProfileWasLoadedFromMemoryCard(PlayerNumber) Lua binding. --- Docs/Changelog_sm5.txt | 5 +++++ src/ProfileManager.cpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/Docs/Changelog_sm5.txt b/Docs/Changelog_sm5.txt index 91fb2ccaf9..b5c710aa47 100644 --- a/Docs/Changelog_sm5.txt +++ b/Docs/Changelog_sm5.txt @@ -8,6 +8,11 @@ ________________________________________________________________________________ StepMania 5.0 $NEXT | 20110xyy -------------------------------------------------------------------------------- +2011/05/16 +---------- +* [ProfileManager] Added ProfileWasLoadedFromMemoryCard(PlayerNumber) + Lua binding. [AJ] + 2011/05/15 ---------- * [ScreenGameplay] Removed hardcoded commands for Debug (give up text) and diff --git a/src/ProfileManager.cpp b/src/ProfileManager.cpp index 812db73a8c..39821a75e1 100644 --- a/src/ProfileManager.cpp +++ b/src/ProfileManager.cpp @@ -833,6 +833,7 @@ public: static int GetNumLocalProfiles( T* p, lua_State *L ) { lua_pushnumber(L, p->GetNumLocalProfiles() ); return 1; } static int GetProfileDir( T* p, lua_State *L ) { lua_pushstring(L, p->GetProfileDir(Enum::Check(L, 1)) ); return 1; } static int IsSongNew( T* p, lua_State *L ) { lua_pushboolean(L, p->IsSongNew(Luna::check(L,1)) ); return 1; } + static int ProfileWasLoadedFromMemoryCard( T* p, lua_State *L ) { lua_pushboolean(L, p->ProfileWasLoadedFromMemoryCard(Enum::Check(L, 1)) ); return 1; } LunaProfileManager() { @@ -847,6 +848,7 @@ public: ADD_METHOD( GetNumLocalProfiles ); ADD_METHOD( GetProfileDir ); ADD_METHOD( IsSongNew ); + ADD_METHOD( ProfileWasLoadedFromMemoryCard ); } }; From 7670b922ad7e75280bb3dda36dfc3f680e423644 Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Mon, 16 May 2011 00:11:09 -0500 Subject: [PATCH 6/6] update luadoc --- Docs/Luadoc/LuaDocumentation.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Docs/Luadoc/LuaDocumentation.xml b/Docs/Luadoc/LuaDocumentation.xml index 39df9f4188..aa4e3c09fe 100644 --- a/Docs/Luadoc/LuaDocumentation.xml +++ b/Docs/Luadoc/LuaDocumentation.xml @@ -1626,12 +1626,11 @@ - - Return the Edit Local or nil if - it does not exist. + Return the Edit Local (during Profile editing) + or nil if it does not exist. - + Returns the ID of the Edit Local (during Profile editing). Return the source for the editor or nil