From 2c1ef002b27f836e227342ddd076e32f10bedce2 Mon Sep 17 00:00:00 2001 From: Pavel Stupnikov Date: Wed, 18 Mar 2015 03:39:06 +0300 Subject: [PATCH] returned statue building on ctrl+click on town, rating color in town label, honor pop in label setting --HG-- branch : novattd150 --- src/town.h | 4 +++- src/viewport.cpp | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/town.h b/src/town.h index ad47c11f0e..cc24ffd611 100644 --- a/src/town.h +++ b/src/town.h @@ -150,11 +150,13 @@ struct Town : TownPool::PoolItem<&_town_pool> { /* Returns the correct town label, based on rating. */ //FORCEINLINE StringID Label() const{ StringID Label() const{ + if (!_settings_client.gui.population_in_label) + return STR_VIEWPORT_TOWN; if (!(_game_mode == GM_EDITOR) && (_local_company < MAX_COMPANIES)) { return STR_VIEWPORT_TOWN_POP_VERY_POOR_RATING + this->town_label; } else { - return _settings_client.gui.population_in_label ? STR_VIEWPORT_TOWN_POP : STR_VIEWPORT_TOWN; + return STR_VIEWPORT_TOWN_POP; } } diff --git a/src/viewport.cpp b/src/viewport.cpp index dfdda326d4..b880678fd7 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -1291,8 +1291,7 @@ static void ViewportAddTownNames(DrawPixelInfo *dpi) const Town *t; FOR_ALL_TOWNS(t) { ViewportAddString(dpi, ZOOM_LVL_OUT_16X, &t->cache.sign, - _settings_client.gui.population_in_label ? STR_VIEWPORT_TOWN_POP : STR_VIEWPORT_TOWN, - STR_VIEWPORT_TOWN_TINY_WHITE, STR_VIEWPORT_TOWN_TINY_BLACK, + t->Label(), t->SmallLabel(), STR_VIEWPORT_TOWN_TINY_BLACK, t->index, t->cache.population); } } @@ -2111,7 +2110,8 @@ static bool CheckClickOnTown(const ViewPort *vp, int x, int y) const Town *t; FOR_ALL_TOWNS(t) { if (CheckClickOnViewportSign(vp, x, y, &t->cache.sign)) { - ShowTownViewWindow(t->index); + if (_ctrl_pressed) TownExecuteAction(t, 4); //build statue + else ShowTownViewWindow(t->index); return true; } }