Beispiel #1
0
        public void OnSliderChanged(object sender, SliderChangedEventArgs e)
        {
            try
            {
                int val = (int)Math.Round(e.Value, 0);

                if (e.Id == "cdcMin")
                {
                    Logger.Log($"Minimum value updated from {CDC_Config.Min} to {val}", QMod.assembly);
                    CDC_Config.Min = val;
                    PlayerPrefs.SetInt("cdcMin", val);
                    PlayerPrefs.Save();
                }
                else if (e.Id == "cdcMax")
                {
                    Logger.Log($"Maximum value updated from {CDC_Config.Max} to {val}", QMod.assembly);
                    CDC_Config.Max = val;
                    PlayerPrefs.SetInt("cdcMax", val);
                    PlayerPrefs.Save();
                }

                UnityEngine.Object.FindObjectsOfType <CDC_Config>().Do(cdc => cdc.UpdateNumbers());
                Logger.Log("Updated Drillable components for all objects", QMod.assembly);
            }
            catch (Exception ex)
            {
                Logger.Exception(ex, LoggedWhen.Options);
            }
        }
Beispiel #2
0
        public static void Patch()
        {
            try
            {
                HarmonyHelper.Patch();

                Logger.Log("Patched successfully!");

                PFC_Config.Enable = PlayerPrefsExtra.GetBool("pfcEnable", true);

                Logger.Log("Obtained values from config");

                OptionsPanelHandler.RegisterModOptions(new Options("Pickup Full Carry-alls"));

                Logger.Log("Registered mod options");

                ItemActionHelper.RegisterAction(MouseButton.Middle, TechType.LuggageBag, InventoryOpener.OnMiddleClick, "open storage", InventoryOpener.Condition);
                ItemActionHelper.RegisterAction(MouseButton.Middle, TechType.SmallStorage, InventoryOpener.OnMiddleClick, "open storage", InventoryOpener.Condition);

                /*
                 * ItemActionHandler.RegisterMiddleClickAction(TechType.LuggageBag, InventoryOpener.OnMiddleClick, "open storage");
                 * ItemActionHandler.RegisterMiddleClickAction(TechType.SmallStorage, InventoryOpener.OnMiddleClick, "open storage");
                 *
                 * Logger.Log("Registered middle click actions");
                 */
            }
            catch (Exception e)
            {
                Logger.Exception(e, LoggedWhen.Initializing);
            }
        }
Beispiel #3
0
        public static void Patch()
        {
            HarmonyHelper.Patch();
            new HorizontalWallLocker().Patch();

            Logger.Log("Patched");
        }
Beispiel #4
0
 public void OnChoiceChanged(object sender, ChoiceChangedEventArgs e)
 {
     if (e.Id == "pfcMMB")
     {
         Logger.Log($"Set storage opening in inventory to: \"{e.Value}\"");
         PFC_Config.AllowMMB = e.Value;
     }
 }
Beispiel #5
0
        public static void Patch()
        {
            HarmonyHelper.Patch();
            Logger.Log("Patched successfully!");

            IBA_Config.Enable = PlayerPrefsExtra.GetBool("ibaEnable", true);
            Logger.Log("Obtained values from config");

            OptionsPanelHandler.RegisterModOptions(new Options("Instant Bulkhead Animations"));
            Logger.Log("Registered mod options");
        }
Beispiel #6
0
 public static void Postfix(Drillable __instance)
 {
     try
     {
         CDC_Config cdc = __instance.gameObject.AddComponent <CDC_Config>();
         Logger.Log("Added component to Drillable!", QMod.assembly);
     }
     catch (Exception e)
     {
         Logger.Exception(e, LoggedWhen.InPatch, QMod.assembly);
     }
 }
Beispiel #7
0
        public static void Patch()
        {
            HarmonyHelper.Patch();
            Logger.Log("Patched successfully!");

            PFC_Config.Enable = PlayerPrefsExtra.GetBool("pfcEnable", true);
            Logger.Log("Obtained values from config");

            OptionsPanelHandler.RegisterModOptions(new Options("Pickup Full Carry-alls"));
            Logger.Log("Registered mod options");

            ItemActionHandler.RegisterMiddleClickAction(TechType.LuggageBag, InventoryOpener.OnMiddleClick, "open storage", InventoryOpener.Condition);
            ItemActionHandler.RegisterMiddleClickAction(TechType.SmallStorage, InventoryOpener.OnMiddleClick, "open storage", InventoryOpener.Condition);
        }
Beispiel #8
0
 public void OnToggleChanged(object sender, ToggleChangedEventArgs e)
 {
     if (e.Id == "pfcEnable")
     {
         if (e.Value)
         {
             Logger.Log("Enabled mod");
         }
         else
         {
             Logger.Log("Disabled mod");
         }
         PFC_Config.Enable = e.Value;
     }
 }
Beispiel #9
0
            public static bool Prefix(PickupableStorage __instance, GUIHand hand)
            {
                TechType type = __instance.pickupable.GetTechType();

                if (PFC_Config.Enable && type == TechType.LuggageBag || type == TechType.SmallStorage)
                {
                    __instance.pickupable.OnHandClick(hand);
                    Logger.Log("Picked up a carry-all");
                    return(false);
                }
                else
                {
                    return(true);
                }
            }
