Allow ModeChoice to set modifiers.
This commit is contained in:
@@ -19,6 +19,7 @@ void ModeChoice::Init()
|
|||||||
m_style = STYLE_INVALID;
|
m_style = STYLE_INVALID;
|
||||||
m_pm = PLAY_MODE_INVALID;
|
m_pm = PLAY_MODE_INVALID;
|
||||||
m_dc = DIFFICULTY_INVALID;
|
m_dc = DIFFICULTY_INVALID;
|
||||||
|
m_sModifiers = "";
|
||||||
m_sAnnouncer = "";
|
m_sAnnouncer = "";
|
||||||
m_sName = "";
|
m_sName = "";
|
||||||
m_sScreen = "";
|
m_sScreen = "";
|
||||||
@@ -110,21 +111,20 @@ void ModeChoice::Load( int iIndex, CString sChoice )
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( sName == "announcer" )
|
if( sName == "announcer" )
|
||||||
{
|
|
||||||
m_sAnnouncer = sValue;
|
m_sAnnouncer = sValue;
|
||||||
}
|
|
||||||
|
|
||||||
/* Hmm. I feel like I'm overloading ModeChoice here; this makes it
|
|
||||||
* a generic menu choice. */
|
|
||||||
if( sName == "name" )
|
if( sName == "name" )
|
||||||
{
|
|
||||||
m_sName = sValue;
|
m_sName = sValue;
|
||||||
|
|
||||||
|
if( sName == "mod" )
|
||||||
|
{
|
||||||
|
if( m_sModifiers != "" )
|
||||||
|
m_sModifiers += ",";
|
||||||
|
m_sModifiers += sValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( sName == "screen" )
|
if( sName == "screen" )
|
||||||
{
|
|
||||||
m_sScreen = sValue;
|
m_sScreen = sValue;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,6 +204,9 @@ void ModeChoice::Apply( PlayerNumber pn )
|
|||||||
GAMESTATE->m_PreferredDifficulty[pn] = m_dc;
|
GAMESTATE->m_PreferredDifficulty[pn] = m_dc;
|
||||||
if( m_sAnnouncer != "" )
|
if( m_sAnnouncer != "" )
|
||||||
ANNOUNCER->SwitchAnnouncer( m_sAnnouncer );
|
ANNOUNCER->SwitchAnnouncer( m_sAnnouncer );
|
||||||
|
if( m_sModifiers != "" )
|
||||||
|
for( int pn=0; pn<NUM_PLAYERS; pn++ )
|
||||||
|
GAMESTATE->ApplyModifiers( (PlayerNumber)pn, m_sModifiers );
|
||||||
|
|
||||||
// HACK: Set life type to BATTERY just once here so it happens once and
|
// HACK: Set life type to BATTERY just once here so it happens once and
|
||||||
// we don't override the user's changes if they back out.
|
// we don't override the user's changes if they back out.
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ struct ModeChoice // used in SelectMode
|
|||||||
PlayMode m_pm;
|
PlayMode m_pm;
|
||||||
Difficulty m_dc;
|
Difficulty m_dc;
|
||||||
CString m_sAnnouncer;
|
CString m_sAnnouncer;
|
||||||
|
CString m_sModifiers;
|
||||||
CString m_sScreen;
|
CString m_sScreen;
|
||||||
CString m_sName;
|
CString m_sName;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user