summaryrefslogtreecommitdiff
path: root/src/town_gui.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-09-15 19:02:50 +0000
committersmatz <smatz@openttd.org>2008-09-15 19:02:50 +0000
commite543181b120a4d0e80994166559b1ce7d7d45ce7 (patch)
tree9ea3e279046e9a622321db881df0c37605fde380 /src/town_gui.cpp
parent17e208dc16a0be8ca929b75f45edb345cb70aad9 (diff)
downloadopenttd-e543181b120a4d0e80994166559b1ce7d7d45ce7.tar.xz
(svn r14334) -Feature: ability to reset name to default/automatic value (for vehicles, engines, towns, groups, stations, waypoints, managers and companies)
Diffstat (limited to 'src/town_gui.cpp')
-rw-r--r--src/town_gui.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/town_gui.cpp b/src/town_gui.cpp
index 5518dec8f..356fbfea1 100644
--- a/src/town_gui.cpp
+++ b/src/town_gui.cpp
@@ -370,7 +370,7 @@ public:
case TVW_CHANGENAME: /* rename */
SetDParam(0, this->window_number);
- ShowQueryString(STR_TOWN, STR_2007_RENAME_TOWN, MAX_LENGTH_TOWN_NAME_BYTES, MAX_LENGTH_TOWN_NAME_PIXELS, this, CS_ALPHANUMERAL, QSF_NONE);
+ ShowQueryString(STR_TOWN, STR_2007_RENAME_TOWN, MAX_LENGTH_TOWN_NAME_BYTES, MAX_LENGTH_TOWN_NAME_PIXELS, this, CS_ALPHANUMERAL, QSF_ENABLE_DEFAULT);
break;
case TVW_EXPAND: /* expand town - only available on Scenario editor */
@@ -401,11 +401,10 @@ public:
virtual void OnQueryTextFinished(char *str)
{
- if (!StrEmpty(str)) {
- _cmd_text = str;
- DoCommandP(0, this->window_number, 0, NULL,
- CMD_RENAME_TOWN | CMD_MSG(STR_2008_CAN_T_RENAME_TOWN));
- }
+ if (str == NULL) return;
+
+ _cmd_text = str;
+ DoCommandP(0, this->window_number, 0, NULL, CMD_RENAME_TOWN | CMD_MSG(STR_2008_CAN_T_RENAME_TOWN));
}
};