Move the splitscreen split orientation in the display settings

It makes a lot of sense there too, and it makes the UI settings less crowded. This allows also to put the label as a section title, fixing an overflow that happened with some translations when using the very large font size.
This commit is contained in:
Alayan 2024-05-05 17:29:14 +02:00
parent ad02608744
commit fa421b43c7
No known key found for this signature in database
4 changed files with 35 additions and 31 deletions

View File

@ -64,6 +64,17 @@
<button id="apply_resolution"
I18N="In the display settings" text="Apply new resolution" />
</div>
<!-- ************ SPLITSCREEN METHOD ************ -->
<spacer width="5" height="3%"/>
<label width="100%" I18N="In the display settings" text="Splitscreen Multiplayer layout"/>
<spacer width="5" height="2%"/>
<div layout="horizontal-row" width="100%" height="fit">
<spinner id="splitscreen_method" width="10f" align="center" />
</div>
</box>
</div>
</div>

View File

@ -47,13 +47,6 @@
<spacer width="5" height="2%"/>
<div layout="horizontal-row" width="100%" height="fit">
<spinner id="splitscreen_method" width="10f" align="center" />
<label height="100%" x="0" y="0" I18N="In the ui settings" text="Splitscreen Multiplayer layout"/>
</div>
<spacer width="5" height="2%"/>
<div width="100%" height="fit" layout="horizontal-row">
<gauge id="font_size" width="10f" align="center" />
<label height="100%" x="0" y="0" I18N="In the ui settings" text="Font size"/>

View File

@ -46,6 +46,17 @@ OptionsScreenDisplay::OptionsScreenDisplay() : Screen("options/options_display.s
void OptionsScreenDisplay::loadedFromFile()
{
m_inited = false;
// Setup splitscreen spinner
GUIEngine::SpinnerWidget* splitscreen_method = getWidget<GUIEngine::SpinnerWidget>("splitscreen_method");
splitscreen_method->m_properties[PROP_WRAP_AROUND] = "true";
splitscreen_method->clearLabels();
//I18N: In the UI options, splitscreen_method in the race UI
splitscreen_method->addLabel( core::stringw(_("Vertical")));
//I18N: In the UI options, splitscreen_method position in the race UI
splitscreen_method->addLabel( core::stringw(_("Horizontal")));
splitscreen_method->m_properties[GUIEngine::PROP_MIN_VALUE] = "0";
splitscreen_method->m_properties[GUIEngine::PROP_MAX_VALUE] = "1";
} // loadedFromFile
// --------------------------------------------------------------------------------------------
@ -111,6 +122,13 @@ void OptionsScreenDisplay::init()
#endif
updateResolutionsList();
// ---- splitscreen mode
GUIEngine::SpinnerWidget* splitscreen_method = getWidget<GUIEngine::SpinnerWidget>("splitscreen_method");
assert( splitscreen_method != NULL );
if (UserConfigParams::split_screen_horizontally) splitscreen_method->setValue(1);
else splitscreen_method->setValue(0);
splitscreen_method->setActive(!in_game);
} // init
// --------------------------------------------------------------------------------------------
@ -383,6 +401,12 @@ void OptionsScreenDisplay::eventCallback(Widget* widget, const std::string& name
else
updateResolutionsList();
#endif
} // fullscreen
else if (name == "splitscreen_method")
{
GUIEngine::SpinnerWidget* splitscreen_method = getWidget<GUIEngine::SpinnerWidget>("splitscreen_method");
assert( splitscreen_method != NULL );
UserConfigParams::split_screen_horizontally = (splitscreen_method->getValue() == 1);
}
} // eventCallback

View File

@ -80,17 +80,6 @@ void OptionsScreenUI::loadedFromFile()
}
minimap_options->m_properties[GUIEngine::PROP_MAX_VALUE] = "3";
// Setup splitscreen spinner
GUIEngine::SpinnerWidget* splitscreen_method = getWidget<GUIEngine::SpinnerWidget>("splitscreen_method");
splitscreen_method->m_properties[PROP_WRAP_AROUND] = "true";
splitscreen_method->clearLabels();
//I18N: In the UI options, splitscreen_method in the race UI
splitscreen_method->addLabel( core::stringw(_("Vertical")));
//I18N: In the UI options, splitscreen_method position in the race UI
splitscreen_method->addLabel( core::stringw(_("Horizontal")));
splitscreen_method->m_properties[GUIEngine::PROP_MIN_VALUE] = "0";
splitscreen_method->m_properties[GUIEngine::PROP_MAX_VALUE] = "1";
// Setup fontsize spinner
GUIEngine::SpinnerWidget* font_size = getWidget<GUIEngine::SpinnerWidget>("font_size");
assert( font_size != NULL );
@ -246,13 +235,6 @@ void OptionsScreenUI::init()
UserConfigParams::m_font_size = font_size->getValue();
font_size->setActive(!in_game);
// ---- video modes
GUIEngine::SpinnerWidget* splitscreen_method = getWidget<GUIEngine::SpinnerWidget>("splitscreen_method");
assert( splitscreen_method != NULL );
if (UserConfigParams::split_screen_horizontally) splitscreen_method->setValue(1);
else splitscreen_method->setValue(0);
splitscreen_method->setActive(!in_game);
CheckBoxWidget* karts_powerup_gui = getWidget<CheckBoxWidget>("karts_powerup_gui");
assert(karts_powerup_gui != NULL);
karts_powerup_gui->setState(UserConfigParams::m_karts_powerup_gui);
@ -406,12 +388,6 @@ void OptionsScreenUI::eventCallback(Widget* widget, const std::string& name, con
m_reload_option->m_focus_name = "font_size";
m_reload_option->m_focus_right = right;
}
else if (name == "splitscreen_method")
{
GUIEngine::SpinnerWidget* splitscreen_method = getWidget<GUIEngine::SpinnerWidget>("splitscreen_method");
assert( splitscreen_method != NULL );
UserConfigParams::split_screen_horizontally = (splitscreen_method->getValue() == 1);
}
else if (name == "karts_powerup_gui")
{
CheckBoxWidget* karts_powerup_gui = getWidget<CheckBoxWidget>("karts_powerup_gui");