summaryrefslogtreecommitdiff
path: root/src/fios_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-11-13 21:46:58 +0000
committerfrosch <frosch@openttd.org>2012-11-13 21:46:58 +0000
commit7699a7dc06049956b90d3f41a14109ee05b97514 (patch)
treea27f6da660a39ae2345755a1a1c57fbeb2c025b8 /src/fios_gui.cpp
parentfd55399167115dbb06e77bb03f85681ba318f5f2 (diff)
downloadopenttd-7699a7dc06049956b90d3f41a14109ee05b97514.tar.xz
(svn r24732) -Codechange: Unify handling of OK and CANCEL actions for editboxes.
Diffstat (limited to 'src/fios_gui.cpp')
-rw-r--r--src/fios_gui.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp
index 5f49341a7..a038d0654 100644
--- a/src/fios_gui.cpp
+++ b/src/fios_gui.cpp
@@ -262,6 +262,7 @@ public:
default: break;
}
+ this->ok_button = WID_SL_SAVE_GAME;
this->afilter = CS_ALPHANUMERAL;
this->text.Initialize(this->edit_str_buf, this->edit_str_size);
@@ -604,7 +605,12 @@ public:
}
break;
- case WID_SL_DELETE_SELECTION: case WID_SL_SAVE_GAME: // Delete, Save game
+ case WID_SL_DELETE_SELECTION: // Delete
+ break;
+
+ case WID_SL_SAVE_GAME: // Save game
+ /* Note, this is also called via the OSK; and we need to lower the button. */
+ this->HandleButtonClick(WID_SL_SAVE_GAME);
break;
}
}
@@ -617,10 +623,7 @@ public:
}
EventState state = ES_NOT_HANDLED;
- if ((_saveload_mode == SLD_SAVE_GAME || _saveload_mode == SLD_SAVE_SCENARIO || _saveload_mode == SLD_SAVE_HEIGHTMAP) &&
- this->HandleEditBoxKey(WID_SL_SAVE_OSK_TITLE, key, keycode, state) == HEBR_CONFIRM) {
- this->HandleButtonClick(WID_SL_SAVE_GAME);
- }
+ this->HandleEditBoxKey(WID_SL_SAVE_OSK_TITLE, key, keycode, state);
return state;
}