Remember last used number of goals value
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14141 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -328,6 +328,9 @@ namespace UserConfigParams
|
||||
PARAM_PREFIX IntUserConfigParam m_num_laps
|
||||
PARAM_DEFAULT( IntUserConfigParam(4, "numlaps",
|
||||
&m_race_setup_group, "Default number of laps.") );
|
||||
PARAM_PREFIX IntUserConfigParam m_num_goals
|
||||
PARAM_DEFAULT( IntUserConfigParam(3, "numgoals",
|
||||
&m_race_setup_group, "Default number of goals in soccer mode.") );
|
||||
PARAM_PREFIX IntUserConfigParam m_difficulty
|
||||
PARAM_DEFAULT( IntUserConfigParam(0, "difficulty",
|
||||
&m_race_setup_group,
|
||||
|
||||
@@ -137,10 +137,12 @@ void SoccerSetupScreen::beforeAddingWidget()
|
||||
void SoccerSetupScreen::init()
|
||||
{
|
||||
Screen::init();
|
||||
|
||||
if (UserConfigParams::m_num_goals <= 0)
|
||||
UserConfigParams::m_num_goals = 3;
|
||||
|
||||
// TODO: remember in config.xml the last number of goals
|
||||
SpinnerWidget* goalamount = getWidget<SpinnerWidget>("goalamount");
|
||||
goalamount->setValue(3);
|
||||
goalamount->setValue(UserConfigParams::m_num_goals);
|
||||
|
||||
// Set focus on "continue"
|
||||
ButtonWidget* bt_continue = getWidget<ButtonWidget>("continue");
|
||||
@@ -164,6 +166,8 @@ void SoccerSetupScreen::tearDown()
|
||||
|
||||
// Reset the 'map fire to select' option of the device manager
|
||||
input_manager->getDeviceList()->mapFireToSelect(false);
|
||||
|
||||
UserConfigParams::m_num_goals = getWidget<SpinnerWidget>("goalamount")->getValue();
|
||||
|
||||
// Remove all ModelViewWidgets we created manually
|
||||
PtrVector<Widget>& children = central_div->getChildren();
|
||||
|
||||
Reference in New Issue
Block a user