Beispiel #10
0
 public static bool Prefix(BulkheadDoor __instance, GUIHand hand)
 {
     if (IBA_Config.Enable)
     {
         Vector3 position = Player.main.transform.position;
         __instance.GetInstanceMethod("ToggleImmediately").Invoke(__instance, null);
         Player.main.transform.position = position;
         Logger.Log("Bulkhead animation skipped!");
         return(false);
     }
     else
     {
         return(true);
     }
 }
Beispiel #11
0
        public static void Patch()
        {
            HarmonyHelper.Patch();

            Logger.Log($"Patched successfully!");

            CDC_Config.Min = PlayerPrefs.GetInt("cdcMin", 1);
            CDC_Config.Max = PlayerPrefs.GetInt("cdcMax", 3);

            Logger.Log("Obtained min/max values from config");

            OptionsPanelHandler.RegisterModOptions(new Options("Configurable Drillable Count"));

            Logger.Log("Registered mod options");
        }
Beispiel #12
0
 public void OnChoiceChanged(object sender, ChoiceChangedEventArgs e)
 {
     try
     {
         if (e.Id == "pfcMMB")
         {
             Logger.Log($"Set storage opening in inventory to: \"{e.Value}\"");
             PFC_Config.AllowMMB = e.Value;
         }
     }
     catch (Exception ex)
     {
         Logger.Exception(ex, LoggedWhen.Options);
     }
 }
Beispiel #13
0
            public static void Postfix(GameObject __result, TechType techType)
            {
                try
                {
                    if (techType == TechType.Bleach)
                    {
                        __result.AddComponent <DrinkableBleach>();

                        Logger.Log($"Added components to bleach item!", QMod.assembly);
                    }
                }
                catch (Exception e)
                {
                    Logger.Exception(e, LoggedWhen.InPatch, QMod.assembly);
                }
            }
Beispiel #14
0
 public void OnToggleChanged(object sender, ToggleChangedEventArgs e)
 {
     if (e.Id == "ibaEnable")
     {
         if (e.Value)
         {
             Logger.Log("Enabled mod");
         }
         else
         {
             Logger.Log("Disabled mod");
         }
         IBA_Config.Enable = e.Value;
         PlayerPrefsExtra.SetBool("ibaEnable", e.Value);
         PlayerPrefs.Save();
     }
 }
Beispiel #15
0
        public static void Patch()
        {
            try
            {
                HarmonyHelper.Patch();

                Logger.Log("Patched successfully!");

                LanguageHandler.SetLanguageLine("Tooltip_Bleach", "NaClO. Sodium hypochlorite bleach. Sanitizing applications.\n(If you cannot drink it, you need to craft a new one)");

                Logger.Log("Updated Bleach tooltip");
            }
            catch (Exception e)
            {
                Logger.Exception(e, LoggedWhen.Initializing);
            }
        }
Beispiel #16
0
 public void OnToggleChanged(object sender, ToggleChangedEventArgs e)
 {
     try
     {
         if (e.Id == "pfcEnable")
         {
             if (e.Value)
             {
                 Logger.Log("Enabled mod", QMod.assembly);
             }
             else
             {
                 Logger.Log("Disabled mod", QMod.assembly);
             }
             PFC_Config.Enable = e.Value;
         }
     }
     catch (Exception ex)
     {
         Logger.Exception(ex, LoggedWhen.Options);
     }
 }
Beispiel #17
0
 public static bool Prefix(PickupableStorage __instance, GUIHand hand)
 {
     try
     {
         TechType type = __instance.pickupable.GetTechType();
         if (PFC_Config.Enable && type == TechType.LuggageBag || type == TechType.SmallStorage)
         {
             __instance.pickupable.OnHandClick(hand);
             Logger.Log("Picked up a carry-all", QMod.assembly);
             return(false);
         }
         else
         {
             return(true);
         }
     }
     catch (Exception e)
     {
         Logger.Exception(e, LoggedWhen.InPatch, QMod.assembly);
         return(false);
     }
 }
Beispiel #18
0
 public static bool Prefix(BulkheadDoor __instance, GUIHand hand)
 {
     try
     {
         if (IBA_Config.Enable)
         {
             Vector3 position = Player.main.transform.position;
             __instance.GetInstanceMethod("ToggleImmediately").Invoke(__instance, null);
             Player.main.transform.position = position;
             Logger.Log("Bulkhead animation skipped!", QMod.assembly);
             return(false);
         }
         else
         {
             return(true);
         }
     }
     catch (Exception e)
     {
         Logger.Exception(e, LoggedWhen.InPatch, QMod.assembly);
         return(false);
     }
 }
Beispiel #19
0
 public void OnToggleChanged(object sender, ToggleChangedEventArgs e)
 {
     try
     {
         if (e.Id == "ibaEnable")
         {
             if (e.Value)
             {
                 Logger.Log("Enabled mod", QMod.assembly);
             }
             else
             {
                 Logger.Log("Disabled mod", QMod.assembly);
             }
             IBA_Config.Enable = e.Value;
             PlayerPrefsExtra.SetBool("ibaEnable", e.Value);
             PlayerPrefs.Save();
         }
     }
     catch (Exception ex)
     {
         Logger.Exception(ex, LoggedWhen.Options);
     }
 }
Beispiel #20
0
            public static void Postfix(Drillable __instance)
            {
                CDC_Config cdc = __instance.gameObject.AddComponent <CDC_Config>();

                Logger.Log("Added component to Drillable!");
            }