Show town count in town directory window
This commit is contained in:
@@ -2105,3 +2105,5 @@ STR_COMPANY_VIEW_SELL_SHARE_TOOLTIP :{BLACK}Sell 25%
|
|||||||
STR_ERROR_CAN_T_BUY_25_SHARE_IN_THIS :{WHITE}Can't buy 25% share in this company...
|
STR_ERROR_CAN_T_BUY_25_SHARE_IN_THIS :{WHITE}Can't buy 25% share in this company...
|
||||||
STR_ERROR_CAN_T_SELL_25_SHARE_IN :{WHITE}Can't sell 25% share in this company...
|
STR_ERROR_CAN_T_SELL_25_SHARE_IN :{WHITE}Can't sell 25% share in this company...
|
||||||
STR_ERROR_PROTECTED :{WHITE}This company is not old enough to trade shares yet...
|
STR_ERROR_PROTECTED :{WHITE}This company is not old enough to trade shares yet...
|
||||||
|
|
||||||
|
STR_TOWN_DIRECTORY_INFO :{BLACK}{STRING1}, Towns: {COMMA}
|
||||||
|
@@ -872,7 +872,7 @@ static const NWidgetPart _nested_town_directory_widgets[] = {
|
|||||||
NWidget(WWT_PANEL, COLOUR_BROWN, WID_TD_LIST), SetDataTip(0x0, STR_TOWN_DIRECTORY_LIST_TOOLTIP),
|
NWidget(WWT_PANEL, COLOUR_BROWN, WID_TD_LIST), SetDataTip(0x0, STR_TOWN_DIRECTORY_LIST_TOOLTIP),
|
||||||
SetFill(1, 0), SetResize(1, 1), SetScrollbar(WID_TD_SCROLLBAR), EndContainer(),
|
SetFill(1, 0), SetResize(1, 1), SetScrollbar(WID_TD_SCROLLBAR), EndContainer(),
|
||||||
NWidget(WWT_PANEL, COLOUR_BROWN),
|
NWidget(WWT_PANEL, COLOUR_BROWN),
|
||||||
NWidget(WWT_TEXT, COLOUR_BROWN, WID_TD_WORLD_POPULATION), SetPadding(2, 0, 2, 2), SetMinimalTextLines(1, 0), SetFill(1, 0), SetResize(1, 0), SetDataTip(STR_TOWN_POPULATION, STR_NULL),
|
NWidget(WWT_TEXT, COLOUR_BROWN, WID_TD_WORLD_POPULATION), SetPadding(2, 0, 2, 2), SetMinimalTextLines(1, 0), SetFill(1, 0), SetResize(1, 0), SetDataTip(STR_TOWN_DIRECTORY_INFO, STR_NULL),
|
||||||
EndContainer(),
|
EndContainer(),
|
||||||
EndContainer(),
|
EndContainer(),
|
||||||
NWidget(NWID_VERTICAL),
|
NWidget(NWID_VERTICAL),
|
||||||
@@ -982,7 +982,9 @@ public:
|
|||||||
{
|
{
|
||||||
switch (widget) {
|
switch (widget) {
|
||||||
case WID_TD_WORLD_POPULATION:
|
case WID_TD_WORLD_POPULATION:
|
||||||
SetDParam(0, GetWorldPopulation());
|
SetDParam(0, STR_TOWN_POPULATION);
|
||||||
|
SetDParam(1, GetWorldPopulation());
|
||||||
|
SetDParam(2, Town::GetNumItems());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WID_TD_SORT_CRITERIA:
|
case WID_TD_SORT_CRITERIA:
|
||||||
@@ -1090,8 +1092,10 @@ public:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WID_TD_WORLD_POPULATION: {
|
case WID_TD_WORLD_POPULATION: {
|
||||||
SetDParamMaxDigits(0, 10);
|
SetDParam(0, STR_TOWN_POPULATION);
|
||||||
Dimension d = GetStringBoundingBox(STR_TOWN_POPULATION);
|
SetDParamMaxDigits(1, 10);
|
||||||
|
SetDParamMaxDigits(2, 5);
|
||||||
|
Dimension d = GetStringBoundingBox(STR_TOWN_DIRECTORY_INFO);
|
||||||
d.width += padding.width;
|
d.width += padding.width;
|
||||||
d.height += padding.height;
|
d.height += padding.height;
|
||||||
*size = maxdim(*size, d);
|
*size = maxdim(*size, d);
|
||||||
|
Reference in New Issue
Block a user