Fix #3546
This commit is contained in:
parent
7b3540e4ee
commit
fe805abc09
@ -11,6 +11,13 @@
|
||||
|
||||
<spacer height="1%" width="25"/>
|
||||
|
||||
<div layout="horizontal-row" width="40%" height="fit" align="left">
|
||||
<bright width="fit" height="100%"
|
||||
I18N="In soccer setup screen" text="Soccer game type" text_align="left" />
|
||||
<spacer width="2%" height="25"/>
|
||||
<spinner id="time_enabled" proportion="1" wrap_around="true"/>
|
||||
</div>
|
||||
|
||||
<div layout="horizontal-row" width="100%" height="fit" align="left">
|
||||
<bright width="fit" height="100%"
|
||||
I18N="In soccer setup screen" text="Number of goals to win" text_align="left" />
|
||||
@ -25,13 +32,6 @@
|
||||
<spinner id="timeamount" width="15%" min_value="1" max_value="15"/>
|
||||
</div>
|
||||
|
||||
<div layout="horizontal-row" width="100%" height="fit" align="left">
|
||||
<bright width="fit" height="100%"
|
||||
I18N="In soccer setup screen" text="Game type (Goals limit / Time limit)" text_align="left" />
|
||||
<spacer width="2%" height="25"/>
|
||||
<checkbox id="time_enabled"/>
|
||||
</div>
|
||||
|
||||
<spacer height="1%" width="25"/>
|
||||
|
||||
<bubble height="fit" width="100%" id="lblLeftRight" I18N="In soccer setup screen" text="Use left/right to choose your team and press fire" word_wrap="true" text_align="center"/>
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "guiengine/widgets/bubble_widget.hpp"
|
||||
#include "guiengine/widgets/button_widget.hpp"
|
||||
#include "guiengine/widgets/spinner_widget.hpp"
|
||||
#include "guiengine/widgets/check_box_widget.hpp"
|
||||
#include "guiengine/widgets/label_widget.hpp"
|
||||
#include "guiengine/widgets/model_view_widget.hpp"
|
||||
#include "guiengine/scalable_font.hpp"
|
||||
@ -90,8 +89,8 @@ void SoccerSetupScreen::eventCallback(Widget* widget, const std::string& name,
|
||||
}
|
||||
else if(name == "time_enabled")
|
||||
{
|
||||
CheckBoxWidget* timeEnabled = dynamic_cast<CheckBoxWidget*>(widget);
|
||||
bool timed = timeEnabled->getState();
|
||||
SpinnerWidget* timeEnabled = dynamic_cast<SpinnerWidget*>(widget);
|
||||
bool timed = timeEnabled->getValue() == 0;
|
||||
UserConfigParams::m_soccer_use_time_limit = timed;
|
||||
getWidget<SpinnerWidget>("goalamount")->setActive(!timed);
|
||||
getWidget<SpinnerWidget>("timeamount")->setActive(timed);
|
||||
@ -226,8 +225,11 @@ void SoccerSetupScreen::init()
|
||||
timeAmount->setValue(UserConfigParams::m_soccer_time_limit);
|
||||
timeAmount->setActive(UserConfigParams::m_soccer_use_time_limit);
|
||||
|
||||
CheckBoxWidget* timeEnabled = getWidget<CheckBoxWidget>("time_enabled");
|
||||
timeEnabled->setState(UserConfigParams::m_soccer_use_time_limit);
|
||||
SpinnerWidget* timeEnabled = getWidget<SpinnerWidget>("time_enabled");
|
||||
timeEnabled->clearLabels();
|
||||
timeEnabled->addLabel(_("Time limit"));
|
||||
timeEnabled->addLabel(_("Goals limit"));
|
||||
timeEnabled->setValue(UserConfigParams::m_soccer_use_time_limit ? 0 : 1);
|
||||
|
||||
// Set focus on "continue"
|
||||
ButtonWidget* bt_continue = getWidget<ButtonWidget>("continue");
|
||||
|
Loading…
Reference in New Issue
Block a user