mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
Add: Show count of towns and industries in their directory window captions. (#12800)
These windows now show "(<visible> of <total>)" in the caption.
This commit is contained in:
parent
7116f143d5
commit
e802c1a97f
@ -1233,7 +1233,7 @@ void ShowIndustryViewWindow(int industry)
|
||||
static constexpr NWidgetPart _nested_industry_directory_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
|
||||
NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_INDUSTRY_DIRECTORY_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
NWidget(WWT_CAPTION, COLOUR_BROWN, WID_ID_CAPTION), SetDataTip(STR_INDUSTRY_DIRECTORY_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
NWidget(WWT_SHADEBOX, COLOUR_BROWN),
|
||||
NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN),
|
||||
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
|
||||
@ -1667,6 +1667,11 @@ public:
|
||||
void SetStringParameters(WidgetID widget) const override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_ID_CAPTION:
|
||||
SetDParam(0, this->vscroll->GetCount());
|
||||
SetDParam(1, Industry::GetNumItems());
|
||||
break;
|
||||
|
||||
case WID_ID_DROPDOWN_CRITERIA:
|
||||
SetDParam(0, IndustryDirectoryWindow::sorter_names[this->industries.SortType()]);
|
||||
break;
|
||||
|
@ -3616,7 +3616,7 @@ STR_EDIT_SIGN_PREVIOUS_SIGN_TOOLTIP :{BLACK}Go to pr
|
||||
STR_EDIT_SIGN_SIGN_OSKTITLE :{BLACK}Enter a name for the sign
|
||||
|
||||
# Town directory window
|
||||
STR_TOWN_DIRECTORY_CAPTION :{WHITE}Towns
|
||||
STR_TOWN_DIRECTORY_CAPTION :{WHITE}Towns ({COMMA} of {COMMA})
|
||||
STR_TOWN_DIRECTORY_NONE :{ORANGE}- None -
|
||||
STR_TOWN_DIRECTORY_TOWN :{ORANGE}{TOWN}{BLACK} ({COMMA})
|
||||
STR_TOWN_DIRECTORY_CITY :{ORANGE}{TOWN}{YELLOW} (City){BLACK} ({COMMA})
|
||||
@ -3950,7 +3950,7 @@ STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL_YEAR :{WHITE}{CURRENC
|
||||
STR_COMPANY_INFRASTRUCTURE_VIEW_TOTAL_PERIOD :{WHITE}{CURRENCY_LONG}/period
|
||||
|
||||
# Industry directory
|
||||
STR_INDUSTRY_DIRECTORY_CAPTION :{WHITE}Industries
|
||||
STR_INDUSTRY_DIRECTORY_CAPTION :{WHITE}Industries ({COMMA} of {COMMA})
|
||||
STR_INDUSTRY_DIRECTORY_NONE :{ORANGE}- None -
|
||||
STR_INDUSTRY_DIRECTORY_ITEM_INFO :{BLACK}{CARGO_LONG}{RAW_STRING}{YELLOW} ({COMMA}% transported){BLACK}
|
||||
STR_INDUSTRY_DIRECTORY_ITEM_NOPROD :{ORANGE}{INDUSTRY}
|
||||
|
@ -686,7 +686,7 @@ void ShowTownViewWindow(TownID town)
|
||||
static constexpr NWidgetPart _nested_town_directory_widgets[] = {
|
||||
NWidget(NWID_HORIZONTAL),
|
||||
NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
|
||||
NWidget(WWT_CAPTION, COLOUR_BROWN), SetDataTip(STR_TOWN_DIRECTORY_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
NWidget(WWT_CAPTION, COLOUR_BROWN, WID_TD_CAPTION), SetDataTip(STR_TOWN_DIRECTORY_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
|
||||
NWidget(WWT_SHADEBOX, COLOUR_BROWN),
|
||||
NWidget(WWT_DEFSIZEBOX, COLOUR_BROWN),
|
||||
NWidget(WWT_STICKYBOX, COLOUR_BROWN),
|
||||
@ -819,6 +819,11 @@ public:
|
||||
void SetStringParameters(WidgetID widget) const override
|
||||
{
|
||||
switch (widget) {
|
||||
case WID_TD_CAPTION:
|
||||
SetDParam(0, this->vscroll->GetCount());
|
||||
SetDParam(1, Town::GetNumItems());
|
||||
break;
|
||||
|
||||
case WID_TD_WORLD_POPULATION:
|
||||
SetDParam(0, GetWorldPopulation());
|
||||
break;
|
||||
|
@ -33,6 +33,7 @@ enum IndustryViewWidgets : WidgetID {
|
||||
|
||||
/** Widgets of the #IndustryDirectoryWindow class. */
|
||||
enum IndustryDirectoryWidgets : WidgetID {
|
||||
WID_ID_CAPTION, ///< Caption of the window.
|
||||
WID_ID_DROPDOWN_ORDER, ///< Dropdown for the order of the sort.
|
||||
WID_ID_DROPDOWN_CRITERIA, ///< Dropdown for the criteria of the sort.
|
||||
WID_ID_FILTER_BY_ACC_CARGO, ///< Accepted cargo filter dropdown list.
|
||||
|
@ -12,6 +12,7 @@
|
||||
|
||||
/** Widgets of the #TownDirectoryWindow class. */
|
||||
enum TownDirectoryWidgets : WidgetID {
|
||||
WID_TD_CAPTION, ///< Caption of the window.
|
||||
WID_TD_SORT_ORDER, ///< Direction of sort dropdown.
|
||||
WID_TD_SORT_CRITERIA, ///< Criteria of sort dropdown.
|
||||
WID_TD_FILTER, ///< Filter of name.
|
||||
|
Loading…
Reference in New Issue
Block a user