mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-30 07:34:37 +01:00
Codechange: Make Price an enum class.
This commit is contained in:
committed by
rubidium42
parent
b556dc24b8
commit
322ce224b4
@@ -235,7 +235,7 @@ public:
|
||||
switch (widget) {
|
||||
case WID_TA_ACTION_INFO:
|
||||
if (this->sel_action != TownAction::End) {
|
||||
Money action_cost = _price[PR_TOWN_ACTION] * GetTownActionCost(this->sel_action) >> 8;
|
||||
Money action_cost = _price[Price::TownAction] * GetTownActionCost(this->sel_action) >> 8;
|
||||
bool affordable = Company::IsValidID(_local_company) && action_cost < GetAvailableMoney(_local_company);
|
||||
|
||||
DrawStringMultiLine(r.Shrink(WidgetDimensions::scaled.framerect),
|
||||
@@ -253,7 +253,7 @@ public:
|
||||
assert(size.width > padding.width && size.height > padding.height);
|
||||
Dimension d = {0, 0};
|
||||
for (TownAction i = {}; i != TownAction::End; ++i) {
|
||||
Money price = _price[PR_TOWN_ACTION] * GetTownActionCost(i) >> 8;
|
||||
Money price = _price[Price::TownAction] * GetTownActionCost(i) >> 8;
|
||||
d = maxdim(d, GetStringMultiLineBoundingBox(GetString(this->action_tooltips[to_underlying(i)], price), size));
|
||||
}
|
||||
d.width += padding.width;
|
||||
|
||||
Reference in New Issue
Block a user