Skip to content
Open
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
17 changes: 17 additions & 0 deletions .agent/workflows/increaseformat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
description: Workflow to increase the quest format version
---

1. Open `unity/Assets/Scripts/Content/FormatVersions.cs`.
2. Locate the `Versions` enum at the bottom of the class.
3. Identify the last entry in the `Versions` enum (e.g., `RELEASE_3_1_5 = 20`).
4. Read the current version of the application from `version.txt` to determine the new version string (e.g., `3.1.6`).
5. Add a new entry to the `Versions` enum:
- Name: `RELEASE_<MAJOR>_<MINOR>_<PATCH>` (e.g., `RELEASE_3_1_6`)
- Value: Increment the last value by 1 (e.g., `21`)
6. Locate the `CURRENT_VERSION` constant at the top of the class.
7. Update the assignment to use the new enum value:
```csharp
public const int CURRENT_VERSION = (int) Versions.RELEASE_<MAJOR>_<MINOR>_<PATCH>;
```
8. Save the file.
10 changes: 10 additions & 0 deletions .agent/workflows/increaseversion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
description: Increase the app version of Valkyrie
---

Increase version numbers in files:
- unity\Assets\Resources\version.txt
- unity\Assets\Resources\prod_version.txt

1. Ensure to keep numbers for both files in sync.
2. If specified "major" then increase major version number e.g. from 3.14 to 4.14. Otherwise if not specified always increase minor version.
Binary file modified unity/Assets/Resources/Sprites/CustomContentPackIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion unity/Assets/Resources/prod_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.14
3.15
2 changes: 1 addition & 1 deletion unity/Assets/Resources/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.14
3.15
12 changes: 12 additions & 0 deletions unity/Assets/Scripts/Content/ContentData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,18 @@ private void PopulatePackListByPath(string path, string gameTypeName, bool check

private void AddPackToAllPacksAndPackSymbol(ContentPack pack, List<ContentPack> allPacksList, Dictionary<string, StringKey> packSymbolDict)
{
// Remove existing pack if present (update scenario)
var existingPack = allPacksList.FirstOrDefault(p => p.id.Equals(pack.id));
if (existingPack != null)
{
allPacksList.Remove(existingPack);
}

if (packSymbolDict.ContainsKey(pack.id))
{
packSymbolDict.Remove(pack.id);
}

// Add content pack
allPacksList.Add(pack);

Expand Down
3 changes: 2 additions & 1 deletion unity/Assets/Scripts/Content/FormatVersions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Assets.Scripts.Content
{
public class QuestFormat
{
public const int CURRENT_VERSION = (int) Versions.RELEASE_3_0_0;
public const int CURRENT_VERSION = (int) Versions.RELEASE_3_1_5;

public readonly static HashSet<string> SCENARIOS_THAT_REQUIRE_CONVERSION_KIT = new HashSet<string>
{
Expand Down Expand Up @@ -38,6 +38,7 @@ public enum Versions
SPLIT_BASE_MOM_AND_CONVERSION_KIT = 17,
RELEASE_2_5_4 = 18,
RELEASE_3_0_0 = 19,
RELEASE_3_1_5 = 20,
}
}
}
112 changes: 108 additions & 4 deletions unity/Assets/Scripts/Quest/Quest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1244,6 +1244,110 @@ public void Remove(string name)
boardItems.Clear();
ordered_boardItems.Clear();
}

if (name.Equals("#uicomponents"))
{
List<string> toRemove = new List<string>();
foreach (KeyValuePair<string, BoardComponent> kv in boardItems)
{
if (kv.Value is UI)
{
kv.Value.Remove();
toRemove.Add(kv.Key);
}
}

foreach (string s in toRemove)
{
boardItems.Remove(s);
ordered_boardItems.Remove(s);
}
}

if (name.Equals("#doors"))
{
List<string> toRemove = new List<string>();
foreach (KeyValuePair<string, BoardComponent> kv in boardItems)
{
if (kv.Value is Door)
{
kv.Value.Remove();
toRemove.Add(kv.Key);
}
}

foreach (string s in toRemove)
{
boardItems.Remove(s);
ordered_boardItems.Remove(s);
}
}

if (name.Equals("#tiles"))
{
List<string> toRemove = new List<string>();
foreach (KeyValuePair<string, BoardComponent> kv in boardItems)
{
if (kv.Value is Tile)
{
kv.Value.Remove();
toRemove.Add(kv.Key);
}
}

foreach (string s in toRemove)
{
boardItems.Remove(s);
ordered_boardItems.Remove(s);
}
}

if (name.Equals("#qitems"))
{
List<string> toRemove = new List<string>();
foreach (KeyValuePair<string, string> kv in itemSelect)
{
if (items.Contains(kv.Value))
{
items.Remove(kv.Value);
if (itemInspect.ContainsKey(kv.Value))
{
itemInspect.Remove(kv.Value);
}
toRemove.Add(kv.Key);
}
}

// We should probably remove the QItem from itemSelect?
// "Remove" function usually removes components from "active" lists.
// But QItems are not in BoardItems.
// If we remove from itemSelect, we lose the mapping?
// But the item is gone from inventory.
// If the QItem is triggered again, it will try to re-add?
// "Remove" means revert the effect of adding.
// So removing from "items" is correct.
// Wait, "itemSelect" is populated at quest start based on available items.
// Should not modify "itemSelect".
}

if (name.Equals("#tokens"))
{
List<string> toRemove = new List<string>();
foreach (KeyValuePair<string, BoardComponent> kv in boardItems)
{
if (kv.Value is Token)
{
kv.Value.Remove();
toRemove.Add(kv.Key);
}
}

foreach (string s in toRemove)
{
boardItems.Remove(s);
ordered_boardItems.Remove(s);
}
}
}

public bool UIItemsPresent()
Expand Down Expand Up @@ -1849,16 +1953,16 @@ public UI(QuestData.UI questUI, Game gameObject) : base(gameObject)
game.tokenBoard.Add(this);
}

private TextAlignmentOptions ConvertRichTextAlignment(TextAlignment qUITextAlignment)
private TMPro.TextAlignmentOptions ConvertRichTextAlignment(TextAlignment qUITextAlignment)
{
switch (qUITextAlignment)
{
case TextAlignment.TOP:
return TextAlignmentOptions.Top;
return TMPro.TextAlignmentOptions.Top;
case TextAlignment.BOTTOM:
return TextAlignmentOptions.Bottom;
return TMPro.TextAlignmentOptions.Bottom;
}
return TextAlignmentOptions.Center;
return TMPro.TextAlignmentOptions.Center;
}

private TextAnchor ConvertStandardTextAlignment(TextAlignment qUITextAlignment)
Expand Down
5 changes: 5 additions & 0 deletions unity/Assets/Scripts/QuestEditor/EditorComponentEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,11 @@ public void AddVisibility(bool add, int index = -1)
select.AddItem("#boardcomponents", traits);
select.AddItem("#monsters", traits);
select.AddItem("#shop", traits);
select.AddItem("#uicomponents", traits);
select.AddItem("#doors", traits);
select.AddItem("#tiles", traits);
select.AddItem("#qitems", traits);
select.AddItem("#tokens", traits);
}

if (game.gameType is D2EGameType)
Expand Down
Loading
Loading