Skip to content

Commit

Permalink
🐛 Fixed menu not appearing after exiting simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
ohlidalp authored and Petr Ohlídal committed Feb 14, 2021
1 parent a22eed3 commit dd827ff
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions source/main/gui/panels/GUI_GamePauseMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ void GamePauseMenu::Draw() // TODO: Copypaste of 'GameMainMenu' -- cleanup and u
{
App::GetGameContext()->PushMessage(Message(MSG_NET_DISCONNECT_REQUESTED));
}
App::GetGameContext()->PushMessage(Message(MSG_GUI_OPEN_MENU_REQUESTED));
}

if (HighlightButton(_L("Exit game"), btn_size, 2))
Expand Down
1 change: 1 addition & 0 deletions source/main/gui/panels/GUI_TopMenubar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ void TopMenubar::Update()
App::GetGameContext()->PushMessage(Message(MSG_NET_DISCONNECT_REQUESTED));
}
App::GetGameContext()->PushMessage(Message(MSG_SIM_UNLOAD_TERRN_REQUESTED));
App::GetGameContext()->PushMessage(Message(MSG_GUI_OPEN_MENU_REQUESTED));
}

if (ImGui::Button(_LC("TopMenubar", "Exit")))
Expand Down
2 changes: 2 additions & 0 deletions source/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,13 +380,15 @@ int main(int argc, char *argv[])
case MSG_NET_SERVER_KICK:
App::GetGameContext()->PushMessage(Message(MSG_NET_DISCONNECT_REQUESTED));
App::GetGameContext()->PushMessage(Message(MSG_SIM_UNLOAD_TERRN_REQUESTED));
App::GetGameContext()->PushMessage(Message(MSG_GUI_OPEN_MENU_REQUESTED));
App::GetGuiManager()->ShowMessageBox(
_LC("Network", "Network disconnected"), m.description.c_str());
break;

case MSG_NET_RECV_ERROR:
App::GetGameContext()->PushMessage(Message(MSG_NET_DISCONNECT_REQUESTED));
App::GetGameContext()->PushMessage(Message(MSG_SIM_UNLOAD_TERRN_REQUESTED));
App::GetGameContext()->PushMessage(Message(MSG_GUI_OPEN_MENU_REQUESTED));
App::GetGuiManager()->ShowMessageBox(
_L("Network fatal error: "), m.description.c_str());
break;
Expand Down
1 change: 1 addition & 0 deletions source/main/scripting/GameScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,7 @@ void GameScript::showMessageBox(Ogre::String& title, Ogre::String& text, bool us
void GameScript::backToMenu()
{
App::GetGameContext()->PushMessage(Message(MSG_SIM_UNLOAD_TERRN_REQUESTED));
App::GetGameContext()->PushMessage(Message(MSG_GUI_OPEN_MENU_REQUESTED));
}

void GameScript::quitGame()
Expand Down

0 comments on commit dd827ff

Please # to comment.