From cdeb70dbf465e9af7614f3dcdc8a7a50b41f3c11 Mon Sep 17 00:00:00 2001 From: Deve Date: Tue, 4 Sep 2018 00:31:56 +0200 Subject: [PATCH] Some fixes for soccer setup screen --- data/gui/soccer_setup.stkgui | 23 +++++++++++++--------- src/states_screens/soccer_setup_screen.cpp | 10 +++++----- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/data/gui/soccer_setup.stkgui b/data/gui/soccer_setup.stkgui index 9782f17b5..85d04b467 100644 --- a/data/gui/soccer_setup.stkgui +++ b/data/gui/soccer_setup.stkgui @@ -2,27 +2,30 @@ -
+ + + +
-
+
- +
-
+
- +
-
+
@@ -33,14 +36,16 @@ + +
- + - -
+ +
diff --git a/src/states_screens/soccer_setup_screen.cpp b/src/states_screens/soccer_setup_screen.cpp index 80db9cc98..520f09097 100644 --- a/src/states_screens/soccer_setup_screen.cpp +++ b/src/states_screens/soccer_setup_screen.cpp @@ -120,11 +120,11 @@ void SoccerSetupScreen::beforeAddingWidget() // Add red/blue team icon above the karts IconButtonWidget* red = getWidget("red_team"); IconButtonWidget* blue = getWidget("blue_team"); - red->m_x = central_div->m_x + central_div->m_w/4; - red->m_y = central_div->m_y + red->m_h; + red->m_x = central_div->m_x + central_div->m_w/4 - red->m_w/2; + red->m_y = central_div->m_y + (int)(red->m_h * 0.5f); - blue->m_x = central_div->m_x + (central_div->m_w/4)*3; - blue->m_y = central_div->m_y + blue->m_h; + blue->m_x = central_div->m_x + (central_div->m_w/4)*3 - blue->m_w/2; + blue->m_y = central_div->m_y + (int)(blue->m_h * 0.5f); // Add the 3D views for the karts int nb_players = race_manager->getNumPlayers(); @@ -463,7 +463,7 @@ void SoccerSetupScreen::updateKartViewsLayout() // Compute/get some dimensions const int nb_columns = 2; // two karts maximum per column - const int kart_area_width = (central_div->m_w) / 2; // size of one half of the screen + const int kart_area_width = (int)((central_div->m_w) / 2 * 0.8f); // size of one half of the screen with some margin const int kart_view_size = kart_area_width/nb_columns; // Size (width and height) of a kart view const int center_x = central_div->m_x + central_div->m_w/2; const int center_y = central_div->m_y + central_div->m_h/2;