From b4353739835e006a25701e1c2e0677e139769a8e Mon Sep 17 00:00:00 2001 From: Quantumrunner <58113888+Quantumrunner@users.noreply.github.com> Date: Mon, 12 Jan 2026 20:36:56 +0100 Subject: [PATCH 1/2] Added logic to select language for basic content pack. --- unity/Assets/Scripts/Content/ContentTypes.cs | 7 ++--- unity/Assets/Scripts/GameStateManager.cs | 9 ++++--- unity/Assets/Scripts/GameType.cs | 26 +++++++++++++++++-- .../Assets/Scripts/QuestEditor/ToolsButton.cs | 22 +++++++++++----- .../Scripts/UI/Screens/ContentSelectScreen.cs | 2 +- unity/Assets/Scripts/ValkyrieConstants.cs | 6 ++++- .../content/D2E/base/content_pack.ini | 8 +++--- .../content/MoM/base/content_pack.ini | 7 ++--- 8 files changed, 64 insertions(+), 23 deletions(-) diff --git a/unity/Assets/Scripts/Content/ContentTypes.cs b/unity/Assets/Scripts/Content/ContentTypes.cs index 93cd4cbfc..d3e407112 100644 --- a/unity/Assets/Scripts/Content/ContentTypes.cs +++ b/unity/Assets/Scripts/Content/ContentTypes.cs @@ -1,4 +1,4 @@ - + // Class for tile specific data using System; @@ -10,10 +10,11 @@ using ValkyrieTools; using System.Globalization; using Random = UnityEngine.Random; +using Assets.Scripts; public class PackTypeData : GenericData { - public static new string type = "PackType"; + public static new string type = ValkyrieConstants.PackType; public PackTypeData(string name, Dictionary content, string path, List sets = null) : base(name, content, path, type, sets) { @@ -653,4 +654,4 @@ public PerilData(string name, Dictionary data) : base(name, data perilText = new StringKey(data["text"]); } } -} \ No newline at end of file +} diff --git a/unity/Assets/Scripts/GameStateManager.cs b/unity/Assets/Scripts/GameStateManager.cs index fe6eddd49..8f6870c8a 100644 --- a/unity/Assets/Scripts/GameStateManager.cs +++ b/unity/Assets/Scripts/GameStateManager.cs @@ -1,4 +1,4 @@ -using System; +using System; using Assets.Scripts.UI.Screens; using ValkyrieTools; @@ -13,8 +13,11 @@ public static void MainMenu() Game game = Game.Get(); // All content data has been loaded by editor, cleanup everything ContentLoader.GetContentData(game); + + string baseContentPackId = game.gameType.BaseContentPackId(); + // Load the base content - pack will be loaded later if required - game.ContentLoader.LoadContentID(""); + game.ContentLoader.LoadContentID(baseContentPackId); new MainMenuScreen(); } @@ -123,4 +126,4 @@ private static bool GetCurrentQuest(Game game, out QuestData.Quest currentQuest) currentQuest = new QuestData.Quest(questPath); return true; } -} \ No newline at end of file +} diff --git a/unity/Assets/Scripts/GameType.cs b/unity/Assets/Scripts/GameType.cs index a1003b8ce..d6137a63e 100644 --- a/unity/Assets/Scripts/GameType.cs +++ b/unity/Assets/Scripts/GameType.cs @@ -1,4 +1,5 @@ -using Assets.Scripts.Content; +using Assets.Scripts; +using Assets.Scripts.Content; using System; using UnityEngine; @@ -6,6 +7,7 @@ public abstract class GameType { public abstract string DataDirectory(); + public abstract string BaseContentPackId(); public abstract StringKey HeroName(); public abstract StringKey HeroesName(); public abstract StringKey QuestName(); @@ -34,6 +36,11 @@ public override string DataDirectory() return ContentData.ContentPath(); } + public override string BaseContentPackId() + { + return ""; + } + public override StringKey HeroName() { return new StringKey("val","D2E_HERO_NAME"); @@ -125,6 +132,11 @@ public override string DataDirectory() return ContentData.ContentPath() + "D2E/"; } + public override string BaseContentPackId() + { + return ValkyrieConstants.BaseGameIdContentPackDescent; + } + public override StringKey HeroName() { return new StringKey("val", "D2E_HERO_NAME"); @@ -214,6 +226,11 @@ public override string DataDirectory() return ContentData.ContentPath() + "MoM/"; } + public override string BaseContentPackId() + { + return ValkyrieConstants.BaseGameIdContentPackMansionsOfMadness; + } + public override StringKey HeroName() { return new StringKey("val", "MOM_HERO_NAME"); @@ -303,6 +320,11 @@ public override bool MonstersGrouped() // Things for IA public class IAGameType : GameType { + public override string BaseContentPackId() + { + return "BaseIA"; + } + public override string DataDirectory() { return ContentData.ContentPath() + "IA/"; @@ -387,4 +409,4 @@ public override bool MonstersGrouped() { return false; } -} \ No newline at end of file +} diff --git a/unity/Assets/Scripts/QuestEditor/ToolsButton.cs b/unity/Assets/Scripts/QuestEditor/ToolsButton.cs index 5dd458aa0..cc8fe235d 100644 --- a/unity/Assets/Scripts/QuestEditor/ToolsButton.cs +++ b/unity/Assets/Scripts/QuestEditor/ToolsButton.cs @@ -1,8 +1,9 @@ -using UnityEngine; +using UnityEngine; using System.Collections.Generic; using Assets.Scripts.Content; using Assets.Scripts.UI.Screens; using Assets.Scripts.UI; +using Assets.Scripts; // Special class for the Menu button present while in a quest public class ToolsButton @@ -12,12 +13,14 @@ public class ToolsButton public ToolsButton() { Game game = Game.Get(); - if (!game.editMode) return; + if (!game.editMode) + return; UIElement ui = new UIElement(Game.QUESTUI); ui.SetLocation(UIScaler.GetRight(-6), 0, 6, 1); ui.SetText(new StringKey("val", "COMPONENTS")); - ui.SetButton(delegate { QuestEditorData.TypeSelect(); }); + ui.SetButton(delegate + { QuestEditorData.TypeSelect(); }); new UIElementBorder(ui); ui = new UIElement(Game.QUESTUI); @@ -37,7 +40,8 @@ public ToolsButton() public void Test() { - if (GameObject.FindGameObjectWithTag(Game.DIALOG) != null) return; + if (GameObject.FindGameObjectWithTag(Game.DIALOG) != null) + return; Game game = Game.Get(); int min = game.CurrentQuest.qd.quest.minHero; @@ -55,8 +59,10 @@ public void Test() heroCount = min; } - if (heroCount < min) heroCount = min; - if (heroCount > max) heroCount = max; + if (heroCount < min) + heroCount = min; + if (heroCount > max) + heroCount = max; DrawHeroSelection(); } @@ -170,7 +176,9 @@ public void StartTest() // All content data has been loaded by editor, cleanup everything game.cd = new ContentData(game.gameType.DataDirectory()); // Load the base content - game.ContentLoader.LoadContentID(""); + string basecontentPackId = game.gameType.BaseContentPackId(); + game.ContentLoader.LoadContentID(basecontentPackId); + // Load current configuration Dictionary packs = game.config.data.Get(game.gameType.TypeName() + "Packs"); if (packs != null) diff --git a/unity/Assets/Scripts/UI/Screens/ContentSelectScreen.cs b/unity/Assets/Scripts/UI/Screens/ContentSelectScreen.cs index 2d7ba2682..1b525f71a 100644 --- a/unity/Assets/Scripts/UI/Screens/ContentSelectScreen.cs +++ b/unity/Assets/Scripts/UI/Screens/ContentSelectScreen.cs @@ -61,7 +61,7 @@ public void DrawTypeList() // Note this is currently unordered foreach (PackTypeData type in game.cd.Values()) { - string typeId = type.sectionName.Substring("PackType".Length); + string typeId = type.sectionName.Substring(ValkyrieConstants.PackType.Length); //skip custom category if it was added for some reason if (typeId.Equals(typeIdCustom, StringComparison.OrdinalIgnoreCase)) diff --git a/unity/Assets/Scripts/ValkyrieConstants.cs b/unity/Assets/Scripts/ValkyrieConstants.cs index dfa811a6b..e14faf298 100644 --- a/unity/Assets/Scripts/ValkyrieConstants.cs +++ b/unity/Assets/Scripts/ValkyrieConstants.cs @@ -1,5 +1,6 @@ -using Assets.Scripts.Content; +using Assets.Scripts.Content; using System; +using System.Collections.Generic; namespace Assets.Scripts { @@ -27,5 +28,8 @@ private ValkyrieConstants() public const string QuestIniFilePath = "/quest.ini"; public const string RemoteContentPackIniType = "RemoteContentPack"; public const string ContentPackIniFile = "content_pack.ini"; + public const string BaseGameIdContentPackDescent = "D2EBase"; + public const string BaseGameIdContentPackMansionsOfMadness = "MoMBase"; + public const string PackType = "PackType"; } } diff --git a/unity/Assets/StreamingAssets/content/D2E/base/content_pack.ini b/unity/Assets/StreamingAssets/content/D2E/base/content_pack.ini index 9a99adbf1..504857ee8 100644 --- a/unity/Assets/StreamingAssets/content/D2E/base/content_pack.ini +++ b/unity/Assets/StreamingAssets/content/D2E/base/content_pack.ini @@ -1,8 +1,10 @@ ; content packs include a content header ini which has: [ContentPack] -name=Descent Journeys in the Dark Second Edition -; Optional description -description=Base Game, required to play +name={ffg:PRODUCT_DJ01_TITLE} +description={ffg:PRODUCT_DJ01_DESCRIPTION} +image="{import}/img/DJ01_CoreSet" +id=D2EBase +type=box [PackTypebox] name=Boxed Expansions diff --git a/unity/Assets/StreamingAssets/content/MoM/base/content_pack.ini b/unity/Assets/StreamingAssets/content/MoM/base/content_pack.ini index dccb081d1..e04eb02df 100644 --- a/unity/Assets/StreamingAssets/content/MoM/base/content_pack.ini +++ b/unity/Assets/StreamingAssets/content/MoM/base/content_pack.ini @@ -1,9 +1,10 @@ ; content packs include a content header ini which has: [ContentPack] name={ffg:PRODUCT_TITLE_MAD20} - -; Optional description -description=Base Game, required to play +description={ffg:PRODUCT_TITLE_MAD20} +image="{import}/img/MAD20" +id=MoMBase +type=box [PackTypebox] name={pck:BOXED} From 0a962c3e552b51ccb86b1f2623d2e2b7686cfd63 Mon Sep 17 00:00:00 2001 From: Quantumrunner <58113888+Quantumrunner@users.noreply.github.com> Date: Mon, 12 Jan 2026 20:50:53 +0100 Subject: [PATCH 2/2] Added logic to prevent base game can be deselected and marked basegame as required. --- .../Scripts/Content/CommonStringKeys.cs | 1 + .../Scripts/UI/Screens/ContentSelectScreen.cs | 20 +++++++++++++++++-- .../text/Localization.Chinese.txt | 1 + .../text/Localization.Czech.txt | 1 + .../text/Localization.English.txt | 1 + .../text/Localization.French.txt | 1 + .../text/Localization.German.txt | 1 + .../text/Localization.Italian.txt | 1 + .../text/Localization.Japanese.txt | 1 + .../text/Localization.Korean.txt | 1 + .../text/Localization.Polish.txt | 2 +- .../text/Localization.Portuguese.txt | 2 +- .../text/Localization.Russian.txt | 1 + .../text/Localization.Spanish.txt | 1 + 14 files changed, 31 insertions(+), 4 deletions(-) diff --git a/unity/Assets/Scripts/Content/CommonStringKeys.cs b/unity/Assets/Scripts/Content/CommonStringKeys.cs index 5e396cf9f..66db5b59d 100644 --- a/unity/Assets/Scripts/Content/CommonStringKeys.cs +++ b/unity/Assets/Scripts/Content/CommonStringKeys.cs @@ -91,6 +91,7 @@ public class CommonStringKeys public static readonly StringKey RESET = new StringKey(VAL, "RESET"); public static readonly StringKey LOADINGSCENARIOS = new StringKey(VAL, "LOADINGSCENARIOS"); public static readonly StringKey LOADINGCONTENTPACKS = new StringKey(VAL, "LOADINGCONTENTPACKS"); + public static readonly StringKey REQUIRED = new StringKey(VAL, "REQUIRED"); } } diff --git a/unity/Assets/Scripts/UI/Screens/ContentSelectScreen.cs b/unity/Assets/Scripts/UI/Screens/ContentSelectScreen.cs index 1b525f71a..b2db38878 100644 --- a/unity/Assets/Scripts/UI/Screens/ContentSelectScreen.cs +++ b/unity/Assets/Scripts/UI/Screens/ContentSelectScreen.cs @@ -229,7 +229,10 @@ public void DrawList(string type = "") string id = cp.id; buttons.Add(id, new List()); Color bgColor = Color.white; - if (!selected.Contains(id)) + string baseContentPackId = game.gameType.BaseContentPackId(); + bool isBaseContentPack = baseContentPackId.Equals(id); + + if (!isBaseContentPack && !selected.Contains(id)) { bgColor = new Color(0.3f, 0.3f, 0.3f); } @@ -301,7 +304,14 @@ public void DrawList(string type = "") } ui.SetBGColor(bgColor); - ui.SetText("(" + game.cd.GetContentAcronym(id) + ")", Color.black); + if (isBaseContentPack) + { + ui.SetText("(" + CommonStringKeys.REQUIRED.Translate() + ")", Color.red); + } + else + { + ui.SetText("(" + game.cd.GetContentAcronym(id) + ")", Color.black); + } ui.SetTextAlignment(TextAnchor.MiddleLeft); ui.SetFont(game.gameType.GetSymbolFont()); ui.SetFontSize(text_font_size); @@ -428,6 +438,12 @@ public void Select(string id) var packs = game.config.GetPacks(game.gameType.TypeName()).ToSet(); if (packs.Contains(id)) { + string baseContentPackId = game.gameType.BaseContentPackId(); + // Base game content cannot be deselected + if (baseContentPackId.Equals(id)) + { + return; + } game.config.RemovePack(game.gameType.TypeName(), id); } else diff --git a/unity/Assets/StreamingAssets/text/Localization.Chinese.txt b/unity/Assets/StreamingAssets/text/Localization.Chinese.txt index b63cdc353..f032d94c8 100644 --- a/unity/Assets/StreamingAssets/text/Localization.Chinese.txt +++ b/unity/Assets/StreamingAssets/text/Localization.Chinese.txt @@ -494,3 +494,4 @@ FADE_SLOW,慢 CLICK_BEHAVIOR,点击行为 CLICK_BLINK,闪烁 / 触发事件 CLICK_STATIC,静态 / 无事件 +REQUIRED,必须 diff --git a/unity/Assets/StreamingAssets/text/Localization.Czech.txt b/unity/Assets/StreamingAssets/text/Localization.Czech.txt index 7d2ed32c1..b13ec26f6 100644 --- a/unity/Assets/StreamingAssets/text/Localization.Czech.txt +++ b/unity/Assets/StreamingAssets/text/Localization.Czech.txt @@ -689,3 +689,4 @@ FADE_SLOW,Pomalu CLICK_BEHAVIOR,Chování při kliknutí CLICK_BLINK,Blikání / spustit událost CLICK_STATIC,Statické / Žádná událost +REQUIRED,Vyžadováno diff --git a/unity/Assets/StreamingAssets/text/Localization.English.txt b/unity/Assets/StreamingAssets/text/Localization.English.txt index 3c3798042..624174d96 100644 --- a/unity/Assets/StreamingAssets/text/Localization.English.txt +++ b/unity/Assets/StreamingAssets/text/Localization.English.txt @@ -686,3 +686,4 @@ FADE_SLOW,Slow CLICK_BEHAVIOR,Click Behavior CLICK_BLINK,Blink / Trigger event CLICK_STATIC,Static / No event +REQUIRED,Required diff --git a/unity/Assets/StreamingAssets/text/Localization.French.txt b/unity/Assets/StreamingAssets/text/Localization.French.txt index ea40bf8ad..126a768cf 100644 --- a/unity/Assets/StreamingAssets/text/Localization.French.txt +++ b/unity/Assets/StreamingAssets/text/Localization.French.txt @@ -517,3 +517,4 @@ FADE_SLOW,Lent CLICK_BEHAVIOR,Comportement au clic CLICK_BLINK,Clignoter / Déclencher événement CLICK_STATIC,Statique / Pas d'événement +REQUIRED,Requis diff --git a/unity/Assets/StreamingAssets/text/Localization.German.txt b/unity/Assets/StreamingAssets/text/Localization.German.txt index d0b9c12ee..82c0f0e33 100644 --- a/unity/Assets/StreamingAssets/text/Localization.German.txt +++ b/unity/Assets/StreamingAssets/text/Localization.German.txt @@ -513,3 +513,4 @@ FADE_SLOW,Langsam CLICK_BEHAVIOR,Klickverhalten CLICK_BLINK,Blinken / Ereignis auslösen CLICK_STATIC,Statisch / Kein Ereignis +REQUIRED,Erforderlich diff --git a/unity/Assets/StreamingAssets/text/Localization.Italian.txt b/unity/Assets/StreamingAssets/text/Localization.Italian.txt index 1ed124169..5265723c9 100644 --- a/unity/Assets/StreamingAssets/text/Localization.Italian.txt +++ b/unity/Assets/StreamingAssets/text/Localization.Italian.txt @@ -453,3 +453,4 @@ FADE_SLOW,Lento CLICK_BEHAVIOR,Comportamento clic CLICK_BLINK,Lampeggia / Attiva evento CLICK_STATIC,Statico / Nessun evento +REQUIRED,Richiesto diff --git a/unity/Assets/StreamingAssets/text/Localization.Japanese.txt b/unity/Assets/StreamingAssets/text/Localization.Japanese.txt index d8611c011..c98a0f18b 100644 --- a/unity/Assets/StreamingAssets/text/Localization.Japanese.txt +++ b/unity/Assets/StreamingAssets/text/Localization.Japanese.txt @@ -716,3 +716,4 @@ FADE_SLOW,遅い CLICK_BEHAVIOR,クリック動作 CLICK_BLINK,点滅 / イベントトリガー CLICK_STATIC,静的 / イベントなし +REQUIRED,必須 diff --git a/unity/Assets/StreamingAssets/text/Localization.Korean.txt b/unity/Assets/StreamingAssets/text/Localization.Korean.txt index 030f0df1c..602660d6e 100644 --- a/unity/Assets/StreamingAssets/text/Localization.Korean.txt +++ b/unity/Assets/StreamingAssets/text/Localization.Korean.txt @@ -682,3 +682,4 @@ FADE_SLOW,느리게 CLICK_BEHAVIOR,클릭 동작 CLICK_BLINK,깜박임 / 이벤트 트리거 CLICK_STATIC,정적 / 이벤트 없음 +REQUIRED,필수 diff --git a/unity/Assets/StreamingAssets/text/Localization.Polish.txt b/unity/Assets/StreamingAssets/text/Localization.Polish.txt index 347b1621e..298dd389b 100644 --- a/unity/Assets/StreamingAssets/text/Localization.Polish.txt +++ b/unity/Assets/StreamingAssets/text/Localization.Polish.txt @@ -487,4 +487,4 @@ FADE_FAST,Szybko FADE_SLOW,Wolno CLICK_BEHAVIOR,Zachowanie kliknięcia CLICK_BLINK,Miganie / wyzwalanie zdarzenia -CLICK_STATIC,Statyczne / Brak zdarzenia \ No newline at end of file +CLICK_STATIC,Statyczne / Brak zdarzeniaREQUIRED,Wymagane diff --git a/unity/Assets/StreamingAssets/text/Localization.Portuguese.txt b/unity/Assets/StreamingAssets/text/Localization.Portuguese.txt index 125c9dc49..8d4a2445a 100644 --- a/unity/Assets/StreamingAssets/text/Localization.Portuguese.txt +++ b/unity/Assets/StreamingAssets/text/Localization.Portuguese.txt @@ -520,4 +520,4 @@ FADE_FAST,Rápido FADE_SLOW,Lento CLICK_BEHAVIOR,Comportamento do Clique CLICK_BLINK,Piscar / disparar evento -CLICK_STATIC,Estático / Sem evento \ No newline at end of file +CLICK_STATIC,Estático / Sem eventoREQUIRED,Obrigatório diff --git a/unity/Assets/StreamingAssets/text/Localization.Russian.txt b/unity/Assets/StreamingAssets/text/Localization.Russian.txt index 92e0567b6..b89615fe0 100644 --- a/unity/Assets/StreamingAssets/text/Localization.Russian.txt +++ b/unity/Assets/StreamingAssets/text/Localization.Russian.txt @@ -516,3 +516,4 @@ FADE_SLOW,Медленно CLICK_BEHAVIOR,Поведение клика CLICK_BLINK,Мигание / событие CLICK_STATIC,Статично / Нет события +REQUIRED,Требуется diff --git a/unity/Assets/StreamingAssets/text/Localization.Spanish.txt b/unity/Assets/StreamingAssets/text/Localization.Spanish.txt index a42f26171..25884c686 100644 --- a/unity/Assets/StreamingAssets/text/Localization.Spanish.txt +++ b/unity/Assets/StreamingAssets/text/Localization.Spanish.txt @@ -513,3 +513,4 @@ FADE_SLOW,Lento CLICK_BEHAVIOR,Comportamiento al hacer clic CLICK_BLINK,Parpadear / Activar evento CLICK_STATIC,Estático / Sin evento +REQUIRED,Requerido