(svn r14263) -Codechange: give a better error message when removing a sign fails

This commit is contained in:
smatz 2008-09-07 16:22:55 +00:00
parent bb683cf38e
commit 06be820730
2 changed files with 4 additions and 2 deletions

View File

@ -1881,6 +1881,7 @@ STR_2809_CAN_T_PLACE_SIGN_HERE :{WHITE}Can't pl
STR_280A_SIGN :Sign
STR_280B_EDIT_SIGN_TEXT :{WHITE}Edit sign text
STR_280C_CAN_T_CHANGE_SIGN_NAME :{WHITE}Can't change sign name...
STR_CAN_T_DELETE_SIGN :{WHITE}Can't delete sign...
STR_280D_SELECT_TREE_TYPE_TO_PLANT :{BLACK}Select tree type to plant
STR_280E_TREES :Trees
STR_280F_RAINFOREST :Rainforest

View File

@ -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);