Browse Source

[CombatChipChest] [2.0.3.8] Block Ironman

Zariteis 4 years ago
parent
commit
038e62d409
2 changed files with 10 additions and 2 deletions
  1. 1 1
      CombatChipChest/CombatChipChest.cs
  2. 9 1
      CombatChipChest/MenuOpenEventScript.cs

+ 1 - 1
CombatChipChest/CombatChipChest.cs

@@ -8,7 +8,7 @@ namespace CombatChipChest
   [Gadget("CombatChipChest", LoadAfter: new string[] { "ScrapYard" }, Dependencies: new string[] { "ScrapYard" })]
   public class CombatChipChest : Gadget<CombatChipChest>
   {
-    public const string MOD_VERSION = "1.1"; // Set this to the version of your mod.
+    public const string MOD_VERSION = "1.2"; // Set this to the version of your mod.
     public const string CONFIG_VERSION = "1.0"; // Increment this whenever you change your mod's config file.
 
     public override IGadgetConfigMenu GetConfigMenu() { return null; }

+ 9 - 1
CombatChipChest/MenuOpenEventScript.cs

@@ -1,4 +1,5 @@
-using UnityEngine;
+using GadgetCore.API;
+using UnityEngine;
 
 namespace CombatChipChest
 {
@@ -6,6 +7,13 @@ namespace CombatChipChest
   {
     void OnEnable()
     {
+      if(Menuu.curProfession == 1)
+      {
+        Core.menu.CloseMenu();
+        GameObject gameObject = (GameObject)Object.Instantiate(Resources.Load("txtError"), MenuScript.player.transform.position, Quaternion.identity);
+        gameObject.SendMessage("InitError", "You are an Ironman!");
+        return;
+      }
       Core.combatChipStore.UpdateUI(gameObject);
     }
   }