diff --git a/DayTimeMoneyBoxThaiFormat.cs b/DayTimeMoneyBoxThaiFormat.cs index 8d87a3b..f6e58fe 100644 --- a/DayTimeMoneyBoxThaiFormat.cs +++ b/DayTimeMoneyBoxThaiFormat.cs @@ -51,8 +51,13 @@ public static void PrefixDrawTextWithShadow(SpriteBatch b, ref string text, Spri //line:297: Utility.drawTextWithShadow(b, dateText, if (CallStack_drawTextWithShadow_Count == 2) { - text = LocalizedContentManager.FormatTimeString(Game1.timeOfDay, - LocalizedContentManager.CurrentModLanguage.TimeFormat).ToString(); + // the HUD clock should use ClockTimeFormat (like desktop DayTimeMoneyBox does), + // falling back to TimeFormat if the language pack doesn't define it + var modLanguage = LocalizedContentManager.CurrentModLanguage; + var format = !string.IsNullOrWhiteSpace(modLanguage.ClockTimeFormat) + ? modLanguage.ClockTimeFormat + : modLanguage.TimeFormat; + text = LocalizedContentManager.FormatTimeString(Game1.timeOfDay, format).ToString(); } } diff --git a/ModEntry.cs b/ModEntry.cs index 5489cab..1242f1a 100644 --- a/ModEntry.cs +++ b/ModEntry.cs @@ -44,10 +44,12 @@ private void GameLoop_SaveLoaded(object? sender, StardewModdingAPI.Events.SaveLo if (LocalizedContentManager.CurrentLanguageCode != LocalizedContentManager.LanguageCode.mod) return; - // check if mod Thai then patch time format + // patch the HUD clock for any mod language that defines a time format + // (e.g. Thai ELL.StardewValleyTHAI, Ukrainian Pereclaw.ukrainizacija, ...) List modLanguages = Game1.content.Load>("Data\\AdditionalLanguages"); var targetModLanguage = modLanguages.FirstOrDefault(); - if (targetModLanguage?.Id == "ELL.StardewValleyTHAI") + if (!string.IsNullOrWhiteSpace(targetModLanguage?.ClockTimeFormat) + || !string.IsNullOrWhiteSpace(targetModLanguage?.TimeFormat)) DayTimeMoneyBoxThaiFormat.ApplyPatch(Instance.harmony); } }