| 231 | } |
| 232 | |
| 233 | void DrawWidget(const Rect &r, WidgetID widget) const override |
| 234 | { |
| 235 | switch (widget) { |
| 236 | case WID_TA_ACTION_INFO: |
| 237 | if (this->sel_action != TownAction::End) { |
| 238 | Money action_cost = _price[PR_TOWN_ACTION] * GetTownActionCost(this->sel_action) >> 8; |
| 239 | bool affordable = Company::IsValidID(_local_company) && action_cost < GetAvailableMoney(_local_company); |
| 240 | |
| 241 | DrawStringMultiLine(r.Shrink(WidgetDimensions::scaled.framerect), |
| 242 | GetString(this->action_tooltips[to_underlying(this->sel_action)], action_cost), |
| 243 | affordable ? TC_YELLOW : TC_RED); |
| 244 | } |
| 245 | break; |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override |
| 250 | { |
nothing calls this directly
no test coverage detected