Skip to content

Commit bc36345

Browse files
committed
Kaycee's error patch
1 parent 2bdb26e commit bc36345

File tree

6 files changed

+36
-4
lines changed

6 files changed

+36
-4
lines changed

API.csproj

Lines changed: 9 additions & 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>
@@ -28,5 +28,13 @@
2828
<HintPath>lib\Sirenix.Serialization.dll</HintPath>
2929
<Private>False</Private>
3030
</Reference>
31+
<Reference Include="Unity.TextMeshPro">
32+
<HintPath>lib\Unity.TextMeshPro.dll</HintPath>
33+
<Private>False</Private>
34+
</Reference>
35+
<Reference Include="UnityEngine.UI">
36+
<HintPath>lib\UnityEngine.UI.dll</HintPath>
37+
<Private>False</Private>
38+
</Reference>
3139
</ItemGroup>
3240
</Project>

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## v1.13.2-nonkc
4+
- Using normal API with Kaycee's Mod now shows an error.
5+
36
## v1.13.1-nonkc
47
- Fix for JSONLoader cards
58
- Fix not allowing base game and modded special abilites on the same card

Plugin.cs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
using BepInEx.Logging;
44
using HarmonyLib;
55
using UnityEngine.SceneManagement;
6+
using TMPro;
7+
using UnityEngine;
8+
using System.Linq;
9+
using System.Collections;
610

711
#pragma warning disable 169
812

@@ -13,7 +17,7 @@ public partial class Plugin : BaseUnityPlugin
1317
{
1418
private const string PluginGuid = "cyantist.inscryption.api";
1519
private const string PluginName = "API";
16-
private const string PluginVersion = "1.13.1";
20+
private const string PluginVersion = "1.13.2";
1721

1822
internal static ManualLogSource Log;
1923
internal static ConfigEntry<bool> configEnergy;
@@ -32,7 +36,24 @@ private void Awake()
3236
configDroneMox = Config.Bind("Mox","Mox Drone",false,"Drone displays mox (requires Energy Drone and Mox Refresh)");
3337

3438
Harmony harmony = new Harmony(PluginGuid);
35-
harmony.PatchAll();
39+
try
40+
{
41+
harmony.PatchAll();
42+
}
43+
catch
44+
{
45+
Log.LogError("Failed to apply patches for API. Are you using Kaycee's Mod?");
46+
StartCoroutine(KayceeError());
47+
}
48+
}
49+
50+
private IEnumerator KayceeError()
51+
{
52+
AsyncOperation asyncOp = SceneLoader.StartAsyncLoad("CorruptedSaveMessage");
53+
yield return new WaitUntil(() => asyncOp.isDone);
54+
GameObject[] objects = SceneManager.GetSceneByName("CorruptedSaveMessage").GetRootGameObjects();
55+
TextMeshProUGUI text = objects.ToList().Find(name => name.name == "Screen").GetComponentInChildren<TextMeshProUGUI>();
56+
text.text = "Oh no! It looks like you're using the <color=#FB3F4F>normal API</color>\nfor Kaycee's Mod.\nYou need to use Kaycee's API if you want to use\nmods for Kaycee's Mod, or switch back to the base\ngame through Steam.\nKeep in mind that some mods may require a\ndifferent version to work, or are entirely\nincompatible with Kaycee's Mod.\n\n(Press Escape to quit)";
3657
}
3758

3859
private void Start()

lib/Unity.TextMeshPro.dll

415 KB
Binary file not shown.

lib/UnityEngine.UI.dll

250 KB
Binary file not shown.

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "API",
3-
"version_number": "1.13.1",
3+
"version_number": "1.13.2",
44
"website_url": "https://github.com/ScottWilson0903/InscryptionAPI",
55
"description": "This plugin is a BepInEx plugin made for Inscryption as an API. It can currently create custom cards and abilities and inject them into the data pool, or modify existing cards in the card pool.",
66
"dependencies": [

0 commit comments

Comments
 (0)