From 1b5b4db690774279149703770e04ea884ed8bf28 Mon Sep 17 00:00:00 2001 From: alberth Date: Sun, 12 May 2013 19:38:30 +0000 Subject: (svn r25238) -Feature: Display imminent closure of an industry in its view window. --- src/industry_cmd.cpp | 1 + src/industry_gui.cpp | 5 +++++ src/lang/english.txt | 1 + 3 files changed, 7 insertions(+) diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 69d83ba14..c29a00820 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -2600,6 +2600,7 @@ static void ChangeIndustryProduction(Industry *i, bool monthly) /* Close if needed and allowed */ if (closeit && !CheckIndustryCloseDownProtection(i->type)) { i->prod_level = PRODLEVEL_CLOSURE; + SetWindowDirty(WC_INDUSTRY_VIEW, i->index); str = indspec->closure_text; } diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 9db4a5a94..1b79ebbd0 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -700,6 +700,11 @@ public: bool has_accept = false; char cargo_suffix[3][512]; + if (i->prod_level == PRODLEVEL_CLOSURE) { + DrawString(left + WD_FRAMERECT_LEFT, right - WD_FRAMERECT_RIGHT, y, STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE); + y += 2 * FONT_HEIGHT_NORMAL; + } + if (HasBit(ind->callback_mask, CBM_IND_PRODUCTION_CARGO_ARRIVAL) || HasBit(ind->callback_mask, CBM_IND_PRODUCTION_256_TICKS)) { GetAllCargoSuffixes(0, CST_VIEW, i, i->type, ind, i->accepts_cargo, cargo_suffix); for (byte j = 0; j < lengthof(i->accepts_cargo); j++) { diff --git a/src/lang/english.txt b/src/lang/english.txt index 390ceb8af..b3bcd5177 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -3098,6 +3098,7 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Producti STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{RAW_STRING}{BLACK} ({COMMA}% transported) STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Centre the main view on industry location. Ctrl+Click opens a new viewport on industry location STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Production level: {YELLOW}{COMMA}% +STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}The industry has announced imminent closure! ############ range for requires starts STR_INDUSTRY_VIEW_REQUIRES_CARGO :{BLACK}Requires: {YELLOW}{STRING}{RAW_STRING} -- cgit v1.2.3-70-g09d2