Mercurial > hg > openttd
changeset 13902:923cb29d89d9 draft
(svn r18433) -Codechange: Show different texts in town GUI when the town does not need food the whole year to grow.
author | frosch <frosch@openttd.org> |
---|---|
date | Tue, 08 Dec 2009 19:59:21 +0000 |
parents | 87290884a834 |
children | 2d3268d0ddd1 |
files | src/date.cpp src/lang/english.txt src/town_gui.cpp |
diffstat | 3 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/date.cpp +++ b/src/date.cpp @@ -255,6 +255,9 @@ SetWindowWidgetDirty(WC_STATUS_BAR, 0, 0); EnginesDailyLoop(); + + /* Refresh after possible snowline change */ + SetWindowClassesDirty(WC_TOWN_VIEW); } /**
--- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -2387,6 +2387,7 @@ STR_TOWN_VIEW_MAIL_LAST_MONTH_MAX :{BLACK}Mail last month: {ORANGE}{COMMA}{BLACK} max: {ORANGE}{COMMA} STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH :{BLACK}Cargo needed for town growth: STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH_REQUIRED :{ORANGE}{STRING}{BLACK} required +STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH_REQUIRED_WINTER :{ORANGE}{STRING}{BLACK} required in winter STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH_LAST_MONTH :{ORANGE}{CARGO}{BLACK} delivered last month STR_TOWN_VIEW_NOISE_IN_TOWN :{BLACK}Noise limit in town: {ORANGE}{COMMA}{BLACK} max: {ORANGE}{COMMA} STR_TOWN_VIEW_CENTER_TOOLTIP :{BLACK}Centre the main view on town location. Ctrl+Click opens a new viewport on town location
--- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -374,10 +374,12 @@ SetDParam(1, this->town->max_mail); DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_LEFT, y += FONT_HEIGHT_NORMAL, STR_TOWN_VIEW_MAIL_LAST_MONTH_MAX); + StringID required_text = STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH_REQUIRED; uint cargo_needed_for_growth = 0; switch (_settings_game.game_creation.landscape) { case LT_ARCTIC: if (TilePixelHeight(this->town->xy) >= LowestSnowLine()) cargo_needed_for_growth = 1; + if (TilePixelHeight(this->town->xy) < GetSnowLine()) required_text = STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH_REQUIRED_WINTER; break; case LT_TROPIC: @@ -408,7 +410,7 @@ DrawString(cargo_text_left, cargo_text_right, y += FONT_HEIGHT_NORMAL, STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH_LAST_MONTH); } else { SetDParam(0, food_name); - DrawString(cargo_text_left, cargo_text_right, y += FONT_HEIGHT_NORMAL, STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH_REQUIRED); + DrawString(cargo_text_left, cargo_text_right, y += FONT_HEIGHT_NORMAL, required_text); } if (cargo_needed_for_growth > 1) { @@ -418,7 +420,7 @@ DrawString(cargo_text_left, cargo_text_right, y += FONT_HEIGHT_NORMAL, STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH_LAST_MONTH); } else { SetDParam(0, water_name); - DrawString(cargo_text_left, cargo_text_right, y += FONT_HEIGHT_NORMAL, STR_TOWN_VIEW_CARGO_FOR_TOWNGROWTH_REQUIRED); + DrawString(cargo_text_left, cargo_text_right, y += FONT_HEIGHT_NORMAL, required_text); } } }