Skip to content

Commit d7ba2fb

Browse files
committed
Update card loading to work with the fix
1 parent 8cb4333 commit d7ba2fb

5 files changed

Lines changed: 17 additions & 5 deletions

File tree

API.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<TargetFramework>netstandard2.0</TargetFramework>
44
<AssemblyName>API</AssemblyName>
55
<Description>An API for inscryption</Description>
6-
<Version>1.13.1.0</Version>
6+
<Version>1.13.2.0</Version>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
88
<LangVersion>9.0</LangVersion>
99
<DebugType>full</DebugType>

Patches/ChapterSelectMenu_OnChapterConfirmed.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ public class ChapterSelectMenu_OnChapterConfirmed
1111
{
1212
public static void Prefix()
1313
{
14-
if (ScriptableObjectLoader<CardInfo>.allData == null)
14+
if (!Plugin.CardsLoaded)
1515
{
16+
Plugin.CardsLoaded = true;
1617
List<CardInfo> official = ScriptableObjectLoader<CardInfo>.AllData;
1718
foreach (CustomCard card in CustomCard.cards)
1819
{

Patches/LoadingScreenManager_LoadGameData.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ public class LoadingScreenManager_LoadGameData
1111
{
1212
public static void Prefix()
1313
{
14-
if (ScriptableObjectLoader<CardInfo>.allData == null)
14+
if (!Plugin.CardsLoaded)
1515
{
16+
Plugin.CardsLoaded = true;
1617
List<CardInfo> official = ScriptableObjectLoader<CardInfo>.AllData;
1718
foreach (CustomCard card in CustomCard.cards)
1819
{
@@ -32,8 +33,9 @@ public static void Prefix()
3233
Plugin.Log.LogInfo($"Loaded {NewCard.cards.Count} custom cards into data");
3334
}
3435

35-
if (ScriptableObjectLoader<AbilityInfo>.allData == null)
36+
if (!Plugin.AbilitiesLoaded)
3637
{
38+
Plugin.AbilitiesLoaded = true;
3739
List<AbilityInfo> official = ScriptableObjectLoader<AbilityInfo>.AllData;
3840
foreach (NewAbility newAbility in NewAbility.abilities)
3941
{

Plugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public partial class Plugin : BaseUnityPlugin
1313
{
1414
private const string PluginGuid = "cyantist.inscryption.api";
1515
private const string PluginName = "API";
16-
private const string PluginVersion = "1.13.1.0";
16+
private const string PluginVersion = "1.13.2.0";
1717

1818
internal static ManualLogSource Log;
1919
internal static ConfigEntry<bool> configEnergy;

Utils/IdentifierHandlers.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ namespace APIPlugin
66
{
77
public partial class Plugin
88
{
9+
10+
private static bool cardsLoaded = false;
11+
12+
public static bool CardsLoaded { get => cardsLoaded; set => cardsLoaded = value; }
13+
14+
private static bool abilitiesLoaded = false;
15+
16+
public static bool AbilitiesLoaded { get => abilitiesLoaded; set => abilitiesLoaded = value; }
17+
918
private void SetAbilityIdentifiers()
1019
{
1120
Log.LogDebug($"Number of ability IDs to set from NewCard.abilityIds: [{NewCard.abilityIds.Count}]");

0 commit comments

Comments
 (0)