Replace exit button with server configuration for future usage

This commit is contained in:
Benau 2018-11-16 12:48:53 +08:00
parent 2da8808592
commit 264b79ef0d
3 changed files with 3 additions and 14 deletions

View File

@ -28,8 +28,8 @@
<spacer width="3%"/> <spacer width="3%"/>
<icon-button id="start" proportion="1" width="64" height="64" icon="gui/icons/green_check.png" align="top" <icon-button id="start" proportion="1" width="64" height="64" icon="gui/icons/green_check.png" align="top"
I18N="In the network lobby" text="Start race"/> I18N="In the network lobby" text="Start race"/>
<icon-button id="exit" proportion="1" width="64" height="64" icon="gui/icons/main_quit.png" align="top" <icon-button id="config" proportion="1" width="64" height="64" icon="gui/icons/main_options.png" align="top"
I18N="In the network lobby" text="Exit"/> I18N="In the network lobby" text="Server Configuration"/>
</div> </div>
<spacer height="1%"/> <spacer height="1%"/>
</div> </div>

View File

@ -70,7 +70,6 @@ NetworkingLobby::NetworkingLobby() : Screen("online/networking_lobby.stkgui")
m_header = NULL; m_header = NULL;
m_text_bubble = NULL; m_text_bubble = NULL;
m_timeout_message = NULL; m_timeout_message = NULL;
m_exit_widget = NULL;
m_start_button = NULL; m_start_button = NULL;
m_player_list = NULL; m_player_list = NULL;
m_chat_box = NULL; m_chat_box = NULL;
@ -106,9 +105,6 @@ void NetworkingLobby::loadedFromFile()
m_player_list = getWidget<ListWidget>("players"); m_player_list = getWidget<ListWidget>("players");
assert(m_player_list!= NULL); assert(m_player_list!= NULL);
m_exit_widget = getWidget<IconButtonWidget>("exit");
assert(m_exit_widget != NULL);
m_icon_bank = new irr::gui::STKModifiedSpriteBank(GUIEngine::getGUIEnv()); m_icon_bank = new irr::gui::STKModifiedSpriteBank(GUIEngine::getGUIEnv());
video::ITexture* icon_1 = irr_driver->getTexture video::ITexture* icon_1 = irr_driver->getTexture
(file_manager->getAsset(FileManager::GUI_ICON, "crown.png")); (file_manager->getAsset(FileManager::GUI_ICON, "crown.png"));
@ -140,6 +136,7 @@ void NetworkingLobby::init()
{ {
Screen::init(); Screen::init();
getWidget("config")->setVisible(false);
m_player_names.clear(); m_player_names.clear();
m_allow_change_team = false; m_allow_change_team = false;
m_has_auto_start_in_server = false; m_has_auto_start_in_server = false;
@ -245,7 +242,6 @@ void NetworkingLobby::onUpdate(float delta)
if (cl && cl->isWaitingForGame()) if (cl && cl->isWaitingForGame())
{ {
m_start_button->setVisible(false); m_start_button->setVisible(false);
m_exit_widget->setVisible(true);
m_timeout_message->setVisible(true); m_timeout_message->setVisible(true);
//I18N: In the networking lobby, show when player is required to wait //I18N: In the networking lobby, show when player is required to wait
//before the current game finish //before the current game finish
@ -310,7 +306,6 @@ void NetworkingLobby::onUpdate(float delta)
m_text_bubble->setText(_("Everyone:\nPress the 'Select' button to " m_text_bubble->setText(_("Everyone:\nPress the 'Select' button to "
"join the game"), false); "join the game"), false);
m_start_button->setVisible(false); m_start_button->setVisible(false);
m_exit_widget->setVisible(false);
if (!GUIEngine::ModalDialog::isADialogActive()) if (!GUIEngine::ModalDialog::isADialogActive())
{ {
input_manager->getDeviceManager()->setAssignMode(DETECT_NEW); input_manager->getDeviceManager()->setAssignMode(DETECT_NEW);
@ -320,7 +315,6 @@ void NetworkingLobby::onUpdate(float delta)
} }
m_start_button->setVisible(false); m_start_button->setVisible(false);
m_exit_widget->setVisible(true);
if (!cl || !cl->isLobbyReady()) if (!cl || !cl->isLobbyReady())
{ {
core::stringw connect_msg; core::stringw connect_msg;
@ -437,10 +431,6 @@ void NetworkingLobby::eventCallback(Widget* widget, const std::string& name,
sendChat(m_chat_box->getText()); sendChat(m_chat_box->getText());
m_chat_box->setText(""); m_chat_box->setText("");
} // send chat message } // send chat message
else if (name == m_exit_widget->m_properties[PROP_ID])
{
StateManager::get()->escapePressed();
}
else if (name == m_start_button->m_properties[PROP_ID]) else if (name == m_start_button->m_properties[PROP_ID])
{ {
// Send a message to the server to start // Send a message to the server to start

View File

@ -82,7 +82,6 @@ private:
GUIEngine::LabelWidget* m_header; GUIEngine::LabelWidget* m_header;
GUIEngine::LabelWidget* m_text_bubble; GUIEngine::LabelWidget* m_text_bubble;
GUIEngine::LabelWidget* m_timeout_message; GUIEngine::LabelWidget* m_timeout_message;
GUIEngine::IconButtonWidget* m_exit_widget;
GUIEngine::IconButtonWidget* m_start_button; GUIEngine::IconButtonWidget* m_start_button;
GUIEngine::ListWidget* m_player_list; GUIEngine::ListWidget* m_player_list;
GUIEngine::TextBoxWidget* m_chat_box; GUIEngine::TextBoxWidget* m_chat_box;