diff --git a/src/signs_func.h b/src/signs_func.h --- a/src/signs_func.h +++ b/src/signs_func.h @@ -15,6 +15,7 @@ void PlaceProc_Sign(TileIndex tile); /* signs_gui.cpp */ void ShowRenameSignWindow(const Sign *si); +void HandleClickOnSign(const Sign *si); void ShowSignList(); diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -8,6 +8,7 @@ #include "textbuf_gui.h" #include "window_gui.h" #include "player_gui.h" +#include "player_func.h" #include "signs_base.h" #include "signs_func.h" #include "debug.h" @@ -301,6 +302,15 @@ static const WindowDesc _query_sign_edit _query_sign_edit_widgets, }; +void HandleClickOnSign(const Sign *si) +{ + if (_ctrl_pressed && si->owner == _local_player) { + RenameSign(si->index, ""); + return; + } + ShowRenameSignWindow(si); +} + void ShowRenameSignWindow(const Sign *si) { /* Delete all other edit windows and the save window */ diff --git a/src/viewport.cpp b/src/viewport.cpp --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -1870,7 +1870,7 @@ static bool CheckClickOnSign(const ViewP y < si->sign.top + 12 && x >= si->sign.left && x < si->sign.left + si->sign.width_1) { - ShowRenameSignWindow(si); + HandleClickOnSign(si); return true; } } @@ -1884,7 +1884,7 @@ static bool CheckClickOnSign(const ViewP y < si->sign.top + 24 && x >= si->sign.left && x < si->sign.left + si->sign.width_1 * 2) { - ShowRenameSignWindow(si); + HandleClickOnSign(si); return true; } } @@ -1900,7 +1900,7 @@ static bool CheckClickOnSign(const ViewP y < si->sign.top + ScaleByZoom(12, vp->zoom) && x >= si->sign.left && x < si->sign.left + ScaleByZoom(si->sign.width_2, vp->zoom)) { - ShowRenameSignWindow(si); + HandleClickOnSign(si); return true; } }