summaryrefslogtreecommitdiff
path: root/src/signs_gui.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-09-07 16:22:55 +0000
committersmatz <smatz@openttd.org>2008-09-07 16:22:55 +0000
commit06be8207302d1bd758fea079e44465aeb3e9695d (patch)
tree6d345769a76aaf5050f0575c5d44bfb1ef244d65 /src/signs_gui.cpp
parentbb683cf38edb3bf6f15cd32b4490c0bd84032e42 (diff)
downloadopenttd-06be8207302d1bd758fea079e44465aeb3e9695d.tar.xz
(svn r14263) -Codechange: give a better error message when removing a sign fails
Diffstat (limited to 'src/signs_gui.cpp')
-rw-r--r--src/signs_gui.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp
index 04089bd4e..ec89f5ebc 100644
--- a/src/signs_gui.cpp
+++ b/src/signs_gui.cpp
@@ -22,6 +22,7 @@
#include "viewport_func.h"
#include "querystring_gui.h"
#include "sortlist_type.h"
+#include "string_func.h"
#include "table/strings.h"
#include "table/sprites.h"
@@ -173,7 +174,7 @@ void ShowSignList()
static void RenameSign(SignID index, const char *text)
{
_cmd_text = text;
- DoCommandP(0, index, 0, NULL, CMD_RENAME_SIGN | CMD_MSG(STR_280C_CAN_T_CHANGE_SIGN_NAME));
+ DoCommandP(0, index, 0, NULL, CMD_RENAME_SIGN | (StrEmpty(text) ? CMD_MSG(STR_CAN_T_DELETE_SIGN) : CMD_MSG(STR_280C_CAN_T_CHANGE_SIGN_NAME)));
}
enum QueryEditSignWidgets {
@@ -343,7 +344,7 @@ static const WindowDesc _query_sign_edit_desc = {
void HandleClickOnSign(const Sign *si)
{
if (_ctrl_pressed && si->owner == _local_player) {
- RenameSign(si->index, "");
+ RenameSign(si->index, NULL);
return;
}
ShowRenameSignWindow(si);