Skip to content

Commit

Permalink
Fix hooded figure grids
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaPiggy committed Oct 21, 2024
1 parent 3cf92af commit 1e55c93
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Winch/Data/GridKeyExtra.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,20 @@
public static class GridKeyExtra
{
public const GridKey UPGRADE_T1_HULL = GridKey.UPGRADE_T1_FISHING_1 - 1;

public const GridKey HOODED_FIGURE_1A = (GridKey)4300;
public const GridKey HOODED_FIGURE_1B = (GridKey)4301;
public const GridKey HOODED_FIGURE_1C = (GridKey)4302;
public const GridKey HOODED_FIGURE_2A = (GridKey)4303;
public const GridKey HOODED_FIGURE_2B = (GridKey)4304;
public const GridKey HOODED_FIGURE_2C = (GridKey)4305;
public const GridKey HOODED_FIGURE_3A = (GridKey)4306;
public const GridKey HOODED_FIGURE_3B = (GridKey)4307;
public const GridKey HOODED_FIGURE_3C = (GridKey)4308;
public const GridKey HOODED_FIGURE_4A = (GridKey)4309;
public const GridKey HOODED_FIGURE_4B = (GridKey)4310;
public const GridKey HOODED_FIGURE_4C = (GridKey)4311;
public const GridKey HOODED_FIGURE_5A = (GridKey)4312;
public const GridKey HOODED_FIGURE_5B = (GridKey)4313;
public const GridKey HOODED_FIGURE_5C = (GridKey)4314;
}
51 changes: 51 additions & 0 deletions Winch/Util/QuestUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,56 @@ private static bool PopulateQuestGridConfigFromMetaWithConverter(DeferredQuestGr
internal static List<string> VanillaQuestStepDataIDList = new();
internal static List<string> VanillaQuestGridConfigIDList = new();

internal static GridKey GetQuestGridKeyByName(string name)
{
switch (name)
{
case "HoodedFigure1A":
return GridKeyExtra.HOODED_FIGURE_1A;
case "HoodedFigure1B":
return GridKeyExtra.HOODED_FIGURE_1B;
case "HoodedFigure1C":
return GridKeyExtra.HOODED_FIGURE_1C;
case "HoodedFigure2A":
return GridKeyExtra.HOODED_FIGURE_2A;
case "HoodedFigure2B":
return GridKeyExtra.HOODED_FIGURE_2B;
case "HoodedFigure2C":
return GridKeyExtra.HOODED_FIGURE_2C;
case "HoodedFigure3A":
return GridKeyExtra.HOODED_FIGURE_3A;
case "HoodedFigure3B":
return GridKeyExtra.HOODED_FIGURE_3B;
case "HoodedFigure3C":
return GridKeyExtra.HOODED_FIGURE_3C;
case "HoodedFigure4A":
return GridKeyExtra.HOODED_FIGURE_4A;
case "HoodedFigure4B":
return GridKeyExtra.HOODED_FIGURE_4B;
case "HoodedFigure4C":
return GridKeyExtra.HOODED_FIGURE_4C;
case "HoodedFigure5A":
return GridKeyExtra.HOODED_FIGURE_5A;
case "HoodedFigure5B":
return GridKeyExtra.HOODED_FIGURE_5B;
case "HoodedFigure5C":
return GridKeyExtra.HOODED_FIGURE_5C;
default:
return GridKey.NONE;
}
}

internal static void FixVanillaQuestGrid(QuestGridConfig questGridConfig)
{
var gridKey = GetQuestGridKeyByName(questGridConfig.name);
if (gridKey != GridKey.NONE)
{
questGridConfig.gridKey = gridKey;
GridConfigUtil.VanillaGridKeyDict.SafeAdd(gridKey, questGridConfig.gridConfiguration.name);
GameManager.Instance.GameConfigData.gridConfigs.AddOrChange(gridKey, questGridConfig.gridConfiguration);
}
}

internal static void Initialize()
{
Addressables.LoadAssetsAsync<QuestData>(AddressablesUtil.GetLocations<QuestData>("QuestData"), questData =>
Expand All @@ -52,6 +102,7 @@ internal static void Initialize()
{
VanillaQuestGridConfigIDList.SafeAdd(questGridConfig.name);
GridConfigUtil.VanillaGridConfigIDList.SafeAdd(questGridConfig.gridConfiguration.name);
FixVanillaQuestGrid(questGridConfig);
});
}

Expand Down

0 comments on commit 1e55c93

Please sign in to comment.