[GameCommand] Remove pushscreen

[ScreenOptionsMasterPrefs] Reset Judge and Life values to the ones in SM4
[ScreenNetEvaluation] add Score, Grade, PlayerOptions params to UpdateNetEvalStats message
[PlayerState] add GetHealthState Lua binding
small cleanup in statsman
This commit is contained in:
AJ Kelly
2010-08-15 15:26:27 -05:00
parent 0de703fb45
commit d0b2a6940d
6 changed files with 20 additions and 25 deletions
+3 -14
View File
@@ -59,7 +59,6 @@ void GameCommand::Init()
m_sProfileID = ""; m_sProfileID = "";
m_sUrl = ""; m_sUrl = "";
m_bUrlExits = true; m_bUrlExits = true;
m_bPushScreen = false;
m_bInsertCredit = false; m_bInsertCredit = false;
m_bClearCredits = false; m_bClearCredits = false;
@@ -242,7 +241,6 @@ void GameCommand::LoadOne( const Command& cmd )
else if( sName == "screen" ) else if( sName == "screen" )
{ {
m_sScreen = sValue; m_sScreen = sValue;
m_bPushScreen = false;
} }
else if( sName == "song" ) else if( sName == "song" )
@@ -412,12 +410,6 @@ void GameCommand::LoadOne( const Command& cmd )
} }
} }
else if( sName == "pushscreen" )
{
m_sScreen = sValue;
m_bPushScreen = true;
}
else if( sName == "fademusic" ) else if( sName == "fademusic" )
{ {
// todo: parse things correctly. -aj // todo: parse things correctly. -aj
@@ -573,7 +565,7 @@ bool GameCommand::IsPlayable( RString *why ) const
} }
} }
if( !m_sScreen.CompareNoCase("ScreenEditCoursesMenu") && !m_bPushScreen ) if( !m_sScreen.CompareNoCase("ScreenEditCoursesMenu") )
{ {
vector<Course*> vCourses; vector<Course*> vCourses;
SONGMAN->GetAllCourses( vCourses, false ); SONGMAN->GetAllCourses( vCourses, false );
@@ -588,8 +580,7 @@ bool GameCommand::IsPlayable( RString *why ) const
if( (!m_sScreen.CompareNoCase("ScreenJukeboxMenu") || if( (!m_sScreen.CompareNoCase("ScreenJukeboxMenu") ||
!m_sScreen.CompareNoCase("ScreenEditMenu") || !m_sScreen.CompareNoCase("ScreenEditMenu") ||
!m_sScreen.CompareNoCase("ScreenEditCoursesMenu")) && !m_sScreen.CompareNoCase("ScreenEditCoursesMenu")) )
!m_bPushScreen)
{ {
if( SONGMAN->GetNumSongs() == 0 ) if( SONGMAN->GetNumSongs() == 0 )
{ {
@@ -727,10 +718,8 @@ void GameCommand::ApplySelf( const vector<PlayerNumber> &vpns ) const
} }
LUA->Release(L); LUA->Release(L);
} }
if( m_sScreen != "" && m_bApplyCommitsScreens && !m_bPushScreen ) if( m_sScreen != "" && m_bApplyCommitsScreens )
SCREENMAN->SetNewScreen( m_sScreen ); SCREENMAN->SetNewScreen( m_sScreen );
if( m_sScreen != "" && m_bApplyCommitsScreens && m_bPushScreen )
SCREENMAN->AddNewScreenToTop( m_sScreen );
if( m_pSong ) if( m_pSong )
{ {
GAMESTATE->m_pCurSong.Set( m_pSong ); GAMESTATE->m_pCurSong.Set( m_pSong );
-1
View File
@@ -80,7 +80,6 @@ public:
RString m_sUrl; RString m_sUrl;
// sm-ssc adds: // sm-ssc adds:
bool m_bUrlExits; // for making stepmania not exit on url bool m_bUrlExits; // for making stepmania not exit on url
bool m_bPushScreen; // for pushing a screen on top instead of as next
bool m_bInsertCredit; bool m_bInsertCredit;
bool m_bClearCredits; bool m_bClearCredits;
+2
View File
@@ -246,6 +246,7 @@ public:
LuaHelpers::CreateTableFromArray<RString>( s, L ); LuaHelpers::CreateTableFromArray<RString>( s, L );
return 1; return 1;
} }
DEFINE_METHOD( GetHealthState, m_HealthState );
LunaPlayerState() LunaPlayerState()
{ {
@@ -254,6 +255,7 @@ public:
ADD_METHOD( SetPlayerOptions ); ADD_METHOD( SetPlayerOptions );
ADD_METHOD( GetPlayerOptions ); ADD_METHOD( GetPlayerOptions );
ADD_METHOD( GetPlayerOptionsArray ); ADD_METHOD( GetPlayerOptionsArray );
ADD_METHOD( GetHealthState );
} }
}; };
+3
View File
@@ -219,6 +219,9 @@ void ScreenNetEvaluation::UpdateStats()
Message msg("UpdateNetEvalStats"); Message msg("UpdateNetEvalStats");
msg.SetParam( "ActivePlayerIndex", m_pActivePlayer ); msg.SetParam( "ActivePlayerIndex", m_pActivePlayer );
msg.SetParam( "Difficulty", NSMAN->m_EvalPlayerData[m_iCurrentPlayer].difficulty ); msg.SetParam( "Difficulty", NSMAN->m_EvalPlayerData[m_iCurrentPlayer].difficulty );
msg.SetParam( "Score", NSMAN->m_EvalPlayerData[m_iCurrentPlayer].score );
msg.SetParam( "Grade", NSMAN->m_EvalPlayerData[m_iCurrentPlayer].grade );
msg.SetParam( "PlayerOptions", NSMAN->m_EvalPlayerData[m_iCurrentPlayer].playerOptions );
if( pSteps ) if( pSteps )
msg.SetParam( "Steps", pSteps ); msg.SetParam( "Steps", pSteps );
MESSAGEMAN->Broadcast(msg); MESSAGEMAN->Broadcast(msg);
+12 -8
View File
@@ -38,6 +38,7 @@ static void SetPrefsDefaultModifiers( const PlayerOptions &po, const SongOptions
PREFSMAN->m_sDefaultModifiers.Set( join(", ",as) ); PREFSMAN->m_sDefaultModifiers.Set( join(", ",as) );
} }
/* Ugly: the input values may be a different type than the mapping. For example, /* Ugly: the input values may be a different type than the mapping. For example,
* the mapping may be an enum, and value an int. This is because we don't * the mapping may be an enum, and value an int. This is because we don't
* have FromString/ToString for every enum type. Assume that the distance between * have FromString/ToString for every enum type. Assume that the distance between
@@ -156,6 +157,8 @@ static void MoveNop( int &iSel, bool bToSel, const ConfOption *pConfOption )
iSel = 0; iSel = 0;
} }
// TODO: Write GenerateValueList() function that can use ints and floats. -aj
static void GameChoices( vector<RString> &out ) static void GameChoices( vector<RString> &out )
{ {
vector<const Game*> aGames; vector<const Game*> aGames;
@@ -184,12 +187,11 @@ static void GameSel( int &sel, bool ToSel, const ConfOption *pConfOption )
vector<const Game*> aGames; vector<const Game*> aGames;
GAMEMAN->GetEnabledGames( aGames ); GAMEMAN->GetEnabledGames( aGames );
StepMania::ChangeCurrentGame( aGames[sel] ); StepMania::ChangeCurrentGame( aGames[sel] );
/* XXX: reload metrics to force a refresh of /* Reload metrics to force a refresh of CommonMetrics::DIFFICULTIES_TO_SHOW,
* CommonMetrics::DIFFICULTIES_TO_SHOW, mainly if we're not switching * mainly if we're not switching themes. I'm not sure if this was the
* themes. I'm not sure if this was the case going from theme to theme, * case going from theme to theme, but if it was, it should be fixed
* but if it was, it should be fixed now. There should probably be a * now. There's probably be a better way to do it, but I'm not sure
* better way than this, but I'm not sure what it'd be. -aj * what it'd be. -aj */
*/
THEME->ReloadMetrics(); THEME->ReloadMetrics();
} }
} }
@@ -431,13 +433,15 @@ static void SongsPerPlayOrEventMode( int &sel, bool ToSel, const ConfOption *pCo
// Machine options // Machine options
static void TimingWindowScale( int &sel, bool ToSel, const ConfOption *pConfOption ) static void TimingWindowScale( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const float mapping[] = { 2.0f,1.66f,1.33f,1.00f,0.75f,0.50f,0.25f }; //const float mapping[] = { 2.0f,1.66f,1.33f,1.00f,0.75f,0.50f,0.25f };
const float mapping[] = { 1.50f,1.33f,1.16f,1.00f,0.84f,0.66f,0.50f,0.33f,0.20f };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAYLEN(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYLEN(mapping) );
} }
static void LifeDifficulty( int &sel, bool ToSel, const ConfOption *pConfOption ) static void LifeDifficulty( int &sel, bool ToSel, const ConfOption *pConfOption )
{ {
const float mapping[] = { 2.0f,1.50f,1.00f,0.66f,0.33f }; //const float mapping[] = { 2.0f,1.50f,1.00f,0.66f,0.33f };
const float mapping[] = { 1.60f,1.40f,1.20f,1.00f,0.80f,0.60f,0.40f };
MoveMap( sel, pConfOption, ToSel, mapping, ARRAYLEN(mapping) ); MoveMap( sel, pConfOption, ToSel, mapping, ARRAYLEN(mapping) );
} }
-2
View File
@@ -202,11 +202,9 @@ XNode* MakeRecentScoreNode( const StageStats &ss, Trail *pTrail, const PlayerSta
void StatsManager::CommitStatsToProfiles( const StageStats *pSS ) void StatsManager::CommitStatsToProfiles( const StageStats *pSS )
{ {
//
// Add step totals. Use radarActual, since the player might have failed part way // Add step totals. Use radarActual, since the player might have failed part way
// through the song, in which case we don't want to give credit for the rest of the // through the song, in which case we don't want to give credit for the rest of the
// song. // song.
//
FOREACH_HumanPlayer( pn ) FOREACH_HumanPlayer( pn )
{ {
int iNumTapsAndHolds = (int) pSS->m_player[pn].m_radarActual[RadarCategory_TapsAndHolds]; int iNumTapsAndHolds = (int) pSS->m_player[pn].m_radarActual[RadarCategory_TapsAndHolds];