This commit is contained in:
Benau 2018-10-25 14:15:33 +08:00
parent 378c5c18e7
commit 610c976ce2
3 changed files with 8 additions and 24 deletions

View File

@ -52,8 +52,6 @@ private:
void handleBadConnection();
void becomingServerOwner();
void clearPlayers();
TransportAddress m_server_address;
std::shared_ptr<Server> m_server;
@ -113,7 +111,7 @@ public:
bool isWaitingForGame() const { return m_waiting_for_game; }
bool isServerAutoLap() const { return m_server_auto_lap; }
virtual bool isRacing() const OVERRIDE { return m_state.load() == RACING; }
void clearPlayers();
};
#endif // CLIENT_LOBBY_HPP

View File

@ -91,8 +91,6 @@ void NetworkKartSelectionScreen::allPlayersDone()
// ---- Switch to assign mode
input_manager->getDeviceManager()->setAssignMode(ASSIGN);
// Remove kart screen
StateManager::get()->popMenu();
TracksScreen::getInstance()->setNetworkTracks();
TracksScreen::getInstance()->push();

View File

@ -122,20 +122,17 @@ void TracksScreen::eventCallback(Widget* widget, const std::string& name,
// -----------------------------------------------------------------------------
bool TracksScreen::onEscapePressed()
{
if (m_network_tracks)
{
// Remove this screen
StateManager::get()->popMenu();
STKHost::get()->shutdown();
}
return true; // remove the screen
auto cl = LobbyProtocol::get<ClientLobby>();
if (cl)
cl->clearPlayers();
// remove the screen
return true;
} // onEscapePressed
// -----------------------------------------------------------------------------
void TracksScreen::tearDown()
{
m_network_tracks = false;
m_vote_timeout = std::numeric_limits<uint64_t>::max();
m_selected_track = NULL;
} // tearDown
@ -225,17 +222,8 @@ void TracksScreen::beforeAddingWidget()
// -----------------------------------------------------------------------------
void TracksScreen::init()
{
// change the back button image (because it makes the game quit)
if (m_network_tracks)
{
IconButtonWidget* back_button = getWidget<IconButtonWidget>("back");
back_button->setImage("gui/icons/main_quit.png");
}
else
{
IconButtonWidget* back_button = getWidget<IconButtonWidget>("back");
back_button->setImage("gui/icons/back.png");
}
if (!m_network_tracks)
m_vote_timeout = std::numeric_limits<uint64_t>::max();
DynamicRibbonWidget* tracks_widget = getWidget<DynamicRibbonWidget>("tracks");
assert(tracks_widget != NULL);