| 80 | } |
| 81 | |
| 82 | void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override |
| 83 | { |
| 84 | Dimension d; |
| 85 | switch (widget) { |
| 86 | case WID_S_LEFT: |
| 87 | d = GetStringBoundingBox(GetString(STR_JUST_DATE_LONG, GetParamMaxValue(TimerGameCalendar::DateAtStartOfYear(CalendarTime::MAX_YEAR).base()))); |
| 88 | break; |
| 89 | |
| 90 | case WID_S_RIGHT: { |
| 91 | int64_t max_money = UINT32_MAX; |
| 92 | for (const Company *c : Company::Iterate()) max_money = std::max<int64_t>(c->money, max_money); |
| 93 | d = GetStringBoundingBox(GetString(STR_JUST_CURRENCY_LONG, 100LL * max_money)); |
| 94 | break; |
| 95 | } |
| 96 | |
| 97 | default: |
| 98 | return; |
| 99 | } |
| 100 | |
| 101 | d.width += padding.width; |
| 102 | d.height += padding.height; |
| 103 | size = maxdim(d, size); |
| 104 | } |
| 105 | |
| 106 | void DrawWidget(const Rect &r, WidgetID widget) const override |
| 107 | { |
nothing calls this directly
no test coverage detected