* Updates the current signal variant used in the signal GUI * to the one adequate to current year. */
| 1988 | * to the one adequate to current year. |
| 1989 | */ |
| 1990 | void ResetSignalVariant(int32_t) |
| 1991 | { |
| 1992 | SignalVariant new_variant = (TimerGameCalendar::year < _settings_client.gui.semaphore_build_before ? SIG_SEMAPHORE : SIG_ELECTRIC); |
| 1993 | |
| 1994 | if (new_variant != _cur_signal_variant) { |
| 1995 | Window *w = FindWindowById(WC_BUILD_SIGNAL, 0); |
| 1996 | if (w != nullptr) { |
| 1997 | w->SetDirty(); |
| 1998 | w->RaiseWidget((_cur_signal_variant == SIG_ELECTRIC ? WID_BS_ELECTRIC_NORM : WID_BS_SEMAPHORE_NORM) + _cur_signal_type); |
| 1999 | } |
| 2000 | _cur_signal_variant = new_variant; |
| 2001 | } |
| 2002 | } |
| 2003 | |
| 2004 | static const IntervalTimer<TimerGameCalendar> _check_reset_signal({TimerGameCalendar::YEAR, TimerGameCalendar::Priority::NONE}, [](auto) |
| 2005 | { |
no test coverage detected