From 26e234a35e013bc99d597e76b7d078f6f36e1ac8 Mon Sep 17 00:00:00 2001 From: Leonid Pershin Date: Fri, 12 Jun 2026 13:10:23 +0300 Subject: [PATCH] Show calendar date/time in the world HUD; base speed 3 in-game min/sec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- Mods/Core/Languages/en/ui.json | 3 ++- Mods/Core/Languages/ru/ui.json | 3 ++- engine | 2 +- src/LittleSim/Scenes/WorldScene.cs | 7 +++++-- src/LittleSim/Sim/SimSystems.cs | 11 ++++++----- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Mods/Core/Languages/en/ui.json b/Mods/Core/Languages/en/ui.json index 02ee9c0..57e4aaa 100644 --- a/Mods/Core/Languages/en/ui.json +++ b/Mods/Core/Languages/en/ui.json @@ -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.paused": "PAUSED", diff --git a/Mods/Core/Languages/ru/ui.json b/Mods/Core/Languages/ru/ui.json index da10f37..fd95518 100644 --- a/Mods/Core/Languages/ru/ui.json +++ b/Mods/Core/Languages/ru/ui.json @@ -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.paused": "ПАУЗА", diff --git a/engine b/engine index 44019a7..4b91b60 160000 --- a/engine +++ b/engine @@ -1 +1 @@ -Subproject commit 44019a706ebfc3f648d79a24ac790f00c8ae5795 +Subproject commit 4b91b60f3887c56076122e85afbcbd5646866ccc diff --git a/src/LittleSim/Scenes/WorldScene.cs b/src/LittleSim/Scenes/WorldScene.cs index 0b184d1..6ee589c 100644 --- a/src/LittleSim/Scenes/WorldScene.cs +++ b/src/LittleSim/Scenes/WorldScene.cs @@ -31,8 +31,11 @@ public sealed class WorldScene : Scene { public const int CellSize = 16; - /// Сколько секунд масштабированного времени длится один игровой день. - public const float SecondsPerDay = 30f; + /// + /// Сколько секунд масштабированного времени длится один игровой день. База (x1) — 3 игровые + /// минуты за 1 реальную секунду: сутки = 1440 мин ÷ 3 = 480 с. + /// + public const float SecondsPerDay = 480f; private readonly WorldConfig _config; private readonly WorldSave? _save; diff --git a/src/LittleSim/Sim/SimSystems.cs b/src/LittleSim/Sim/SimSystems.cs index 5ac8537..76afa3e 100644 --- a/src/LittleSim/Sim/SimSystems.cs +++ b/src/LittleSim/Sim/SimSystems.cs @@ -161,8 +161,8 @@ public sealed class GodCameraSystem( } /// -/// Строка статуса в HUD: заголовок сцены (ключ локализации с сидом, днём календаря и FPS) -/// и подсказка управления. Обновляется 4 раза в секунду; смена языка подхватывается сама. +/// Строка статуса в HUD: заголовок сцены (ключ локализации с сидом, датой/временем календаря и +/// FPS) и подсказка управления. Обновляется 4 раза в секунду; смена языка подхватывается сама. /// public sealed class HudSystem( MrGameEng.Core.EngineContext context, @@ -188,9 +188,10 @@ public sealed class HudSystem( var fps = (int)MathF.Round(_frames / _accumulated); _accumulated = 0f; _frames = 0; + var when = calendar is null + ? "" + : languages.Format("hud.datetime", calendar.Day, calendar.Hour, calendar.Minute); label.Text = - languages.Format(titleKey, seed, calendar?.Day ?? 0, fps) - + "\n" - + languages.Get("hud.controls"); + languages.Format(titleKey, seed, when, fps) + "\n" + languages.Get("hud.controls"); } }