MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / edtNameChange

Method edtNameChange

src/Geoscape/BaseNameState.cpp:102–117  ·  view source on GitHub ↗

* Updates the base name and disables the OK button * if no name is entered. * @param action Pointer to an action. */

Source from the content-addressed store, hash-verified

100 * @param action Pointer to an action.
101 */
102void BaseNameState::edtNameChange(Action *action)
103{
104 _base->setName(_edtName->getText());
105 if (action->getDetails()->key.keysym.sym == SDLK_RETURN ||
106 action->getDetails()->key.keysym.sym == SDLK_KP_ENTER)
107 {
108 if (!_edtName->getText().empty())
109 {
110 btnOkClick(action);
111 }
112 }
113 else
114 {
115 _btnOk->setVisible(!_edtName->getText().empty());
116 }
117}
118
119/**
120 * Returns to the previous screen

Callers

nothing calls this directly

Calls 5

getDetailsMethod · 0.80
setNameMethod · 0.45
getTextMethod · 0.45
emptyMethod · 0.45
setVisibleMethod · 0.45

Tested by

no test coverage detected