UI/UX: Make first Continue button in GP results screen centered

Since we only show one button at first, make it centered.  (This is the continue button that switches from displaying race results to overall GP results.)
This commit is contained in:
QwertyChouskie 2023-04-22 00:27:22 -07:00
parent cce966683b
commit 4cabef6879

View File

@ -384,10 +384,12 @@ void RaceResultGUI::eventCallback(GUIEngine::Widget* widget,
{ {
const std::string& action = const std::string& action =
getWidget<GUIEngine::RibbonWidget>("operations")->getSelectionIDString(PLAYER_ID_GAME_MASTER); getWidget<GUIEngine::RibbonWidget>("operations")->getSelectionIDString(PLAYER_ID_GAME_MASTER);
if (m_animation_state == RR_WAITING_GP_RESULT && action == "left")
// User pressed "Continue" button, go from race results to overall GP results
if (m_animation_state == RR_WAITING_GP_RESULT && action == "middle")
{ {
GUIEngine::IconButtonWidget *left = getWidget<GUIEngine::IconButtonWidget>("left"); GUIEngine::IconButtonWidget *middle = getWidget<GUIEngine::IconButtonWidget>("middle");
left->setVisible(false); middle->setVisible(false);
getWidget("operations")->setActive(false); getWidget("operations")->setActive(false);
m_all_row_infos = m_all_row_info_waiting; m_all_row_infos = m_all_row_info_waiting;
m_animation_state = RR_OLD_GP_RESULTS; m_animation_state = RR_OLD_GP_RESULTS;
@ -1133,14 +1135,14 @@ void RaceResultGUI::unload()
determineGPLayout(); determineGPLayout();
m_all_row_info_waiting = m_all_row_infos; m_all_row_info_waiting = m_all_row_infos;
m_all_row_infos = prev_infos; m_all_row_infos = prev_infos;
GUIEngine::IconButtonWidget *left = getWidget<GUIEngine::IconButtonWidget>("left"); GUIEngine::IconButtonWidget *middle = getWidget<GUIEngine::IconButtonWidget>("middle");
GUIEngine::RibbonWidget *operations = getWidget<GUIEngine::RibbonWidget>("operations"); GUIEngine::RibbonWidget *operations = getWidget<GUIEngine::RibbonWidget>("operations");
operations->setActive(true); operations->setActive(true);
operations->setFocusForPlayer(PLAYER_ID_GAME_MASTER); operations->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
left->setLabel(_("Continue")); middle->setLabel(_("Continue"));
left->setImage("gui/icons/green_check.png"); middle->setImage("gui/icons/green_check.png");
left->setVisible(true); middle->setVisible(true);
operations->select("left", PLAYER_ID_GAME_MASTER); operations->select("middle", PLAYER_ID_GAME_MASTER);
} }
break; break;
case RR_WAITING_GP_RESULT: case RR_WAITING_GP_RESULT: