diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ef94fe7..08fe6113 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ - Fixed pelt names when a user goes to the trader with modded cards, Examples shown below. +- Fixed index error when loading custom challenges +- Publicised ConsumableItemData.SetPrefabModelType # 2.22.2 - Added GetEnergyConfig method to community patch's EnergyDrone class - retrieves the current Act's EnergyConfigInfo diff --git a/InscryptionAPI/Ascension/AscensionChallengePaginator.cs b/InscryptionAPI/Ascension/AscensionChallengePaginator.cs index afbba7e0..514bfdc8 100644 --- a/InscryptionAPI/Ascension/AscensionChallengePaginator.cs +++ b/InscryptionAPI/Ascension/AscensionChallengePaginator.cs @@ -79,7 +79,7 @@ public void AddPage(List challengeInfos) int numBossesAdded = 0; // 14 = regular + boss * 2 - //Debug.Log($"NumIcons for Page: {numIcons}: {regularChallengeInfos.Count} {bossChallengeInfos.Count} | {bossStartingIndex}"); + //Debug.Log($"NumIcons for Page: {numIcons}: {regularChallengeInfos.Count} {numBosses} | {bossStartingIndex}"); for (int i = 0; i < 14; i++) { @@ -88,7 +88,7 @@ public void AddPage(List challengeInfos) int columnIndex = i % 7; //Debug.Log($"{i} ({columnIndex}) | {bossStartingIndex + numBosses} / {bossStartingIndex}"); - if (columnIndex >= bossStartingIndex && columnIndex < bossStartingIndex + numBosses) + if (numBosses > 0 && columnIndex >= bossStartingIndex && columnIndex < bossStartingIndex + numBosses) { //Debug.Log($"In boss column {i}"); if (numBossesAdded < numBosses) @@ -125,11 +125,11 @@ public void AddPage(List challengeInfos) int infoCount = challengeInfos.Count; for (int i = 0; i < newPage.Count; i++) { - AscensionChallengeInfo info = challengeInfos[infoIdx]; AscensionIconInteractable interactable = newPage[i].GetComponent(); - //Debug.Log($"Checking icon [{i}] info at {infoIdx} : {info.title}"); + //Debug.Log($"Checking icon [{i}] info at {infoIdx} : ({infoCount}) ({newPage.Count})"); if (i < infoCount) { + AscensionChallengeInfo info = challengeInfos[infoIdx]; // if we're assigning boss info to an icon that isn't a boss icon if (info.GetFullChallenge().Boss && (interactable.coll2D as BoxCollider2D).size.y < 1f) { @@ -146,6 +146,7 @@ public void AddPage(List challengeInfos) } else { + //Debug.Log("Missing challenge"); interactable.challengeInfo = missingChallengeInfo; newPage[i].AddComponent(); } diff --git a/InscryptionAPI/Items/ConsumableItemDataExtensions.cs b/InscryptionAPI/Items/ConsumableItemDataExtensions.cs index 276bbdfc..3fcae1f9 100644 --- a/InscryptionAPI/Items/ConsumableItemDataExtensions.cs +++ b/InscryptionAPI/Items/ConsumableItemDataExtensions.cs @@ -187,7 +187,7 @@ public static string GetCardWithinBottle(this ConsumableItemData data) } /// The same ConsumableItemData so a chain can continue. - internal static ConsumableItemData SetPrefabModelType(this ConsumableItemData data, ConsumableItemManager.ModelType modelType) + public static ConsumableItemData SetPrefabModelType(this ConsumableItemData data, ConsumableItemManager.ModelType modelType) { data.SetExtendedProperty("PrefabModelType", (int)modelType); return data;