- Fixed crash when goal is scored after time limit
- Set time max value to 15 - playing one game 45 minutes doesn't have a sense - Remember time value in user config - Little beter look of soccer setup - Set goal-limit mode as default git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14743 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
@@ -2,37 +2,36 @@
|
||||
|
||||
<icon-button id="back" x="0" y="0" height="8%" icon="gui/back.png"/>
|
||||
|
||||
<div x="5%" y="5%" width="90%" height="90%" layout="vertical-row" >
|
||||
<div x="5%" y="5%" width="95%" height="95%" layout="vertical-row" >
|
||||
|
||||
<header width="80%" text="Race Setup" align="center" text_align="center" />
|
||||
|
||||
<spacer height="25" width="25"/>
|
||||
|
||||
<div layout="horizontal-row" width="100%" height="50" align="center">
|
||||
<div layout="horizontal-row" width="fit" height="35" align="left">
|
||||
<bright proportion="1" height="100%"
|
||||
I18N="In soccer setup menu" text="Number of goals to win" text_align="right" />
|
||||
I18N="In soccer setup menu" text="Number of goals to win" text_align="left" />
|
||||
<spacer width="50" height="25"/>
|
||||
<spinner id="goalamount" proportion="1" height="100%" min_value="1" max_value="10" wrap_around="true"/>
|
||||
<spinner id="goalamount" width="200" height="90%" min_value="1" max_value="10"/>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div layout="horizontal-row" width="100%" height="50" align="center">
|
||||
|
||||
<div layout="horizontal-row" width="fit" height="35" align="left">
|
||||
<bright proportion="1" height="100%"
|
||||
I18N="In soccer setup menu" text="Maximum time(minutes)" text_align="right" />
|
||||
<spacer width="20" height="25"/>
|
||||
I18N="In soccer setup menu" text="Maximum time (min.)" text_align="left" />
|
||||
<spacer width="50" height ="25">
|
||||
<spinner id="timeamount" width="200" height="90%" min_value="1" max_value="15"/>
|
||||
</div>
|
||||
|
||||
<div layout="horizontal-row" width="fit" height="35" align="left">
|
||||
<bright proportion="1" height="100%"
|
||||
I18N="In soccer setup menu" text="Game type (Goals limit / Time limit)" text_align="left" />
|
||||
<spacer width="50" height="25"/>
|
||||
<checkbox id="time_enabled"/>
|
||||
<spacer width="20" height ="25">
|
||||
<spinner id="timeamount" proportion="1" height="100%" min_value="1" max_value="45" wrap_around="true"/>
|
||||
</div>
|
||||
|
||||
|
||||
<spacer height="25" width="25"/>
|
||||
<spacer height="40" width="25"/>
|
||||
|
||||
<bright height="15" width="25" I18N="In soccer setup menu" text="Use left/right to choose your team" text_align="center" align="center" />
|
||||
|
||||
<spacer height="25" width="25"/>
|
||||
<bright height="15" width="25" I18N="In soccer setup menu" text="Use left/right to choose your team and press fire" text_align="center" align="center" />
|
||||
|
||||
<div id="central_div" layout="horizontal-row" width="100%" proportion="1" align="center">
|
||||
<roundedbox x="2%" y="5%" proportion="1" layout="horizontal-row" height="100%">
|
||||
|
||||
@@ -368,6 +368,9 @@ namespace UserConfigParams
|
||||
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_soccer_time_limit
|
||||
PARAM_DEFAULT( IntUserConfigParam(3, "soccer-time-limit",
|
||||
&m_race_setup_group, "Limit in soccer time mode.") );
|
||||
PARAM_PREFIX IntUserConfigParam m_difficulty
|
||||
PARAM_DEFAULT( IntUserConfigParam(0, "difficulty",
|
||||
&m_race_setup_group,
|
||||
|
||||
@@ -162,6 +162,9 @@ void SoccerWorld::update(float dt)
|
||||
//-----------------------------------------------------------------------------
|
||||
void SoccerWorld::onCheckGoalTriggered(bool first_goal)
|
||||
{
|
||||
if (isRaceOver())
|
||||
return;
|
||||
|
||||
if (m_can_score_points)
|
||||
{
|
||||
m_team_goals[first_goal ? 0 : 1]++;
|
||||
|
||||
@@ -198,22 +198,26 @@ void SoccerSetupScreen::init()
|
||||
|
||||
if (UserConfigParams::m_num_goals <= 0)
|
||||
UserConfigParams::m_num_goals = 3;
|
||||
|
||||
if (UserConfigParams::m_soccer_time_limit <= 0)
|
||||
UserConfigParams::m_soccer_time_limit = 3;
|
||||
|
||||
SpinnerWidget* goalamount = getWidget<SpinnerWidget>("goalamount");
|
||||
goalamount->setValue(UserConfigParams::m_num_goals);
|
||||
goalamount->setDeactivated();
|
||||
goalamount->setActivated();
|
||||
|
||||
SpinnerWidget* timeAmount = getWidget<SpinnerWidget>("timeamount");
|
||||
timeAmount->setValue(timeAmount->getMin());
|
||||
timeAmount->setValue(UserConfigParams::m_soccer_time_limit);
|
||||
timeAmount->setDeactivated();
|
||||
|
||||
CheckBoxWidget* timeEnabled = getWidget<CheckBoxWidget>("time_enabled");
|
||||
timeEnabled->setState(false);
|
||||
|
||||
// Set focus on "continue"
|
||||
ButtonWidget* bt_continue = getWidget<ButtonWidget>("continue");
|
||||
ButtonWidget* bt_continue = getWidget<ButtonWidget>("continue");
|
||||
bt_continue->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
|
||||
|
||||
// We need players to be able to choose their teams
|
||||
//~ input_manager->getDeviceList()->setAssignMode(ASSIGN);
|
||||
input_manager->setMasterPlayerOnly(false);
|
||||
|
||||
// This flag will cause that a 'fire' event will be mapped to 'select' (if
|
||||
@@ -231,6 +235,7 @@ void SoccerSetupScreen::tearDown()
|
||||
input_manager->getDeviceList()->mapFireToSelect(false);
|
||||
|
||||
UserConfigParams::m_num_goals = getWidget<SpinnerWidget>("goalamount")->getValue();
|
||||
UserConfigParams::m_soccer_time_limit = getWidget<SpinnerWidget>("timeamount")->getValue();
|
||||
|
||||
// Remove all ModelViewWidgets we created manually
|
||||
PtrVector<Widget>& children = central_div->getChildren();
|
||||
|
||||
Reference in New Issue
Block a user