From f1d3835242f25dc8d4520759ec8ad6f715ffa2aa Mon Sep 17 00:00:00 2001 From: dP Date: Fri, 17 Mar 2023 02:56:56 +0400 Subject: [PATCH] Show cargo and industry type ids in industry chains window in developer mode --- src/industry_gui.cpp | 18 ++++++++++++++++-- src/lang/english.txt | 3 +++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index d57a992f65..bcb21cdeb4 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -3143,7 +3143,14 @@ struct IndustryCargoesWindow : public Window { case WID_IC_CARGO_DROPDOWN: { DropDownList lst; for (const CargoSpec *cs : _sorted_standard_cargo_specs) { - lst.emplace_back(new DropDownListStringItem(cs->name, cs->Index(), false)); + if (_settings_client.gui.developer < 1) { + lst.emplace_back(new DropDownListStringItem(cs->name, cs->Index(), false)); + continue; + } + DropDownListParamStringItem *item = new DropDownListParamStringItem(CM_STR_CARGO_WITH_ID, cs->Index(), false); + item->SetParam(0, cs->name); + item->SetParam(1, cs->Index()); + lst.emplace_back(item); } if (!lst.empty()) { int selected = (this->ind_cargo >= NUM_INDUSTRYTYPES) ? (int)(this->ind_cargo - NUM_INDUSTRYTYPES) : -1; @@ -3157,7 +3164,14 @@ struct IndustryCargoesWindow : public Window { for (IndustryType ind : _sorted_industry_types) { const IndustrySpec *indsp = GetIndustrySpec(ind); if (!indsp->enabled) continue; - lst.emplace_back(new DropDownListStringItem(indsp->name, ind, false)); + if (_settings_client.gui.developer < 1) { + lst.emplace_back(new DropDownListStringItem(indsp->name, ind, false)); + continue; + } + DropDownListParamStringItem *item = new DropDownListParamStringItem(CM_STR_INDUSTRY_TYPE_WITH_ID, ind, false); + item->SetParam(0, indsp->name); + item->SetParam(1, ind); + lst.emplace_back(item); } if (!lst.empty()) { int selected = (this->ind_cargo < NUM_INDUSTRYTYPES) ? (int)this->ind_cargo : -1; diff --git a/src/lang/english.txt b/src/lang/english.txt index 687f29d841..1bdb853841 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -6055,3 +6055,6 @@ CM_STR_VIEWPORT_TOWN_TINY_MEDIOCRE_RATING :{TINY_FONT}{ORA CM_STR_VIEWPORT_TOWN_TINY_GOOD_RATING :{TINY_FONT}{YELLOW}{TOWN} CM_STR_VIEWPORT_TOWN_TINY_VERY_GOOD_RATING :{TINY_FONT}{WHITE}{TOWN} CM_STR_VIEWPORT_TOWN_TINY_EXCELLENT_RATING :{TINY_FONT}{GREEN}{TOWN} + +CM_STR_CARGO_WITH_ID :{STRING} {SILVER}#{NUM} +CM_STR_INDUSTRY_TYPE_WITH_ID :{STRING} {SILVER}#{NUM}