Focus on cancel button to avoid bad misclick result
This commit is contained in:
parent
5b38f73b27
commit
cc580cec8b
@ -88,8 +88,6 @@ void NetworkUserDialog::beforeAddingWidgets()
|
||||
|
||||
m_options_widget = getWidget<RibbonWidget>("options");
|
||||
assert(m_options_widget != NULL);
|
||||
m_options_widget->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
|
||||
m_options_widget->select("cancel", PLAYER_ID_GAME_MASTER);
|
||||
|
||||
m_change_team_widget = NULL;
|
||||
if (m_allow_change_team && m_host_id == STKHost::get()->getMyHostId())
|
||||
@ -107,6 +105,13 @@ void NetworkUserDialog::beforeAddingWidgets()
|
||||
getWidget<IconButtonWidget>("enter")->setVisible(false);
|
||||
} // beforeAddingWidgets
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
void NetworkUserDialog::init()
|
||||
{
|
||||
m_options_widget->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
|
||||
m_options_widget->select("cancel", PLAYER_ID_GAME_MASTER);
|
||||
} // init
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
void NetworkUserDialog::onUpdate(float dt)
|
||||
{
|
||||
|
@ -91,6 +91,8 @@ public:
|
||||
virtual bool onEscapePressed();
|
||||
// ------------------------------------------------------------------------
|
||||
virtual void onUpdate(float dt);
|
||||
// ------------------------------------------------------------------------
|
||||
virtual void init();
|
||||
|
||||
};
|
||||
|
||||
|
@ -124,9 +124,11 @@ void UserInfoDialog::beforeAddingWidgets()
|
||||
} // beforeAddingWidgets
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
UserInfoDialog::~UserInfoDialog()
|
||||
void UserInfoDialog::init()
|
||||
{
|
||||
} // ~UserInfoDialog
|
||||
m_options_widget->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
|
||||
m_options_widget->select("cancel", PLAYER_ID_GAME_MASTER);
|
||||
} // init
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
/** Sends a friend request to the server. When the request is finished, it
|
||||
|
@ -71,7 +71,6 @@ private:
|
||||
|
||||
public:
|
||||
UserInfoDialog(uint32_t showing_id, const core::stringw info = "", bool error = false, bool from_queue = false);
|
||||
~UserInfoDialog();
|
||||
|
||||
virtual void beforeAddingWidgets();
|
||||
virtual void load();
|
||||
@ -81,6 +80,7 @@ public:
|
||||
|
||||
virtual bool onEscapePressed();
|
||||
virtual void onUpdate(float dt);
|
||||
virtual void init();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user