Skip to content

Commit e3d3144

Browse files
authored
Merge pull request #319 from HumabHatterZed/main
Fix index error when loading custom challenges, publicise SetPrefabModelType
2 parents da6e101 + a5e68a5 commit e3d3144

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
- Fixed pelt names when a user goes to the trader with modded cards, Examples shown below.
66
<img src="https://github.com/user-attachments/assets/49b9da13-e602-4020-a560-40344e9ef6af" width="750">
77
<img src="https://github.com/user-attachments/assets/4b432cc9-a0f7-4d75-99b4-8951ba46705b" width="750">
8+
- Fixed index error when loading custom challenges
9+
- Publicised ConsumableItemData.SetPrefabModelType
810

911
# 2.22.2
1012
- Added GetEnergyConfig method to community patch's EnergyDrone class - retrieves the current Act's EnergyConfigInfo

InscryptionAPI/Ascension/AscensionChallengePaginator.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void AddPage(List<AscensionChallengeInfo> challengeInfos)
7979
int numBossesAdded = 0;
8080

8181
// 14 = regular + boss * 2
82-
//Debug.Log($"NumIcons for Page: {numIcons}: {regularChallengeInfos.Count} {bossChallengeInfos.Count} | {bossStartingIndex}");
82+
//Debug.Log($"NumIcons for Page: {numIcons}: {regularChallengeInfos.Count} {numBosses} | {bossStartingIndex}");
8383

8484
for (int i = 0; i < 14; i++)
8585
{
@@ -88,7 +88,7 @@ public void AddPage(List<AscensionChallengeInfo> challengeInfos)
8888
int columnIndex = i % 7;
8989
//Debug.Log($"{i} ({columnIndex}) | {bossStartingIndex + numBosses} / {bossStartingIndex}");
9090

91-
if (columnIndex >= bossStartingIndex && columnIndex < bossStartingIndex + numBosses)
91+
if (numBosses > 0 && columnIndex >= bossStartingIndex && columnIndex < bossStartingIndex + numBosses)
9292
{
9393
//Debug.Log($"In boss column {i}");
9494
if (numBossesAdded < numBosses)
@@ -125,11 +125,11 @@ public void AddPage(List<AscensionChallengeInfo> challengeInfos)
125125
int infoCount = challengeInfos.Count;
126126
for (int i = 0; i < newPage.Count; i++)
127127
{
128-
AscensionChallengeInfo info = challengeInfos[infoIdx];
129128
AscensionIconInteractable interactable = newPage[i].GetComponent<AscensionIconInteractable>();
130-
//Debug.Log($"Checking icon [{i}] info at {infoIdx} : {info.title}");
129+
//Debug.Log($"Checking icon [{i}] info at {infoIdx} : ({infoCount}) ({newPage.Count})");
131130
if (i < infoCount)
132131
{
132+
AscensionChallengeInfo info = challengeInfos[infoIdx];
133133
// if we're assigning boss info to an icon that isn't a boss icon
134134
if (info.GetFullChallenge().Boss && (interactable.coll2D as BoxCollider2D).size.y < 1f)
135135
{
@@ -146,6 +146,7 @@ public void AddPage(List<AscensionChallengeInfo> challengeInfos)
146146
}
147147
else
148148
{
149+
//Debug.Log("Missing challenge");
149150
interactable.challengeInfo = missingChallengeInfo;
150151
newPage[i].AddComponent<NoneChallengeDisplayer>();
151152
}

InscryptionAPI/Items/ConsumableItemDataExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public static string GetCardWithinBottle(this ConsumableItemData data)
187187
}
188188

189189
/// <returns>The same ConsumableItemData so a chain can continue.</returns>
190-
internal static ConsumableItemData SetPrefabModelType(this ConsumableItemData data, ConsumableItemManager.ModelType modelType)
190+
public static ConsumableItemData SetPrefabModelType(this ConsumableItemData data, ConsumableItemManager.ModelType modelType)
191191
{
192192
data.SetExtendedProperty("PrefabModelType", (int)modelType);
193193
return data;

0 commit comments

Comments
 (0)