forked from mirror/OpenTTD
Codechange: Move date consts and functions to CalendarTime and TimerGameCalendar classes
This commit is contained in:
@@ -2751,7 +2751,7 @@ struct CustomCurrencyWindow : Window {
|
||||
this->SetWidgetDisabledState(WID_CC_RATE_DOWN, _custom_currency.rate == 1);
|
||||
this->SetWidgetDisabledState(WID_CC_RATE_UP, _custom_currency.rate == UINT16_MAX);
|
||||
this->SetWidgetDisabledState(WID_CC_YEAR_DOWN, _custom_currency.to_euro == CF_NOEURO);
|
||||
this->SetWidgetDisabledState(WID_CC_YEAR_UP, _custom_currency.to_euro == MAX_YEAR);
|
||||
this->SetWidgetDisabledState(WID_CC_YEAR_UP, _custom_currency.to_euro == CalendarTime::MAX_YEAR);
|
||||
}
|
||||
|
||||
void SetStringParameters(int widget) const override
|
||||
@@ -2850,8 +2850,8 @@ struct CustomCurrencyWindow : Window {
|
||||
break;
|
||||
|
||||
case WID_CC_YEAR_UP:
|
||||
_custom_currency.to_euro = Clamp(_custom_currency.to_euro + 1, MIN_EURO_YEAR, MAX_YEAR);
|
||||
if (_custom_currency.to_euro == MAX_YEAR) this->DisableWidget(WID_CC_YEAR_UP);
|
||||
_custom_currency.to_euro = Clamp(_custom_currency.to_euro + 1, MIN_EURO_YEAR, CalendarTime::MAX_YEAR);
|
||||
if (_custom_currency.to_euro == CalendarTime::MAX_YEAR) this->DisableWidget(WID_CC_YEAR_UP);
|
||||
this->EnableWidget(WID_CC_YEAR_DOWN);
|
||||
break;
|
||||
|
||||
@@ -2897,7 +2897,7 @@ struct CustomCurrencyWindow : Window {
|
||||
case WID_CC_YEAR: { // Year to switch to euro
|
||||
TimerGameCalendar::Year val = atoi(str);
|
||||
|
||||
_custom_currency.to_euro = (val < MIN_EURO_YEAR ? CF_NOEURO : std::min(val, MAX_YEAR));
|
||||
_custom_currency.to_euro = (val < MIN_EURO_YEAR ? CF_NOEURO : std::min(val, CalendarTime::MAX_YEAR));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user