mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
Add more information to getfulldate console command
This commit is contained in:
parent
397a30bffc
commit
c40ba9782c
@ -2809,7 +2809,13 @@ DEF_CONSOLE_CMD(ConGetFullDate)
|
||||
IConsolePrintF(CC_DEFAULT, "Tick counter: " OTTD_PRINTF64, _tick_counter);
|
||||
IConsolePrintF(CC_DEFAULT, "Tick counter (scaled): " OTTD_PRINTF64, _scaled_tick_counter);
|
||||
IConsolePrintF(CC_DEFAULT, "State ticks: " OTTD_PRINTF64 " (offset: " OTTD_PRINTF64 ")", _state_ticks.base(), DateDetail::_state_ticks_offset.base());
|
||||
IConsolePrintF(CC_DEFAULT, "Effective day length: %d", DayLengthFactor());
|
||||
IConsolePrintF(CC_DEFAULT, "Effective economy speed reduction factor: %d", DayLengthFactor());
|
||||
if (!CalTime::IsCalendarFrozen()) IConsolePrintF(CC_DEFAULT, "Ticks per calendar day: %d", TicksPerCalendarDay());
|
||||
if (_settings_time.time_in_minutes) {
|
||||
Ticks remainder = _settings_time.GetTickMinutesRemainder(_state_ticks);
|
||||
ClockFaceMinutes hhmm = _settings_time.ToTickMinutes(_state_ticks).ToClockFaceMinutes();
|
||||
IConsolePrintF(CC_DEFAULT, "Timetable time: %02d:%02d + %d ticks", hhmm.ClockHour(), hhmm.ClockMinute(), remainder);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -148,6 +148,11 @@ struct TimeSettings {
|
||||
return (ticks.base() / this->ticks_per_minute) + this->clock_offset;
|
||||
}
|
||||
|
||||
Ticks GetTickMinutesRemainder(StateTicks ticks) const
|
||||
{
|
||||
return static_cast<Ticks>((ticks.base() % this->ticks_per_minute));
|
||||
}
|
||||
|
||||
TickMinutes NowInTickMinutes() const
|
||||
{
|
||||
extern StateTicks _state_ticks;
|
||||
|
Loading…
Reference in New Issue
Block a user