Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions unity/Assets/Scripts/Content/CommonStringKeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

}
}
7 changes: 4 additions & 3 deletions unity/Assets/Scripts/Content/ContentTypes.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


// Class for tile specific data

using System;
Expand All @@ -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<string, string> content, string path, List<string> sets = null) : base(name, content, path, type, sets)
{
Expand Down Expand Up @@ -653,4 +654,4 @@ public PerilData(string name, Dictionary<string, string> data) : base(name, data
perilText = new StringKey(data["text"]);
}
}
}
}
9 changes: 6 additions & 3 deletions unity/Assets/Scripts/GameStateManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using Assets.Scripts.UI.Screens;
using ValkyrieTools;

Expand All @@ -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();
}
Expand Down Expand Up @@ -123,4 +126,4 @@ private static bool GetCurrentQuest(Game game, out QuestData.Quest currentQuest)
currentQuest = new QuestData.Quest(questPath);
return true;
}
}
}
26 changes: 24 additions & 2 deletions unity/Assets/Scripts/GameType.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using Assets.Scripts.Content;
using Assets.Scripts;
using Assets.Scripts.Content;
using System;
using UnityEngine;

// GameType manages setting that are specific to the game type
public abstract class GameType
{
public abstract string DataDirectory();
public abstract string BaseContentPackId();
public abstract StringKey HeroName();
public abstract StringKey HeroesName();
public abstract StringKey QuestName();
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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/";
Expand Down Expand Up @@ -387,4 +409,4 @@ public override bool MonstersGrouped()
{
return false;
}
}
}
22 changes: 15 additions & 7 deletions unity/Assets/Scripts/QuestEditor/ToolsButton.cs
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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);
Expand All @@ -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;
Expand All @@ -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();
}
Expand Down Expand Up @@ -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<string, string> packs = game.config.data.Get(game.gameType.TypeName() + "Packs");
if (packs != null)
Expand Down
22 changes: 19 additions & 3 deletions unity/Assets/Scripts/UI/Screens/ContentSelectScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public void DrawTypeList()
// Note this is currently unordered
foreach (PackTypeData type in game.cd.Values<PackTypeData>())
{
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))
Expand Down Expand Up @@ -229,7 +229,10 @@ public void DrawList(string type = "")
string id = cp.id;
buttons.Add(id, new List<UIElement>());
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);
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion unity/Assets/Scripts/ValkyrieConstants.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Assets.Scripts.Content;
using Assets.Scripts.Content;
using System;
using System.Collections.Generic;

namespace Assets.Scripts
{
Expand Down Expand Up @@ -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";
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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}
Expand Down
1 change: 1 addition & 0 deletions unity/Assets/StreamingAssets/text/Localization.Chinese.txt
Original file line number Diff line number Diff line change
Expand Up @@ -494,3 +494,4 @@ FADE_SLOW,慢
CLICK_BEHAVIOR,点击行为
CLICK_BLINK,闪烁 / 触发事件
CLICK_STATIC,静态 / 无事件
REQUIRED,必须
1 change: 1 addition & 0 deletions unity/Assets/StreamingAssets/text/Localization.Czech.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions unity/Assets/StreamingAssets/text/Localization.English.txt
Original file line number Diff line number Diff line change
Expand Up @@ -686,3 +686,4 @@ FADE_SLOW,Slow
CLICK_BEHAVIOR,Click Behavior
CLICK_BLINK,Blink / Trigger event
CLICK_STATIC,Static / No event
REQUIRED,Required
1 change: 1 addition & 0 deletions unity/Assets/StreamingAssets/text/Localization.French.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions unity/Assets/StreamingAssets/text/Localization.German.txt
Original file line number Diff line number Diff line change
Expand Up @@ -513,3 +513,4 @@ FADE_SLOW,Langsam
CLICK_BEHAVIOR,Klickverhalten
CLICK_BLINK,Blinken / Ereignis auslösen
CLICK_STATIC,Statisch / Kein Ereignis
REQUIRED,Erforderlich
1 change: 1 addition & 0 deletions unity/Assets/StreamingAssets/text/Localization.Italian.txt
Original file line number Diff line number Diff line change
Expand Up @@ -453,3 +453,4 @@ FADE_SLOW,Lento
CLICK_BEHAVIOR,Comportamento clic
CLICK_BLINK,Lampeggia / Attiva evento
CLICK_STATIC,Statico / Nessun evento
REQUIRED,Richiesto
Original file line number Diff line number Diff line change
Expand Up @@ -716,3 +716,4 @@ FADE_SLOW,遅い
CLICK_BEHAVIOR,クリック動作
CLICK_BLINK,点滅 / イベントトリガー
CLICK_STATIC,静的 / イベントなし
REQUIRED,必須
1 change: 1 addition & 0 deletions unity/Assets/StreamingAssets/text/Localization.Korean.txt
Original file line number Diff line number Diff line change
Expand Up @@ -682,3 +682,4 @@ FADE_SLOW,느리게
CLICK_BEHAVIOR,클릭 동작
CLICK_BLINK,깜박임 / 이벤트 트리거
CLICK_STATIC,정적 / 이벤트 없음
REQUIRED,필수
2 changes: 1 addition & 1 deletion unity/Assets/StreamingAssets/text/Localization.Polish.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
CLICK_STATIC,Statyczne / Brak zdarzeniaREQUIRED,Wymagane
Original file line number Diff line number Diff line change
Expand Up @@ -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
CLICK_STATIC,Estático / Sem eventoREQUIRED,Obrigatório
1 change: 1 addition & 0 deletions unity/Assets/StreamingAssets/text/Localization.Russian.txt
Original file line number Diff line number Diff line change
Expand Up @@ -516,3 +516,4 @@ FADE_SLOW,Медленно
CLICK_BEHAVIOR,Поведение клика
CLICK_BLINK,Мигание / событие
CLICK_STATIC,Статично / Нет события
REQUIRED,Требуется
1 change: 1 addition & 0 deletions unity/Assets/StreamingAssets/text/Localization.Spanish.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading