Show a better change team text for multitouch device

This commit is contained in:
Benau 2020-03-01 10:17:00 +08:00
parent f9a85f9c72
commit bd513646ac
2 changed files with 12 additions and 1 deletions

View File

@ -6,7 +6,7 @@
<header height="8%" width="80%" text="Race Setup" align="center" text_align="center" />
<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"/>
<bubble height="fit" id="choose_team" 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"/>
<spacer height="1%" width="25"/>

View File

@ -34,6 +34,8 @@
#include "karts/kart_properties_manager.hpp"
#include "states_screens/arenas_screen.hpp"
#include "states_screens/state_manager.hpp"
#include "utils/string_utils.hpp"
#include "utils/translation.hpp"
using namespace GUIEngine;
@ -106,6 +108,15 @@ void SoccerSetupScreen::eventCallback(Widget* widget, const std::string& name,
// -----------------------------------------------------------------------------
void SoccerSetupScreen::beforeAddingWidget()
{
bool multitouch_enabled = (UserConfigParams::m_multitouch_active == 1 &&
irr_driver->getDevice()->supportsTouchDevice()) ||
UserConfigParams::m_multitouch_active > 1;
if (multitouch_enabled)
{
Widget* team = getWidget<Widget>("choose_team");
//I18N: In soccer setup screen
team->setText(_("Press red or blue soccer icon to change team"));
}
Widget* central_div = getWidget<Widget>("central_div");
// Add the 3D views for the karts