(svn r16952) -Codechange: Use a label for the world population in the town directory window.

This commit is contained in:
alberth 2009-07-25 11:32:53 +00:00
parent 36a28fe3d2
commit e5bfc5660d
1 changed files with 12 additions and 9 deletions

View File

@ -497,7 +497,8 @@ enum TownDirectoryWidgets {
TDW_SORTPOPULATION, TDW_SORTPOPULATION,
TDW_CENTERTOWN, TDW_CENTERTOWN,
TDW_SCROLLBAR, TDW_SCROLLBAR,
TDW_EMPTYBOTTOM, TDW_BOTTOM_PANEL,
TDW_BOTTOM_TEXT,
TDW_RESIZEBOX, TDW_RESIZEBOX,
}; };
@ -515,12 +516,14 @@ static const NWidgetPart _nested_town_directory_widgets[] = {
EndContainer(), EndContainer(),
NWidget(WWT_PANEL, COLOUR_BROWN, TDW_CENTERTOWN), SetMinimalSize(196, 164), SetDataTip(0x0, STR_TOWN_DIRECTORY_LIST_TOOLTIP), NWidget(WWT_PANEL, COLOUR_BROWN, TDW_CENTERTOWN), SetMinimalSize(196, 164), SetDataTip(0x0, STR_TOWN_DIRECTORY_LIST_TOOLTIP),
SetFill(1, 0), SetResize(0, 10), EndContainer(), SetFill(1, 0), SetResize(0, 10), EndContainer(),
NWidget(WWT_PANEL, COLOUR_BROWN, TDW_BOTTOM_PANEL),
NWidget(WWT_TEXT, COLOUR_BROWN, TDW_BOTTOM_TEXT), SetPadding(2, 0, 0, 2), SetMinimalSize(196, 12), SetFill(1, 0), SetDataTip(STR_EMPTY, STR_NULL),
EndContainer(),
EndContainer(),
NWidget(NWID_VERTICAL),
NWidget(WWT_SCROLLBAR, COLOUR_BROWN, TDW_SCROLLBAR),
NWidget(WWT_RESIZEBOX, COLOUR_BROWN, TDW_RESIZEBOX),
EndContainer(), EndContainer(),
NWidget(WWT_SCROLLBAR, COLOUR_BROWN, TDW_SCROLLBAR),
EndContainer(),
NWidget(NWID_HORIZONTAL),
NWidget(WWT_PANEL, COLOUR_BROWN, TDW_EMPTYBOTTOM), SetMinimalSize(196, 12), SetFill(1, 0), EndContainer(),
NWidget(WWT_RESIZEBOX, COLOUR_BROWN, TDW_RESIZEBOX),
EndContainer(), EndContainer(),
}; };
@ -636,9 +639,9 @@ public:
} }
} break; } break;
case TDW_EMPTYBOTTOM: case TDW_BOTTOM_TEXT:
SetDParam(0, GetWorldPopulation()); SetDParam(0, GetWorldPopulation());
DrawString(r.left + 3, r.right - 3, r.top + 2, STR_TOWN_POPULATION); DrawString(r.left, r.right, r.top, STR_TOWN_POPULATION);
break; break;
} }
} }
@ -671,7 +674,7 @@ public:
resize->height = d.height; resize->height = d.height;
break; break;
} }
case TDW_EMPTYBOTTOM: { case TDW_BOTTOM_TEXT: {
SetDParam(0, 1000000000); // 10^9 SetDParam(0, 1000000000); // 10^9
Dimension d = GetStringBoundingBox(STR_TOWN_POPULATION); Dimension d = GetStringBoundingBox(STR_TOWN_POPULATION);
d.width += padding.width; d.width += padding.width;