Pre-fill online username with local username.
This commit is contained in:
parent
7725a26dfb
commit
b6c26651e0
@ -137,6 +137,19 @@ void RegisterScreen::onDialogClose()
|
||||
makeEntryFieldsVisible();
|
||||
} // onDialogClose
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
void RegisterScreen::onFocusChanged(GUIEngine::Widget* previous,
|
||||
GUIEngine::Widget* focus, int playerID)
|
||||
{
|
||||
TextBoxWidget *online_name = getWidget<TextBoxWidget>("username");
|
||||
if (focus == online_name)
|
||||
{
|
||||
TextBoxWidget *local_name = getWidget<TextBoxWidget>("local_username");
|
||||
if (online_name->getText() == "")
|
||||
online_name->setText(local_name->getText());
|
||||
}
|
||||
} // onFocusChanged
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
/** Shows or hides the entry fields for online registration, depending on
|
||||
* online mode.
|
||||
|
@ -78,7 +78,10 @@ public:
|
||||
virtual void loadedFromFile() OVERRIDE {};
|
||||
virtual void onUpdate(float dt) OVERRIDE;
|
||||
virtual bool onEscapePressed() OVERRIDE;
|
||||
virtual void onDialogClose() OVERRIDE;
|
||||
virtual void onDialogClose() OVERRIDE;
|
||||
virtual void onFocusChanged(GUIEngine::Widget *previous,
|
||||
GUIEngine::Widget *focus,
|
||||
int playerID);
|
||||
void setRename(PlayerProfile *player);
|
||||
|
||||
void acceptTerms();
|
||||
|
Loading…
Reference in New Issue
Block a user