Show calendar date/time in the world HUD; base speed 3 in-game min/sec

Bump the engine submodule to 4b91b60 (calendar time of day) and display
the current date and time in the world HUD (День N, HH:MM) instead of just
the day number. Set the day length to 480 scaled seconds so the base (x1)
speed runs at 3 in-game minutes per real second.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Leonid Pershin
2026-06-12 13:10:23 +03:00
co-authored by Claude Opus 4.8
parent aab59723d3
commit 26e234a35e
5 changed files with 16 additions and 10 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
{ {
"hud.world": "LittleSim | seed {0} | day {1} | {2} FPS", "hud.world": "LittleSim | seed {0} | {1} | {2} FPS",
"hud.datetime": "day {0}, {1:00}:{2:00}",
"hud.controls": "WASD — camera, wheel — zoom, ` — console, F1 — inspector", "hud.controls": "WASD — camera, wheel — zoom, ` — console, F1 — inspector",
"hud.paused": "PAUSED", "hud.paused": "PAUSED",
+2 -1
View File
@@ -1,5 +1,6 @@
{ {
"hud.world": "LittleSim | сид {0} | день {1} | {2} FPS", "hud.world": "LittleSim | сид {0} | {1} | {2} FPS",
"hud.datetime": "день {0}, {1:00}:{2:00}",
"hud.controls": "WASD — камера, колесо — зум, ` — консоль, F1 — инспектор", "hud.controls": "WASD — камера, колесо — зум, ` — консоль, F1 — инспектор",
"hud.paused": "ПАУЗА", "hud.paused": "ПАУЗА",
+1 -1
Submodule engine updated: 44019a706e...4b91b60f38
+5 -2
View File
@@ -31,8 +31,11 @@ public sealed class WorldScene : Scene
{ {
public const int CellSize = 16; public const int CellSize = 16;
/// <summary>Сколько секунд масштабированного времени длится один игровой день.</summary> /// <summary>
public const float SecondsPerDay = 30f; /// Сколько секунд масштабированного времени длится один игровой день. База (x1) — 3 игровые
/// минуты за 1 реальную секунду: сутки = 1440 мин ÷ 3 = 480 с.
/// </summary>
public const float SecondsPerDay = 480f;
private readonly WorldConfig _config; private readonly WorldConfig _config;
private readonly WorldSave? _save; private readonly WorldSave? _save;
+6 -5
View File
@@ -161,8 +161,8 @@ public sealed class GodCameraSystem(
} }
/// <summary> /// <summary>
/// Строка статуса в HUD: заголовок сцены (ключ локализации с сидом, днём календаря и FPS) /// Строка статуса в HUD: заголовок сцены (ключ локализации с сидом, датой/временем календаря и
/// и подсказка управления. Обновляется 4 раза в секунду; смена языка подхватывается сама. /// FPS) и подсказка управления. Обновляется 4 раза в секунду; смена языка подхватывается сама.
/// </summary> /// </summary>
public sealed class HudSystem( public sealed class HudSystem(
MrGameEng.Core.EngineContext context, MrGameEng.Core.EngineContext context,
@@ -188,9 +188,10 @@ public sealed class HudSystem(
var fps = (int)MathF.Round(_frames / _accumulated); var fps = (int)MathF.Round(_frames / _accumulated);
_accumulated = 0f; _accumulated = 0f;
_frames = 0; _frames = 0;
var when = calendar is null
? ""
: languages.Format("hud.datetime", calendar.Day, calendar.Hour, calendar.Minute);
label.Text = label.Text =
languages.Format(titleKey, seed, calendar?.Day ?? 0, fps) languages.Format(titleKey, seed, when, fps) + "\n" + languages.Get("hud.controls");
+ "\n"
+ languages.Get("hud.controls");
} }
} }