diff -r 72d56e6876c6 src/town_cmd.cpp --- a/src/town_cmd.cpp Fri Mar 20 02:16:13 2015 +0300 +++ b/src/town_cmd.cpp Fri Mar 20 20:27:24 2015 +0300 @@ -377,7 +377,8 @@ SetDParam(0, this->index); SetDParam(1, this->cache.population); this->cache.sign.UpdatePosition(pt.x, pt.y - 24 * ZOOM_LVL_BASE, - _settings_client.gui.population_in_label ? STR_VIEWPORT_TOWN_POP : STR_VIEWPORT_TOWN); + _settings_client.gui.population_in_label ? STR_VIEWPORT_TOWN_POP : STR_VIEWPORT_TOWN, + STR_VIEWPORT_TOWN); SetWindowDirty(WC_TOWN_VIEW, this->index); } diff -r 72d56e6876c6 src/viewport.cpp --- a/src/viewport.cpp Fri Mar 20 02:16:13 2015 +0300 +++ b/src/viewport.cpp Fri Mar 20 20:27:24 2015 +0300 @@ -1310,7 +1310,7 @@ * @param top the new top of the sign * @param str the string to show in the sign */ -void ViewportSign::UpdatePosition(int center, int top, StringID str) +void ViewportSign::UpdatePosition(int center, int top, StringID str, StringID small_str) { if (this->width_normal != 0) this->MarkDirty(); @@ -1323,6 +1323,9 @@ this->center = center; /* zoomed out version */ + if (small_str != STR_NULL) { + GetString(buffer, small_str, lastof(buffer)); + } this->width_small = VPSM_LEFT + Align(GetStringBoundingBox(buffer, FS_SMALL).width, 2) + VPSM_RIGHT; this->MarkDirty(); diff -r 72d56e6876c6 src/viewport_type.h --- a/src/viewport_type.h Fri Mar 20 02:16:13 2015 +0300 +++ b/src/viewport_type.h Fri Mar 20 20:27:24 2015 +0300 @@ -14,6 +14,7 @@ #include "zoom_type.h" #include "strings_type.h" +#include "table/strings.h" class LinkGraphOverlay; @@ -50,7 +51,7 @@ uint16 width_normal; ///< The width when not zoomed out (normal font) uint16 width_small; ///< The width when zoomed out (small font) - void UpdatePosition(int center, int top, StringID str); + void UpdatePosition(int center, int top, StringID str, StringID small_str=STR_NULL); void MarkDirty(ZoomLevel maxzoom = ZOOM_LVL_MAX) const; };