summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/ai_gui.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp
index a1c0616c2..98feba077 100644
--- a/src/ai/ai_gui.cpp
+++ b/src/ai/ai_gui.cpp
@@ -1342,9 +1342,7 @@ struct AIDebugWindow : public QueryStringBaseWindow {
EventState state = ES_NOT_HANDLED;
switch (this->HandleEditBoxKey(WID_AID_BREAK_STR_EDIT_BOX, key, keycode, state)) {
case HEBR_EDITING:
- /* Save the current string to static member so it can be restored next time the window is opened. */
- strecpy(this->break_string, this->edit_str_buf, lastof(this->break_string));
- break_string_filter.SetFilterTerm(this->break_string);
+ this->OnOSKInput(WID_AID_BREAK_STR_EDIT_BOX);
break;
case HEBR_CANCEL:
@@ -1373,6 +1371,15 @@ struct AIDebugWindow : public QueryStringBaseWindow {
return state;
}
+ virtual void OnOSKInput(int wid)
+ {
+ if (wid == WID_AID_BREAK_STR_EDIT_BOX) {
+ /* Save the current string to static member so it can be restored next time the window is opened. */
+ strecpy(this->break_string, this->edit_str_buf, lastof(this->break_string));
+ break_string_filter.SetFilterTerm(this->break_string);
+ }
+ }
+
/**
* Some data on this window has become invalid.
* @param data Information about the changed data.