From 7ae3c0131e8c252b74af26de0988c86f9c79da2b Mon Sep 17 00:00:00 2001 From: aedenthorn Date: Fri, 17 Sep 2021 10:33:16 -0400 Subject: [PATCH] etc --- AdvancedSigns/BepInExPlugin.cs | 10 +- AnimationSpeed/BepInExPlugin.cs | 12 +- AutoFeed/BepInExPlugin.cs | 17 +-- AutoFuel/BepInExPlugin.cs | 9 +- AutoSplitStack/BepInExPlugin.cs | 9 +- AutoStore/BepInExPlugin.cs | 12 +- Backpack/BepInExPlugin.cs | 4 +- BackpackRedux/BepInExPlugin.cs | 13 +- BuildPieceReplace/BepInExPlugin.cs | 4 +- BuildPieceTweaks/BepInExPlugin.cs | 6 +- BuildingDamageMod/BepInExPlugin.cs | 15 +-- BuildingDemolish/BepInExPlugin.cs | 26 ++-- BuildingHealthDisplay/BepInExPlugin.cs | 11 +- BuildingRepair/BepInExPlugin.cs | 24 ++-- BuildingRepairRequiresMats/BepInExPlugin.cs | 4 +- CartSupport/BepInExPlugin.cs | 10 +- CharacterEdit/BepInExPlugin.cs | 11 +- ClockMod/BepInExPlugin.cs | 2 +- ClockMod/Clock.cs | 4 +- Compass/BepInExPlugin.cs | 11 +- ConsoleTweaks/BepInExPlugin.cs | 6 +- ControllerButtonSwitch/BepInExPlugin.cs | 7 +- CookingStationTweaks/BepInExPlugin.cs | 66 +++++++++- CraftFromContainers/BepInExPlugin.cs | 14 +- CraftingFilter/BepInExPlugin.cs | 13 +- CustomArmorStats/BepInExPlugin.cs | 12 +- CustomAudio/BepInExPlugin.cs | 4 +- CustomContainerSizes/BepInExPlugin.cs | 6 +- CustomDreamTexts/BepInExPlugin.cs | 16 +-- CustomGraphicsSettings/BepInExPlugin.cs | 13 +- CustomItemInfoDisplay/BepInExPlugin.cs | 12 +- CustomItems/BepInExPlugin.cs | 4 +- CustomLoadingScreens/BepInExPlugin.cs | 11 +- CustomMeshes/BepInExPlugin.cs | 4 +- CustomServerLoadingScreen/BepInExPlugin.cs | 12 +- CustomTextures/BepInExPlugin.cs | 11 +- CustomToolbarHotkeys/BepInExPlugin.cs | 13 +- CustomUI/BepInExPlugin.cs | 14 +- CustomWeapons/BepInExPlugin.cs | 10 +- CustomizableToolbar/BepInExPlugin.cs | 12 +- DamageMod/BepInExPlugin.cs | 13 +- DayCycle/BepInExPlugin.cs | 14 +- DeathTweaks/BepInExPlugin.cs | 17 ++- DeleteThis/BepInExPlugin.cs | 12 +- DespawnTrader/BepInExPlugin.cs | 14 +- DiscardDroppedItems/BepInExPlugin.cs | 2 +- DiscardInventoryItem/BepInExPlugin.cs | 138 ++++++++++---------- DungeonRegen/BepInExPlugin.cs | 4 +- Durability/Durability.cs | 12 +- EmoteKeys/BepInExPlugin.cs | 11 +- EnableConsole/BepInExPlugin.cs | 10 +- EquipMultipleUtilityItems/BepInExPlugin.cs | 13 +- ExtendedPlayerInventory/BepInExPlugin.cs | 12 +- GrassTweaks/BepInExPlugin.cs | 6 +- HelmetHairToggle/BepInExPlugin.cs | 15 ++- HereFishy/BepInExPlugin.cs | 13 +- HoeRadius/BepInExPlugin.cs | 4 +- HotbarSwitch/BepInExPlugin.cs | 4 +- InstantMonsterDrop/BepInExPlugin.cs | 4 +- InventoryHUD/BepInExPlugin.cs | 4 +- ItemStorageComponent/BepInExPlugin.cs | 4 +- JumpRunDodgeSneakWalk/BepInExPlugin.cs | 4 +- LockableDoors/BepInExPlugin.cs | 4 +- MapCoordinateDisplay/BepInExPlugin.cs | 4 +- MapDetails/BepInExPlugin.cs | 4 +- MapTeleport/BepInExPlugin.cs | 9 +- MerchantSpawnTweaks/BepInExPlugin.cs | 4 +- MiningMod/BepInExPlugin.cs | 4 +- MonsterAITweaks/BepInExPlugin.cs | 4 +- MovableChestInventory/BepInExPlugin.cs | 4 +- MovableInventoryWindows/BepInExPlugin.cs | 4 +- NexusUpdate/BepInExPlugin.cs | 4 +- NotificationTweaks/BepInExPlugin.cs | 4 +- PlantMod/BepInExPlugin.cs | 4 +- PlayerModelSwitch/BepInExPlugin.cs | 4 +- QuickCart/BepInExPlugin.cs | 6 +- RealClockMod/Clock.cs | 4 +- RecipeCustomization/BepInExPlugin.cs | 4 +- RememberIP/BepInExPlugin.cs | 4 +- RepairRequiresMats/BepInExPlugin.cs | 4 +- RepairSpecificItems/BepInExPlugin.cs | 4 +- RepeatActions/BepInExPlugin.cs | 4 +- RequirementCheck/BepInExPlugin.cs | 4 +- ServerRewards/Patches.cs | 4 +- ShipSpeed/BepInExPlugin.cs | 4 +- ShowContainerContents/BepInExPlugin.cs | 4 +- SimpleSort/BepInExPlugin.cs | 4 +- SleepWithoutSpawn/BepInExPlugin.cs | 8 +- TerraformTweaks/BepInExPlugin.cs | 4 +- TerrainReset/BepInExPlugin.cs | 4 +- TimeMod/BepInExPlugin.cs | 4 +- TorchMod/TorchMod.cs | 4 +- 92 files changed, 503 insertions(+), 432 deletions(-) diff --git a/AdvancedSigns/BepInExPlugin.cs b/AdvancedSigns/BepInExPlugin.cs index c38e806..ee320b5 100644 --- a/AdvancedSigns/BepInExPlugin.cs +++ b/AdvancedSigns/BepInExPlugin.cs @@ -5,7 +5,7 @@ namespace AdvancedSigns { - [BepInPlugin("aedenthorn.AdvancedSigns", "Advanced Signs", "0.1.1")] + [BepInPlugin("aedenthorn.AdvancedSigns", "Advanced Signs", "0.2.0")] public class BepInExPlugin : BaseUnityPlugin { private static readonly bool isDebug = true; @@ -111,10 +111,10 @@ private static Font GetFont(string fontName, int fontSize) return Font.CreateDynamicFontFromOSFont(fontName, fontSize); } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -124,8 +124,8 @@ static bool Prefix(Console __instance) context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/AnimationSpeed/BepInExPlugin.cs b/AnimationSpeed/BepInExPlugin.cs index c249c31..6d19f3d 100644 --- a/AnimationSpeed/BepInExPlugin.cs +++ b/AnimationSpeed/BepInExPlugin.cs @@ -10,7 +10,7 @@ namespace AnimationSpeed { - [BepInPlugin("aedenthorn.AnimationSpeed", "Animation Speed", "0.7.0")] + [BepInPlugin("aedenthorn.AnimationSpeed", "Animation Speed", "0.8.0")] public class BepInExPlugin: BaseUnityPlugin { public static Dictionary lastAnims = new Dictionary(); @@ -214,21 +214,21 @@ public static float ChangeSpeed(Character character, Animator animator, float sp return animator.speed; } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; string text = __instance.m_input.text; - if (text.ToLower().Equals("animationspeed reset")) + if (text.ToLower().Equals($"{typeof(BepInExPlugin).Namespace.ToLower()} reset")) { context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { "Animation Speed config reloaded" }).GetValue(); + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/AutoFeed/BepInExPlugin.cs b/AutoFeed/BepInExPlugin.cs index d376aeb..a2c805c 100644 --- a/AutoFeed/BepInExPlugin.cs +++ b/AutoFeed/BepInExPlugin.cs @@ -9,7 +9,7 @@ namespace AutoFeed { - [BepInPlugin("aedenthorn.AutoFeed", "Auto Feed", "0.4.0")] + [BepInPlugin("aedenthorn.AutoFeed", "Auto Feed", "0.5.0")] public class BepInExPlugin: BaseUnityPlugin { public static ConfigEntry isDebug; @@ -238,18 +238,14 @@ private static void ConsumeItem(ItemDrop.ItemData item, MonsterAI monsterAI, Cha { monsterAI.m_onConsumedItem?.Invoke(null); - (character as Humanoid).m_consumeItemEffects.Create(character.transform.position, Quaternion.identity, null, 1f); + (character as Humanoid).m_consumeItemEffects.Create(character.transform.position, Quaternion.identity, null, 1f, -1); Traverse.Create(monsterAI).Field("m_animator").GetValue().SetTrigger("consume"); - if (monsterAI.m_consumeHeal > 0f) - { - character.Heal(monsterAI.m_consumeHeal, true); - } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -258,8 +254,9 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/AutoFuel/BepInExPlugin.cs b/AutoFuel/BepInExPlugin.cs index d2a42c3..b018b92 100644 --- a/AutoFuel/BepInExPlugin.cs +++ b/AutoFuel/BepInExPlugin.cs @@ -398,10 +398,10 @@ public static async void RefuelSmelter(Smelter __instance, ZNetView ___m_nview, } } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -410,8 +410,9 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/AutoSplitStack/BepInExPlugin.cs b/AutoSplitStack/BepInExPlugin.cs index 10986a6..0551741 100644 --- a/AutoSplitStack/BepInExPlugin.cs +++ b/AutoSplitStack/BepInExPlugin.cs @@ -91,10 +91,10 @@ static void Postfix() autoSplitting = false; } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -103,8 +103,9 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/AutoStore/BepInExPlugin.cs b/AutoStore/BepInExPlugin.cs index ef1d775..9de46b3 100644 --- a/AutoStore/BepInExPlugin.cs +++ b/AutoStore/BepInExPlugin.cs @@ -243,19 +243,21 @@ static void Postfix(Container __instance, ZNetView ___m_nview) } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; string text = __instance.m_input.text; - if (text.ToLower().Equals("autostore reset")) + if (text.ToLower().Equals($"{typeof(BepInExPlugin).Namespace.ToLower()} reset")) { context.Config.Reload(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { "AutoStore config reloaded" }).GetValue(); + context.Config.Save(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/Backpack/BepInExPlugin.cs b/Backpack/BepInExPlugin.cs index 7a78fea..f429ae0 100644 --- a/Backpack/BepInExPlugin.cs +++ b/Backpack/BepInExPlugin.cs @@ -355,10 +355,10 @@ static void Prefix() } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/BackpackRedux/BepInExPlugin.cs b/BackpackRedux/BepInExPlugin.cs index 1fa2dd9..ef0b0dd 100644 --- a/BackpackRedux/BepInExPlugin.cs +++ b/BackpackRedux/BepInExPlugin.cs @@ -13,7 +13,7 @@ namespace BackpackRedux { - [BepInPlugin("aedenthorn.BackpackRedux", "Backpack Redux", "0.3.2")] + [BepInPlugin("aedenthorn.BackpackRedux", "Backpack Redux", "0.4.0")] public class BepInExPlugin : BaseUnityPlugin { private static readonly bool isDebug = true; @@ -277,11 +277,10 @@ static void Prefix() } } - - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -290,12 +289,10 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - if (Player.m_localPlayer) LoadBackpackInventory(); - - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/BuildPieceReplace/BepInExPlugin.cs b/BuildPieceReplace/BepInExPlugin.cs index b74f1b0..5f90463 100644 --- a/BuildPieceReplace/BepInExPlugin.cs +++ b/BuildPieceReplace/BepInExPlugin.cs @@ -130,10 +130,10 @@ static void Postfix(Player __instance, bool __result, Piece piece, int ___m_plac } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/BuildPieceTweaks/BepInExPlugin.cs b/BuildPieceTweaks/BepInExPlugin.cs index c66a610..d3ed284 100644 --- a/BuildPieceTweaks/BepInExPlugin.cs +++ b/BuildPieceTweaks/BepInExPlugin.cs @@ -11,7 +11,7 @@ namespace BuildPieceTweaks { - [BepInPlugin("aedenthorn.BuildPieceTweaks", "Build Piece Tweaks", "0.2.5")] + [BepInPlugin("aedenthorn.BuildPieceTweaks", "Build Piece Tweaks", "0.3.0")] public partial class BepInExPlugin : BaseUnityPlugin { private static BepInExPlugin context; @@ -334,10 +334,10 @@ private static PieceData GetDataFromItem(GameObject go, string pieceName) return pieceData; } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/BuildingDamageMod/BepInExPlugin.cs b/BuildingDamageMod/BepInExPlugin.cs index 6eeb438..21bb5d1 100644 --- a/BuildingDamageMod/BepInExPlugin.cs +++ b/BuildingDamageMod/BepInExPlugin.cs @@ -4,11 +4,10 @@ using System; using System.Reflection; using UnityEngine; -using UnityEngine.UI; namespace BuildingDamageMod { - [BepInPlugin("aedenthorn.BuildingDamageMod", "Building Damage Mod", "0.3.2")] + [BepInPlugin("aedenthorn.BuildingDamageMod", "Building Damage Mod", "0.4.0")] public class BepInExPlugin: BaseUnityPlugin { private static readonly bool isDebug = true; @@ -32,10 +31,10 @@ private void Awake() { context = this; modEnabled = Config.Bind("General", "Enabled", true, "Enable this mod"); - creatorDamageMult = Config.Bind("General", "CreatorDamagMult", 1f, "Multiply damage by creators by this much"); - nonCreatorDamageMult = Config.Bind("General", "NonCreatorDamagMult", 1f, "Multiply damage by non-creators by this much"); - uncreatedDamageMult = Config.Bind("General", "UncreatedDamagMult", 1f, "Multiply damage to uncreated buildings by this much"); - naturalDamageMult = Config.Bind("General", "NaturalDamagMult", 1f, "Multiply natural wear damage to buildings by this much"); + creatorDamageMult = Config.Bind("General", "CreatorDamageMult", 1f, "Multiply damage by creators by this much"); + nonCreatorDamageMult = Config.Bind("General", "NonCreatorDamageMult", 1f, "Multiply damage by non-creators by this much"); + uncreatedDamageMult = Config.Bind("General", "UncreatedDamageMult", 1f, "Multiply damage to uncreated buildings by this much"); + naturalDamageMult = Config.Bind("General", "NaturalDamageMult", 1f, "Multiply natural wear damage to buildings by this much"); nexusID = Config.Bind("General", "NexusID", 233, "Nexus mod ID for updates"); if (!modEnabled.Value) @@ -44,10 +43,10 @@ private void Awake() Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), null); } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/BuildingDemolish/BepInExPlugin.cs b/BuildingDemolish/BepInExPlugin.cs index 068d687..e388cdb 100644 --- a/BuildingDemolish/BepInExPlugin.cs +++ b/BuildingDemolish/BepInExPlugin.cs @@ -6,7 +6,7 @@ namespace BuildingDemolish { - [BepInPlugin("aedenthorn.BuildingDemolish", "Building Demolish", "0.4.0")] + [BepInPlugin("aedenthorn.BuildingDemolish", "Building Demolish", "0.5.0")] public class BepInExPlugin : BaseUnityPlugin { private static readonly bool isDebug = true; @@ -122,44 +122,44 @@ private static int DemolishPieces(float radius) } return count; } - - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; string text = __instance.m_input.text; if (text.ToLower().Equals($"{typeof(BepInExPlugin).Namespace.ToLower()} reset")) { - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } if (text.ToLower().Equals($"{typeof(BepInExPlugin).Namespace.ToLower()} demolish")) { - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); + __instance.AddString(text); int count = DemolishPieces(destroyRadius.Value); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} demolished {count} pieces" }).GetValue(); + __instance.AddString($"{context.Info.Metadata.Name} demolished {count} pieces"); return false; } if (text.ToLower().StartsWith($"{typeof(BepInExPlugin).Namespace.ToLower()} demolish ")) { - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - if(int.TryParse(text.Split(' ')[2], out int radius)) + __instance.AddString(text); + if (int.TryParse(text.Split(' ')[2], out int radius)) { int count = DemolishPieces(radius); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} demolished {count} pieces" }).GetValue(); + __instance.AddString($"{context.Info.Metadata.Name} demolished {count} pieces"); } else - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} syntax error" }).GetValue(); + __instance.AddString($"{context.Info.Metadata.Name} syntax error"); return false; } return true; } } - } + } } \ No newline at end of file diff --git a/BuildingHealthDisplay/BepInExPlugin.cs b/BuildingHealthDisplay/BepInExPlugin.cs index 25fd9d6..4faf6ca 100644 --- a/BuildingHealthDisplay/BepInExPlugin.cs +++ b/BuildingHealthDisplay/BepInExPlugin.cs @@ -8,7 +8,7 @@ namespace BuildingHealthDisplay { - [BepInPlugin("aedenthorn.BuildingHealthDisplay", "Building Health Display", "0.3.0")] + [BepInPlugin("aedenthorn.BuildingHealthDisplay", "Building Health Display", "0.4.0")] public class BepInExPlugin : BaseUnityPlugin { private static readonly bool isDebug = true; @@ -178,10 +178,10 @@ static void Postfix(WearNTear __instance) } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -190,8 +190,9 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/BuildingRepair/BepInExPlugin.cs b/BuildingRepair/BepInExPlugin.cs index 866099b..bb3b74d 100644 --- a/BuildingRepair/BepInExPlugin.cs +++ b/BuildingRepair/BepInExPlugin.cs @@ -6,7 +6,7 @@ namespace BuildingRepair { - [BepInPlugin("aedenthorn.BuildingRepair", "Building Repair", "0.1.1")] + [BepInPlugin("aedenthorn.BuildingRepair", "Building Repair", "0.2.0")] public class BepInExPlugin : BaseUnityPlugin { private static readonly bool isDebug = true; @@ -98,44 +98,44 @@ private static int repairPieces(float radius) Player.m_localPlayer.Message(MessageHud.MessageType.Center, string.Format(repairMessage.Value, count)); return count; } - - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; string text = __instance.m_input.text; if (text.ToLower().Equals($"{typeof(BepInExPlugin).Namespace.ToLower()} reset")) { - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); + __instance.AddString(text); context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } if (text.ToLower().Equals($"{typeof(BepInExPlugin).Namespace.ToLower()} repair")) { - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); + __instance.AddString(text); int count = repairPieces(repairRadius.Value); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} repaired {count} pieces" }).GetValue(); + __instance.AddString($"{context.Info.Metadata.Name} repaired {count} pieces"); return false; } if (text.ToLower().StartsWith($"{typeof(BepInExPlugin).Namespace.ToLower()} repair ")) { - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - if(int.TryParse(text.Split(' ')[2], out int radius)) + __instance.AddString(text); + if (int.TryParse(text.Split(' ')[2], out int radius)) { int count = repairPieces(radius); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} repaired {count} pieces" }).GetValue(); + __instance.AddString($"{context.Info.Metadata.Name} repaired {count} pieces"); } else - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} syntax error" }).GetValue(); + __instance.AddString($"{context.Info.Metadata.Name} syntax error"); return false; } return true; } } + } } \ No newline at end of file diff --git a/BuildingRepairRequiresMats/BepInExPlugin.cs b/BuildingRepairRequiresMats/BepInExPlugin.cs index 3048236..0bd3855 100644 --- a/BuildingRepairRequiresMats/BepInExPlugin.cs +++ b/BuildingRepairRequiresMats/BepInExPlugin.cs @@ -228,10 +228,10 @@ private static Recipe RepairRecipe(ItemDrop.ItemData item) } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/CartSupport/BepInExPlugin.cs b/CartSupport/BepInExPlugin.cs index a6d200b..826de2a 100644 --- a/CartSupport/BepInExPlugin.cs +++ b/CartSupport/BepInExPlugin.cs @@ -6,7 +6,7 @@ namespace CartSupport { - [BepInPlugin("aedenthorn.CartSupport", "CartSupport", "0.1.0")] + [BepInPlugin("aedenthorn.CartSupport", "CartSupport", "0.2.0")] public class BepInExPlugin : BaseUnityPlugin { private static BepInExPlugin context; @@ -70,10 +70,10 @@ static void Prefix(Vagon __instance, ZNetView ___m_nview, ref float mass) } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -83,8 +83,8 @@ static bool Prefix(Console __instance) context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/CharacterEdit/BepInExPlugin.cs b/CharacterEdit/BepInExPlugin.cs index f80cdbc..6e206ba 100644 --- a/CharacterEdit/BepInExPlugin.cs +++ b/CharacterEdit/BepInExPlugin.cs @@ -8,7 +8,7 @@ namespace CharacterEdit { - [BepInPlugin("aedenthorn.CharacterEdit", "Character Edit", "0.4.1")] + [BepInPlugin("aedenthorn.CharacterEdit", "Character Edit", "0.5.0")] public class BepInExPlugin : BaseUnityPlugin { private static readonly bool isDebug = true; @@ -192,10 +192,10 @@ private static void StartCharacterEdit() Gogan.LogEvent("Screen", "Enter", "CreateCharacter", 0L); } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -204,8 +204,9 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/ClockMod/BepInExPlugin.cs b/ClockMod/BepInExPlugin.cs index 1ed7740..6d59849 100644 --- a/ClockMod/BepInExPlugin.cs +++ b/ClockMod/BepInExPlugin.cs @@ -5,7 +5,7 @@ namespace ClockMod { - [BepInPlugin("aedenthorn.ClockMod", "Clock Mod", "1.4.3")] + [BepInPlugin("aedenthorn.ClockMod", "Clock Mod", "1.5.0")] public partial class BepInExPlugin: BaseUnityPlugin { diff --git a/ClockMod/Clock.cs b/ClockMod/Clock.cs index a0394ca..3971bb1 100644 --- a/ClockMod/Clock.cs +++ b/ClockMod/Clock.cs @@ -256,10 +256,10 @@ static void Postfix() } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/Compass/BepInExPlugin.cs b/Compass/BepInExPlugin.cs index 5433099..54eaed1 100644 --- a/Compass/BepInExPlugin.cs +++ b/Compass/BepInExPlugin.cs @@ -11,7 +11,7 @@ namespace Compass { - [BepInPlugin("aedenthorn.Compass", "Compass", "0.8.0")] + [BepInPlugin("aedenthorn.Compass", "Compass", "0.9.0")] public class BepInExPlugin : BaseUnityPlugin { private static readonly bool isDebug = true; @@ -291,11 +291,10 @@ static void Prefix(Hud __instance) } } - - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -305,8 +304,8 @@ static bool Prefix(Console __instance) context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/ConsoleTweaks/BepInExPlugin.cs b/ConsoleTweaks/BepInExPlugin.cs index e20fc00..d6d7ea5 100644 --- a/ConsoleTweaks/BepInExPlugin.cs +++ b/ConsoleTweaks/BepInExPlugin.cs @@ -11,7 +11,7 @@ namespace ConsoleTweaks { - [BepInPlugin("aedenthorn.ConsoleTweaks", "Console Tweaks", "0.3.3")] + [BepInPlugin("aedenthorn.ConsoleTweaks", "Console Tweaks", "0.4.0")] public class BepInExPlugin : BaseUnityPlugin { private static readonly bool isDebug = true; @@ -306,10 +306,10 @@ static void Postfix(Console __instance) } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/ControllerButtonSwitch/BepInExPlugin.cs b/ControllerButtonSwitch/BepInExPlugin.cs index f7c1d80..ef60011 100644 --- a/ControllerButtonSwitch/BepInExPlugin.cs +++ b/ControllerButtonSwitch/BepInExPlugin.cs @@ -7,7 +7,7 @@ namespace ControllerButtonSwitch { - [BepInPlugin("aedenthorn.ControllerButtonSwitch", "Controller Button Switch", "0.1.1")] + [BepInPlugin("aedenthorn.ControllerButtonSwitch", "Controller Button Switch", "0.2.0")] public class BepInExPlugin : BaseUnityPlugin { private static readonly bool isDebug = true; @@ -206,10 +206,11 @@ static void Prefix(ZInput __instance) SetButtons(); } } - [HarmonyPatch(typeof(Console), "InputText")] + + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/CookingStationTweaks/BepInExPlugin.cs b/CookingStationTweaks/BepInExPlugin.cs index feb3412..6f91dfe 100644 --- a/CookingStationTweaks/BepInExPlugin.cs +++ b/CookingStationTweaks/BepInExPlugin.cs @@ -7,7 +7,7 @@ namespace CookingStationTweaks { - [BepInPlugin("aedenthorn.CookingStationTweaks", "CookingStationTweaks", "0.2.0")] + [BepInPlugin("aedenthorn.CookingStationTweaks", "CookingStationTweaks", "0.3.0")] public class BepInExPlugin : BaseUnityPlugin { private static BepInExPlugin context; @@ -61,13 +61,17 @@ private void UUpdate() [HarmonyPatch(typeof(CookingStation), "Awake")] static class CookingStation_Awake_Patch { - static void Prefix(CookingStation __instance) + static void Prefix(CookingStation __instance, ref ParticleSystem[] ___m_burntPS, ref ParticleSystem[] ___m_donePS, ref ParticleSystem[] ___m_ps, ref AudioSource[] ___m_as) { if (!modEnabled.Value) return; int count = __instance.m_slots.Length; List newSlots = new List(__instance.m_slots); + + Transform burnt = null; + Transform done = null; + float target = Mathf.RoundToInt(count * slotMultiplier.Value); Dbgl($"Cooking station {__instance.name} awake. Slots {count}, target {target}"); while(count < target) @@ -104,6 +108,7 @@ static void Prefix(CookingStation __instance) c.position = Vector3.Lerp(a.position, b.position, 0.5f); newSlots.Insert(idx+1, c); } + count++; if (count >= target) break; @@ -116,6 +121,53 @@ static void Prefix(CookingStation __instance) for (int i = 0; i < newSlots.Count; i++) newSlots[i].name = "slot" + i; __instance.m_slots = newSlots.ToArray(); + + ___m_ps = new ParticleSystem[__instance.m_slots.Length]; + ___m_as = new AudioSource[__instance.m_slots.Length]; + + + List oldBurnt = new List(); + List oldDone = new List(); + if (___m_burntPS.Length != 0) + { + burnt = ___m_burntPS[0].transform; + ___m_burntPS = new ParticleSystem[__instance.m_slots.Length]; + } + if (___m_donePS.Length != 0) + { + done = ___m_donePS[0].transform; + ___m_donePS = new ParticleSystem[__instance.m_slots.Length]; + } + + for (int i = 0; i < __instance.m_slots.Length; i++) + { + ___m_ps[i] = __instance.m_slots[i].GetComponent(); + ___m_as[i] = __instance.m_slots[i].GetComponent(); + if (burnt) + { + ___m_burntPS[i] = Instantiate(burnt, burnt.parent).GetComponent(); + ___m_burntPS[i].name = "burnt" + i; + ___m_burntPS[i].transform.localPosition = __instance.m_slots[i].localPosition; + ParticleSystem.EmissionModule emissionModule = ___m_burntPS[i].emission; + emissionModule.enabled = false; + } + if (done) + { + ___m_donePS[i] = Instantiate(done, done.parent).GetComponent(); + ___m_donePS[i].name = "done" + i; + ___m_donePS[i].transform.localPosition = __instance.m_slots[i].localPosition; + ParticleSystem.EmissionModule emissionModule = ___m_donePS[i].emission; + emissionModule.enabled = false; + } + } + foreach(var ps in oldBurnt) + { + Destroy(ps.gameObject); + } + foreach(var ps in oldDone) + { + Destroy(ps.gameObject); + } } } @@ -138,7 +190,7 @@ static void Postfix(CookingStation __instance, ZNetView ___m_nview) { if (autoPop.Value) { - Traverse.Create(__instance).Method("SpawnItem", new object[] { itemName }).GetValue(); + Traverse.Create(__instance).Method("SpawnItem", new object[] { itemName, i, __instance.m_slots[i].position }).GetValue(); ___m_nview.GetZDO().Set("slot" + i, ""); ___m_nview.GetZDO().Set("slot" + i, 0f); ___m_nview.InvokeRPC(ZNetView.Everybody, "SetSlotVisual", new object[] { i, "" }); @@ -150,10 +202,10 @@ static void Postfix(CookingStation __instance, ZNetView ___m_nview) } } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -163,8 +215,8 @@ static bool Prefix(Console __instance) context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/CraftFromContainers/BepInExPlugin.cs b/CraftFromContainers/BepInExPlugin.cs index e49ff68..bedf787 100644 --- a/CraftFromContainers/BepInExPlugin.cs +++ b/CraftFromContainers/BepInExPlugin.cs @@ -12,7 +12,7 @@ namespace CraftFromContainers { - [BepInPlugin("aedenthorn.CraftFromContainers", "Craft From Containers", "2.1.4")] + [BepInPlugin("aedenthorn.CraftFromContainers", "Craft From Containers", "2.2.0")] public class BepInExPlugin: BaseUnityPlugin { private static bool wasAllowed; @@ -131,8 +131,8 @@ public static List GetNearbyContainers(Vector3 center) && container?.transform != null && container.GetInventory() != null && (m_range.Value <= 0 || Vector3.Distance(center, container.transform.position) < m_range.Value) - && (!PrivateArea.CheckInPrivateArea(container.transform.position) || PrivateArea.CheckAccess(container.transform.position, 0f, true)) - && (!container.m_checkGuardStone || PrivateArea.CheckAccess(container.transform.position, 0f, false, false)) + //&& (!PrivateArea.CheckInPrivateArea(container.transform.position) || PrivateArea.CheckAccess(container.transform.position, 0f, true)) + //&& (!container.m_checkGuardStone || PrivateArea.CheckAccess(container.transform.position, 0f, false, false)) && Traverse.Create(container).Method("CheckAccess", new object[] { Player.m_localPlayer.GetPlayerID() }).GetValue() && !container.IsInUse()) { //container.GetComponent()?.ClaimOwnership(); @@ -1185,10 +1185,10 @@ static IEnumerable Transpiler(IEnumerable inst } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -1197,8 +1197,8 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { "Craft From Containers config reloaded" }).GetValue(); + __instance.AddString(text); + __instance.AddString("Craft From Containers config reloaded"); return false; } return true; diff --git a/CraftingFilter/BepInExPlugin.cs b/CraftingFilter/BepInExPlugin.cs index 9a936be..71b7839 100644 --- a/CraftingFilter/BepInExPlugin.cs +++ b/CraftingFilter/BepInExPlugin.cs @@ -12,7 +12,7 @@ namespace CraftingFilter { - [BepInPlugin("aedenthorn.CraftingFilter", "Crafting Filter", "0.5.1")] + [BepInPlugin("aedenthorn.CraftingFilter", "Crafting Filter", "0.6.0")] public class BepInExPlugin : BaseUnityPlugin { @@ -377,11 +377,10 @@ static void Postfix(InventoryGui __instance) } - - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -390,9 +389,9 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - context.LoadCategories(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/CustomArmorStats/BepInExPlugin.cs b/CustomArmorStats/BepInExPlugin.cs index 062e251..916129d 100644 --- a/CustomArmorStats/BepInExPlugin.cs +++ b/CustomArmorStats/BepInExPlugin.cs @@ -12,7 +12,7 @@ namespace CustomArmorStats { - [BepInPlugin("aedenthorn.CustomArmorStats", "Custom Armor Stats", "0.2.5")] + [BepInPlugin("aedenthorn.CustomArmorStats", "Custom Armor Stats", "0.3.0")] public partial class BepInExPlugin : BaseUnityPlugin { private static BepInExPlugin context; @@ -92,8 +92,8 @@ static void Postfix(ref ItemDrop __instance) } } - [HarmonyPatch(typeof(Humanoid), "DamageArmorDurability")] - static class DamageArmorDurability_Patch + [HarmonyPatch(typeof(Player), "DamageArmorDurability")] + static class Player_DamageArmorDurability_Patch { static void Prefix(ref HitData hit) { @@ -249,7 +249,7 @@ static void Postfix(float dt, Player __instance, ItemDrop.ItemData ___m_chestIte { ___m_seman.RemoveStatusEffect("Wet", true); } - else if (water == HitData.DamageModifier.VeryResistant && !__instance.InWaterSwimDepth()) + else if (water == HitData.DamageModifier.VeryResistant && !__instance.InLiquidSwimDepth()) { ___m_seman.RemoveStatusEffect("Wet", true); } @@ -408,10 +408,10 @@ private static ArmorData GetArmorDataFromItem(ItemDrop.ItemData item, string ite return armor; } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/CustomAudio/BepInExPlugin.cs b/CustomAudio/BepInExPlugin.cs index 14730b5..8c90ad4 100644 --- a/CustomAudio/BepInExPlugin.cs +++ b/CustomAudio/BepInExPlugin.cs @@ -533,10 +533,10 @@ static void Postfix(Fireplace __instance) } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/CustomContainerSizes/BepInExPlugin.cs b/CustomContainerSizes/BepInExPlugin.cs index 0f83c16..7448a10 100644 --- a/CustomContainerSizes/BepInExPlugin.cs +++ b/CustomContainerSizes/BepInExPlugin.cs @@ -7,7 +7,7 @@ namespace CustomContainerSizes { - [BepInPlugin("aedenthorn.CustomContainerSizes", "Custom Container Sizes", "0.5.2")] + [BepInPlugin("aedenthorn.CustomContainerSizes", "Custom Container Sizes", "0.6.0")] public class BepInExPlugin : BaseUnityPlugin { private static readonly bool isDebug = true; @@ -126,10 +126,10 @@ static void Postfix(Container __instance, Inventory ___m_inventory) } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/CustomDreamTexts/BepInExPlugin.cs b/CustomDreamTexts/BepInExPlugin.cs index 294dd00..cdea73b 100644 --- a/CustomDreamTexts/BepInExPlugin.cs +++ b/CustomDreamTexts/BepInExPlugin.cs @@ -8,7 +8,7 @@ namespace CustomDreamTexts { - [BepInPlugin("aedenthorn.CustomDreamTexts", "Custom Dream Texts", "0.1.0")] + [BepInPlugin("aedenthorn.CustomDreamTexts", "Custom Dream Texts", "0.2.0")] public class BepInExPlugin: BaseUnityPlugin { public static ConfigEntry isDebug; @@ -195,10 +195,11 @@ private static Font GetFont(string fontName, int fontSize) return Font.CreateDynamicFontFromOSFont(fontName, fontSize); } - [HarmonyPatch(typeof(Console), "InputText")] + + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -208,15 +209,12 @@ static bool Prefix(Console __instance) context.Config.Reload(); context.Config.Save(); - if (Hud.instance) - LoadDreams(); - - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; } } } -} +} \ No newline at end of file diff --git a/CustomGraphicsSettings/BepInExPlugin.cs b/CustomGraphicsSettings/BepInExPlugin.cs index 93dfc1c..381d3fb 100644 --- a/CustomGraphicsSettings/BepInExPlugin.cs +++ b/CustomGraphicsSettings/BepInExPlugin.cs @@ -6,7 +6,7 @@ namespace CustomGraphicsSettings { - [BepInPlugin("aedenthorn.CustomGraphicsSettings", "Custom Graphics Settings", "0.4.0")] + [BepInPlugin("aedenthorn.CustomGraphicsSettings", "Custom Graphics Settings", "0.5.0")] public class BepInExPlugin: BaseUnityPlugin { private static readonly bool isDebug = true; @@ -136,10 +136,11 @@ private static void SetGraphicsSettings() QualitySettings.vSyncCount = vSyncCount.Value; } - [HarmonyPatch(typeof(Console), "InputText")] + + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -148,9 +149,9 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - SetGraphicsSettings(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/CustomItemInfoDisplay/BepInExPlugin.cs b/CustomItemInfoDisplay/BepInExPlugin.cs index ce167a2..a0956f2 100644 --- a/CustomItemInfoDisplay/BepInExPlugin.cs +++ b/CustomItemInfoDisplay/BepInExPlugin.cs @@ -9,7 +9,7 @@ namespace CustomItemInfoDisplay { - [BepInPlugin("aedenthorn.CustomItemInfoDisplay", "Custom Item Info Display", "0.1.1")] + [BepInPlugin("aedenthorn.CustomItemInfoDisplay", "Custom Item Info Display", "0.2.0")] public partial class BepInExPlugin : BaseUnityPlugin { private static BepInExPlugin context; @@ -304,10 +304,10 @@ private static string GetSpawnName(ItemDrop.ItemData item) return name; } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -316,9 +316,9 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - GetTooltipTemplates(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/CustomItems/BepInExPlugin.cs b/CustomItems/BepInExPlugin.cs index aeeab81..8b8bda4 100644 --- a/CustomItems/BepInExPlugin.cs +++ b/CustomItems/BepInExPlugin.cs @@ -521,10 +521,10 @@ private static Transform RecursiveFind(Transform parent, string childName) } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/CustomLoadingScreens/BepInExPlugin.cs b/CustomLoadingScreens/BepInExPlugin.cs index 449242d..7500736 100644 --- a/CustomLoadingScreens/BepInExPlugin.cs +++ b/CustomLoadingScreens/BepInExPlugin.cs @@ -11,7 +11,7 @@ namespace CustomLoadingScreens { - [BepInPlugin("aedenthorn.CustomLoadingScreens", "Custom Loading Screens", "0.3.1")] + [BepInPlugin("aedenthorn.CustomLoadingScreens", "Custom Loading Screens", "0.4.0")] public partial class BepInExPlugin: BaseUnityPlugin { private static readonly bool isDebug = true; @@ -248,10 +248,10 @@ public static void Postfix(Hud __instance, bool ___m_haveSetupLoadScreen, ref bo } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -260,8 +260,9 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/CustomMeshes/BepInExPlugin.cs b/CustomMeshes/BepInExPlugin.cs index ed3b859..7999724 100644 --- a/CustomMeshes/BepInExPlugin.cs +++ b/CustomMeshes/BepInExPlugin.cs @@ -426,10 +426,10 @@ static void Postfix(Player __instance) } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/CustomServerLoadingScreen/BepInExPlugin.cs b/CustomServerLoadingScreen/BepInExPlugin.cs index a78fc1c..2b736ba 100644 --- a/CustomServerLoadingScreen/BepInExPlugin.cs +++ b/CustomServerLoadingScreen/BepInExPlugin.cs @@ -11,7 +11,7 @@ namespace CustomServerLoadingScreen { - [BepInPlugin("aedenthorn.CustomServerLoadingScreen", "Custom Server Loading Screen", "0.3.2")] + [BepInPlugin("aedenthorn.CustomServerLoadingScreen", "Custom Server Loading Screen", "0.4.0")] public partial class BepInExPlugin: BaseUnityPlugin { private static readonly bool isDebug = true; @@ -249,10 +249,11 @@ public static void Postfix(Hud __instance, bool ___m_haveSetupLoadScreen, ref bo } } - [HarmonyPatch(typeof(Console), "InputText")] + + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -261,8 +262,9 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/CustomTextures/BepInExPlugin.cs b/CustomTextures/BepInExPlugin.cs index 7fcf649..9ba93db 100644 --- a/CustomTextures/BepInExPlugin.cs +++ b/CustomTextures/BepInExPlugin.cs @@ -11,7 +11,7 @@ namespace CustomTextures { - [BepInPlugin("aedenthorn.CustomTextures", "Custom Textures", "2.3.0")] + [BepInPlugin("aedenthorn.CustomTextures", "Custom Textures", "2.4.0")] public partial class BepInExPlugin: BaseUnityPlugin { public static ConfigEntry modEnabled; @@ -103,10 +103,10 @@ private static bool ShouldLoadCustomTexture(string id) return texturesToLoad.Contains(id) || layersToLoad.Contains(id); } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -115,8 +115,9 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/CustomToolbarHotkeys/BepInExPlugin.cs b/CustomToolbarHotkeys/BepInExPlugin.cs index 4650f79..c75eada 100644 --- a/CustomToolbarHotkeys/BepInExPlugin.cs +++ b/CustomToolbarHotkeys/BepInExPlugin.cs @@ -7,7 +7,7 @@ namespace CustomToolbarHotkeys { - [BepInPlugin("aedenthorn.CustomToolbarHotkeys", "Custom Toolbar Hotkeys", "0.3.0")] + [BepInPlugin("aedenthorn.CustomToolbarHotkeys", "Custom Toolbar Hotkeys", "0.4.0")] public class BepInExPlugin : BaseUnityPlugin { private static readonly bool isDebug = true; @@ -159,12 +159,10 @@ static void Postfix(InventoryGrid ___m_playerGrid, Animator ___m_animator) } } - - - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -173,8 +171,9 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/CustomUI/BepInExPlugin.cs b/CustomUI/BepInExPlugin.cs index 48add6f..56b348c 100644 --- a/CustomUI/BepInExPlugin.cs +++ b/CustomUI/BepInExPlugin.cs @@ -8,7 +8,7 @@ namespace CustomUI { - [BepInPlugin("aedenthorn.CustomUI", "Custom UI", "0.3.0")] + [BepInPlugin("aedenthorn.CustomUI", "Custom UI", "0.4.0")] public class BepInExPlugin : BaseUnityPlugin { private static readonly bool isDebug = true; @@ -379,12 +379,10 @@ private static void SetElementPositions() } } - - - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -394,10 +392,8 @@ static bool Prefix(Console __instance) context.Config.Reload(); context.Config.Save(); - SetElementPositions(); - - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/CustomWeapons/BepInExPlugin.cs b/CustomWeapons/BepInExPlugin.cs index ff795a0..5109b41 100644 --- a/CustomWeapons/BepInExPlugin.cs +++ b/CustomWeapons/BepInExPlugin.cs @@ -10,7 +10,7 @@ namespace CustomWeaponStats { - [BepInPlugin("aedenthorn.CustomWeaponStats", "Custom Weapon Stats", "0.5.1")] + [BepInPlugin("aedenthorn.CustomWeaponStats", "Custom Weapon Stats", "0.6.1")] public partial class BepInExPlugin : BaseUnityPlugin { private static BepInExPlugin context; @@ -100,8 +100,8 @@ static void Postfix(ref ItemDrop __instance) } } - [HarmonyPatch(typeof(Attack), "GetStaminaUsage")] - static class GetStaminaUsage_Patch + [HarmonyPatch(typeof(Attack), "GetAttackStamina")] + static class GetAttackStamina_Patch { static void Postfix(ref float __result) { @@ -360,10 +360,10 @@ private static void CheckModFolder() } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/CustomizableToolbar/BepInExPlugin.cs b/CustomizableToolbar/BepInExPlugin.cs index 0ed3e88..0353e64 100644 --- a/CustomizableToolbar/BepInExPlugin.cs +++ b/CustomizableToolbar/BepInExPlugin.cs @@ -5,7 +5,7 @@ namespace CustomizableToolbar { - [BepInPlugin("aedenthorn.CustomizableToolbar", "Customizable Toolbar", "0.2.1")] + [BepInPlugin("aedenthorn.CustomizableToolbar", "Customizable Toolbar", "0.3.0")] public class BepInExPlugin : BaseUnityPlugin { private static readonly bool isDebug = true; @@ -135,10 +135,11 @@ static void Postfix(HotkeyBar __instance) lastMousePos = mousePos; } } - [HarmonyPatch(typeof(Console), "InputText")] + + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -147,8 +148,9 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/DamageMod/BepInExPlugin.cs b/DamageMod/BepInExPlugin.cs index 49be378..a08d2bd 100644 --- a/DamageMod/BepInExPlugin.cs +++ b/DamageMod/BepInExPlugin.cs @@ -6,7 +6,7 @@ namespace DamageMod { - [BepInPlugin("aedenthorn.DamageMod", "Damage Mod", "0.2.1")] + [BepInPlugin("aedenthorn.DamageMod", "Damage Mod", "0.3.0")] public class BepInExPlugin: BaseUnityPlugin { private static readonly bool isDebug = true; @@ -109,10 +109,11 @@ static void Prefix(Character __instance, ref HitData hit) } } - [HarmonyPatch(typeof(Console), "InputText")] + + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -121,9 +122,9 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - SetCustomDamages(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/DayCycle/BepInExPlugin.cs b/DayCycle/BepInExPlugin.cs index ad11c2d..47703a1 100644 --- a/DayCycle/BepInExPlugin.cs +++ b/DayCycle/BepInExPlugin.cs @@ -6,7 +6,7 @@ namespace DayCycle { - [BepInPlugin("aedenthorn.DayCycle", "DayCycle", "0.7.1")] + [BepInPlugin("aedenthorn.DayCycle", "DayCycle", "0.8.0")] public class BepInExPlugin: BaseUnityPlugin { private static readonly bool isDebug = true; @@ -171,21 +171,23 @@ static void Postfix(ref float fraction, ref float ___m_smoothDayFraction) } } */ - [HarmonyPatch(typeof(Console), "InputText")] + + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; string text = __instance.m_input.text; - if (text.ToLower().Equals("daycycle reset")) + if (text.ToLower().Equals($"{typeof(BepInExPlugin).Namespace.ToLower()} reset")) { context.Config.Reload(); context.Config.Save(); + + __instance.AddString(text); Traverse.Create(EnvMan.instance).Field("m_dayLengthSec").SetValue((long)Mathf.Round(vanillaDayLengthSec / dayRate.Value)); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { "Day Cycle config reloaded" }).GetValue(); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/DeathTweaks/BepInExPlugin.cs b/DeathTweaks/BepInExPlugin.cs index 2452d7d..19b8ac1 100644 --- a/DeathTweaks/BepInExPlugin.cs +++ b/DeathTweaks/BepInExPlugin.cs @@ -111,7 +111,7 @@ private void Start() [HarmonyPriority(Priority.First)] static class OnDeath_Patch { - static bool Prefix(Player __instance, Inventory ___m_inventory, ref float ___m_timeSinceDeath, float ___m_hardDeathCooldown, ZNetView ___m_nview, List ___m_foods, Skills ___m_skills) + static bool Prefix(Player __instance, Inventory ___m_inventory, ref float ___m_timeSinceDeath, float ___m_hardDeathCooldown, ZNetView ___m_nview, List ___m_foods, Skills ___m_skills, SEMan ___m_seman) { if (!modEnabled.Value) return true; @@ -245,8 +245,8 @@ static bool Prefix(Player __instance, Inventory ___m_inventory, ref float ___m_t { ___m_skills.OnDeath(); } + ___m_seman.RemoveAllStatusEffects(false); Game.instance.RequestRespawn(10f); - ___m_timeSinceDeath = 0; if (!hardDeath) @@ -255,6 +255,7 @@ static bool Prefix(Player __instance, Inventory ___m_inventory, ref float ___m_t } __instance.Message(MessageHud.MessageType.Center, "$msg_youdied", 0, null); __instance.ShowTutorial("death", false); + Minimap.instance.AddPin(__instance.transform.position, Minimap.PinType.Death, string.Format("$hud_mapday {0}", EnvMan.instance.GetDay(ZNet.instance.GetTimeSeconds())), true, false, 0L); string eventLabel = "biome:" + __instance.GetCurrentBiome().ToString(); Gogan.LogEvent("Game", "Death", eventLabel, 0L); @@ -384,18 +385,22 @@ static bool Prefix() } } - [HarmonyPatch(typeof(Console), "InputText")] + + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; string text = __instance.m_input.text; if (text.ToLower().Equals($"{typeof(BepInExPlugin).Namespace.ToLower()} reset")) { - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + context.Config.Reload(); + context.Config.Save(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/DeleteThis/BepInExPlugin.cs b/DeleteThis/BepInExPlugin.cs index d5da2e9..029c429 100644 --- a/DeleteThis/BepInExPlugin.cs +++ b/DeleteThis/BepInExPlugin.cs @@ -6,7 +6,7 @@ namespace DeleteThis { - [BepInPlugin("aedenthorn.DeleteThis", "Delete This", "0.1.1")] + [BepInPlugin("aedenthorn.DeleteThis", "Delete This", "0.2.0")] public class BepInExPlugin : BaseUnityPlugin { private static readonly bool isDebug = true; @@ -84,10 +84,11 @@ private void Update() } } - [HarmonyPatch(typeof(Console), "InputText")] + + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -96,8 +97,9 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/DespawnTrader/BepInExPlugin.cs b/DespawnTrader/BepInExPlugin.cs index a490430..d5ef97c 100644 --- a/DespawnTrader/BepInExPlugin.cs +++ b/DespawnTrader/BepInExPlugin.cs @@ -6,7 +6,7 @@ namespace DespawnTrader { - [BepInPlugin("aedenthorn.DespawnTrader", "Despawn Trader", "0.1.0")] + [BepInPlugin("aedenthorn.DespawnTrader", "Despawn Trader", "0.2.0")] public class BepInExPlugin : BaseUnityPlugin { private static readonly bool isDebug = true; @@ -70,20 +70,22 @@ private static bool CheckKeyHeld(string value) } } - [HarmonyPatch(typeof(Console), "InputText")] + + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; string text = __instance.m_input.text; - if (text.ToLower().Equals("despawntrader reset")) + if (text.ToLower().Equals($"{typeof(BepInExPlugin).Namespace.ToLower()} reset")) { context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { "despawn trader config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/DiscardDroppedItems/BepInExPlugin.cs b/DiscardDroppedItems/BepInExPlugin.cs index 5ccbdbe..fc4c44b 100644 --- a/DiscardDroppedItems/BepInExPlugin.cs +++ b/DiscardDroppedItems/BepInExPlugin.cs @@ -6,7 +6,7 @@ namespace DiscardDroppedItems { - [BepInPlugin("aedenthorn.DiscardDroppedItems", "Discard Dropped Items", "0.1.2")] + [BepInPlugin("aedenthorn.DiscardDroppedItems", "Discard Dropped Items", "0.2.0")] public class BepInExPlugin : BaseUnityPlugin { private static readonly bool isDebug = true; diff --git a/DiscardInventoryItem/BepInExPlugin.cs b/DiscardInventoryItem/BepInExPlugin.cs index ee44569..9fd2c2d 100644 --- a/DiscardInventoryItem/BepInExPlugin.cs +++ b/DiscardInventoryItem/BepInExPlugin.cs @@ -10,12 +10,12 @@ namespace DiscardInventoryItem { - [BepInPlugin("aedenthorn.DiscardInventoryItem", "Discard or Recycle Inventory Items", "0.6.1")] + [BepInPlugin("aedenthorn.DiscardInventoryItem", "Discard or Recycle Inventory Items", "0.7.0")] public class BepInExPlugin: BaseUnityPlugin { private static readonly bool isDebug = true; - public static ConfigEntry m_hotkey; + public static ConfigEntry hotKey; public static ConfigEntry modEnabled; public static ConfigEntry returnUnknownResources; public static ConfigEntry returnEnchantedResources; @@ -34,7 +34,7 @@ private void Awake() { context = this; - m_hotkey = Config.Bind("General", "DiscardHotkey", "delete", "The hotkey to discard an item"); + hotKey = Config.Bind("General", "DiscardHotkey", "delete", "The hotkey to discard an item"); modEnabled = Config.Bind("General", "Enabled", true, "Enable this mod"); returnUnknownResources = Config.Bind("General", "ReturnUnknownResources", false, "Return resources if recipe is unknown"); returnEnchantedResources = Config.Bind("General", "ReturnEnchantedResources", false, "Return resources for Epic Loot enchantments"); @@ -58,72 +58,72 @@ static class UpdateItemDrag_Patch { static void Postfix(InventoryGui __instance, ItemDrop.ItemData ___m_dragItem, Inventory ___m_dragInventory, int ___m_dragAmount, ref GameObject ___m_dragGo) { - if(Input.GetKeyDown(m_hotkey.Value) && ___m_dragItem != null && ___m_dragInventory.ContainsItem(___m_dragItem)) + if (!modEnabled.Value || !Input.GetKeyDown(hotKey.Value) || ___m_dragItem == null || !___m_dragInventory.ContainsItem(___m_dragItem)) + return; + + Dbgl($"Discarding {___m_dragAmount}/{___m_dragItem.m_stack} {___m_dragItem.m_dropPrefab.name}"); + + if (returnResources.Value > 0) { - Dbgl($"Discarding {___m_dragAmount}/{___m_dragItem.m_stack} {___m_dragItem.m_dropPrefab.name}"); + Recipe recipe = ObjectDB.instance.GetRecipe(___m_dragItem); - if (returnResources.Value > 0) + if (recipe != null && (returnUnknownResources.Value || Player.m_localPlayer.IsRecipeKnown(___m_dragItem.m_shared.m_name))) { - Recipe recipe = ObjectDB.instance.GetRecipe(___m_dragItem); - - if (recipe != null && (returnUnknownResources.Value || Player.m_localPlayer.IsRecipeKnown(___m_dragItem.m_shared.m_name))) - { - Dbgl($"Recipe stack: {recipe.m_amount} num of stacks: {___m_dragAmount / recipe.m_amount}"); + Dbgl($"Recipe stack: {recipe.m_amount} num of stacks: {___m_dragAmount / recipe.m_amount}"); - var reqs = recipe.m_resources.ToList(); + var reqs = recipe.m_resources.ToList(); - bool isMagic = false; - bool cancel = false; - if (epicLootAssembly != null && returnEnchantedResources.Value) - { - isMagic = (bool)epicLootAssembly.GetType("EpicLoot.ItemDataExtensions").GetMethod("IsMagic", BindingFlags.Public | BindingFlags.Static, null, new Type[] { typeof(ItemDrop.ItemData) }, null).Invoke(null, new[] { ___m_dragItem }); - } - if (isMagic) + bool isMagic = false; + bool cancel = false; + if (epicLootAssembly != null && returnEnchantedResources.Value) + { + isMagic = (bool)epicLootAssembly.GetType("EpicLoot.ItemDataExtensions").GetMethod("IsMagic", BindingFlags.Public | BindingFlags.Static, null, new Type[] { typeof(ItemDrop.ItemData) }, null).Invoke(null, new[] { ___m_dragItem }); + } + if (isMagic) + { + int rarity = (int)epicLootAssembly.GetType("EpicLoot.ItemDataExtensions").GetMethod("GetRarity", BindingFlags.Public | BindingFlags.Static).Invoke(null, new[] { ___m_dragItem }); + List> magicReqs = (List>)epicLootAssembly.GetType("EpicLoot.Crafting.EnchantTabController").GetMethod("GetEnchantCosts", BindingFlags.Public | BindingFlags.Static).Invoke(null, new object[] { ___m_dragItem, rarity }); + foreach (var kvp in magicReqs) { - int rarity = (int)epicLootAssembly.GetType("EpicLoot.ItemDataExtensions").GetMethod("GetRarity", BindingFlags.Public | BindingFlags.Static).Invoke(null, new[] { ___m_dragItem }); - List> magicReqs = (List>)epicLootAssembly.GetType("EpicLoot.Crafting.EnchantTabController").GetMethod("GetEnchantCosts", BindingFlags.Public | BindingFlags.Static).Invoke(null, new object[] { ___m_dragItem, rarity }); - foreach (var kvp in magicReqs) + if (!returnUnknownResources.Value && ((ObjectDB.instance.GetRecipe(kvp.Key.m_itemData) && !Player.m_localPlayer.IsRecipeKnown(kvp.Key.m_itemData.m_shared.m_name)) || !Traverse.Create(Player.m_localPlayer).Field("m_knownMaterial").GetValue>().Contains(kvp.Key.m_itemData.m_shared.m_name))) { - if (!returnUnknownResources.Value && ((ObjectDB.instance.GetRecipe(kvp.Key.m_itemData) && !Player.m_localPlayer.IsRecipeKnown(kvp.Key.m_itemData.m_shared.m_name)) || !Traverse.Create(Player.m_localPlayer).Field("m_knownMaterial").GetValue>().Contains(kvp.Key.m_itemData.m_shared.m_name))) - { - Player.m_localPlayer.Message(MessageHud.MessageType.Center, "You don't know all the recipes for this item's materials."); - return; - } - reqs.Add(new Piece.Requirement() - { - m_amount = kvp.Value, - m_resItem = kvp.Key - }); + Player.m_localPlayer.Message(MessageHud.MessageType.Center, "You don't know all the recipes for this item's materials."); + return; } + reqs.Add(new Piece.Requirement() + { + m_amount = kvp.Value, + m_resItem = kvp.Key + }); } + } - if (!cancel && ___m_dragAmount / recipe.m_amount > 0) + if (!cancel && ___m_dragAmount / recipe.m_amount > 0) + { + for (int i = 0; i < ___m_dragAmount / recipe.m_amount; i++) { - for (int i = 0; i < ___m_dragAmount / recipe.m_amount; i++) + foreach (Piece.Requirement req in reqs) { - foreach (Piece.Requirement req in reqs) + int quality = ___m_dragItem.m_quality; + for (int j = quality; j > 0; j--) { - int quality = ___m_dragItem.m_quality; - for (int j = quality; j > 0; j--) + GameObject prefab = ObjectDB.instance.m_items.FirstOrDefault(item => item.GetComponent().m_itemData.m_shared.m_name == req.m_resItem.m_itemData.m_shared.m_name); + ItemDrop.ItemData newItem = prefab.GetComponent().m_itemData.Clone(); + int numToAdd = Mathf.RoundToInt(req.GetAmount(j) * returnResources.Value); + Dbgl($"Returning {numToAdd}/{req.GetAmount(j)} {prefab.name}"); + while (numToAdd > 0) { - GameObject prefab = ObjectDB.instance.m_items.FirstOrDefault(item => item.GetComponent().m_itemData.m_shared.m_name == req.m_resItem.m_itemData.m_shared.m_name); - ItemDrop.ItemData newItem = prefab.GetComponent().m_itemData.Clone(); - int numToAdd = Mathf.RoundToInt(req.GetAmount(j) * returnResources.Value); - Dbgl($"Returning {numToAdd}/{req.GetAmount(j)} {prefab.name}"); - while (numToAdd > 0) + int stack = Mathf.Min(req.m_resItem.m_itemData.m_shared.m_maxStackSize, numToAdd); + numToAdd -= stack; + + if (Player.m_localPlayer.GetInventory().AddItem(prefab.name, stack, req.m_resItem.m_itemData.m_quality, req.m_resItem.m_itemData.m_variant, 0, "") == null) { - int stack = Mathf.Min(req.m_resItem.m_itemData.m_shared.m_maxStackSize, numToAdd); - numToAdd -= stack; - - if (Player.m_localPlayer.GetInventory().AddItem(prefab.name, stack, req.m_resItem.m_itemData.m_quality, req.m_resItem.m_itemData.m_variant, 0, "") == null) - { - ItemDrop component = Instantiate(prefab, Player.m_localPlayer.transform.position + Player.m_localPlayer.transform.forward + Player.m_localPlayer.transform.up, Player.m_localPlayer.transform.rotation).GetComponent(); - component.m_itemData = newItem; - component.m_itemData.m_dropPrefab = prefab; - component.m_itemData.m_stack = stack; - Traverse.Create(component).Method("Save").GetValue(); - } + ItemDrop component = Instantiate(prefab, Player.m_localPlayer.transform.position + Player.m_localPlayer.transform.forward + Player.m_localPlayer.transform.up, Player.m_localPlayer.transform.rotation).GetComponent(); + component.m_itemData = newItem; + component.m_itemData.m_dropPrefab = prefab; + component.m_itemData.m_stack = stack; + Traverse.Create(component).Method("Save").GetValue(); } } } @@ -131,25 +131,26 @@ static void Postfix(InventoryGui __instance, ItemDrop.ItemData ___m_dragItem, In } } } + } - if (___m_dragAmount == ___m_dragItem.m_stack) - { - Player.m_localPlayer.RemoveFromEquipQueue(___m_dragItem); - Player.m_localPlayer.UnequipItem(___m_dragItem, false); - ___m_dragInventory.RemoveItem(___m_dragItem); - } - else - ___m_dragInventory.RemoveItem(___m_dragItem, ___m_dragAmount); - Destroy(___m_dragGo); - ___m_dragGo = null; - __instance.GetType().GetMethod("UpdateCraftingPanel", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(__instance, new object[] { false }); + if (___m_dragAmount == ___m_dragItem.m_stack) + { + Player.m_localPlayer.RemoveFromEquipQueue(___m_dragItem); + Player.m_localPlayer.UnequipItem(___m_dragItem, false); + ___m_dragInventory.RemoveItem(___m_dragItem); } + else + ___m_dragInventory.RemoveItem(___m_dragItem, ___m_dragAmount); + Destroy(___m_dragGo); + ___m_dragGo = null; + __instance.GetType().GetMethod("UpdateCraftingPanel", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(__instance, new object[] { false }); } } - [HarmonyPatch(typeof(Console), "InputText")] + + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -158,8 +159,9 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/DungeonRegen/BepInExPlugin.cs b/DungeonRegen/BepInExPlugin.cs index d606e6b..7c07638 100644 --- a/DungeonRegen/BepInExPlugin.cs +++ b/DungeonRegen/BepInExPlugin.cs @@ -483,10 +483,10 @@ static void Postfix(EnvMan __instance) } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/Durability/Durability.cs b/Durability/Durability.cs index 0bc253f..3904f27 100644 --- a/Durability/Durability.cs +++ b/Durability/Durability.cs @@ -10,7 +10,7 @@ namespace Durability { - [BepInPlugin("aedenthorn.Durability", "Durability", "0.5.2")] + [BepInPlugin("aedenthorn.Durability", "Durability", "0.6.0")] public class Durability : BaseUnityPlugin { private static readonly bool isDebug = true; @@ -105,13 +105,13 @@ static void Postfix(ItemDrop __instance) } } - [HarmonyPatch(typeof(Humanoid), "DamageArmorDurability")] + [HarmonyPatch(typeof(Player), "DamageArmorDurability")] static class DamageArmorDurability_Patch { - static void Prefix(Humanoid __instance, ref float[] __state, ItemDrop.ItemData ___m_chestItem, ItemDrop.ItemData ___m_legItem, ItemDrop.ItemData ___m_shoulderItem, ItemDrop.ItemData ___m_helmetItem) + static void Prefix(Player __instance, ref float[] __state, ItemDrop.ItemData ___m_chestItem, ItemDrop.ItemData ___m_legItem, ItemDrop.ItemData ___m_shoulderItem, ItemDrop.ItemData ___m_helmetItem) { __state = new float[4]; - if (modEnabled.Value && __instance.IsPlayer()) + if (modEnabled.Value) { __state[0] = ___m_chestItem?.m_durability ?? -1f; __state[1] = ___m_legItem?.m_durability ?? -1f; @@ -119,9 +119,9 @@ static void Prefix(Humanoid __instance, ref float[] __state, ItemDrop.ItemData _ __state[3] = ___m_helmetItem?.m_durability ?? -1f; } } - static void Postfix(Humanoid __instance, float[] __state, ref ItemDrop.ItemData ___m_chestItem, ref ItemDrop.ItemData ___m_legItem, ref ItemDrop.ItemData ___m_shoulderItem, ref ItemDrop.ItemData ___m_helmetItem) + static void Postfix(Player __instance, float[] __state, ref ItemDrop.ItemData ___m_chestItem, ref ItemDrop.ItemData ___m_legItem, ref ItemDrop.ItemData ___m_shoulderItem, ref ItemDrop.ItemData ___m_helmetItem) { - if (modEnabled.Value && __instance.IsPlayer()) + if (modEnabled.Value) { if(___m_chestItem != null && __state[0] > ___m_chestItem.m_durability) { diff --git a/EmoteKeys/BepInExPlugin.cs b/EmoteKeys/BepInExPlugin.cs index 1c174ff..bab0b16 100644 --- a/EmoteKeys/BepInExPlugin.cs +++ b/EmoteKeys/BepInExPlugin.cs @@ -128,20 +128,21 @@ private void Update() } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; string text = __instance.m_input.text; - if (text.ToLower().Equals("emotekeys reset")) + if (text.ToLower().Equals($"{typeof(BepInExPlugin).Namespace.ToLower()} reset")) { context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { "Emote Keys config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/EnableConsole/BepInExPlugin.cs b/EnableConsole/BepInExPlugin.cs index 439260e..fb8444a 100644 --- a/EnableConsole/BepInExPlugin.cs +++ b/EnableConsole/BepInExPlugin.cs @@ -50,10 +50,11 @@ static void Postfix() Console.SetConsoleEnabled(true); } } - [HarmonyPatch(typeof(Console), "InputText")] + + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -62,8 +63,9 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/EquipMultipleUtilityItems/BepInExPlugin.cs b/EquipMultipleUtilityItems/BepInExPlugin.cs index 117b35e..1c500dc 100644 --- a/EquipMultipleUtilityItems/BepInExPlugin.cs +++ b/EquipMultipleUtilityItems/BepInExPlugin.cs @@ -8,7 +8,7 @@ namespace EquipMultipleUtilityItems { - [BepInPlugin("aedenthorn.EquipMultipleUtilityItems", "Equip Multiple Utility Items", "0.2.2")] + [BepInPlugin("aedenthorn.EquipMultipleUtilityItems", "Equip Multiple Utility Items", "0.3.0")] public class BepInExPlugin : BaseUnityPlugin { private static BepInExPlugin context; @@ -214,10 +214,11 @@ static void Postfix(ref ItemDrop.ItemData item, int qualityLevel, ref string __r } } - [HarmonyPatch(typeof(Console), "InputText")] + + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -226,9 +227,9 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/ExtendedPlayerInventory/BepInExPlugin.cs b/ExtendedPlayerInventory/BepInExPlugin.cs index 1f11c9a..187b14a 100644 --- a/ExtendedPlayerInventory/BepInExPlugin.cs +++ b/ExtendedPlayerInventory/BepInExPlugin.cs @@ -10,7 +10,7 @@ namespace ExtendedPlayerInventory { - [BepInPlugin("aedenthorn.ExtendedPlayerInventory", "Extended Player Inventory", "0.2.4")] + [BepInPlugin("aedenthorn.ExtendedPlayerInventory", "Extended Player Inventory", "0.3.0")] public class BepInExPlugin : BaseUnityPlugin { private static BepInExPlugin context; @@ -604,10 +604,10 @@ private static void SetElementPositions() } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; @@ -616,9 +616,9 @@ static bool Prefix(Console __instance) { context.Config.Reload(); context.Config.Save(); - - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/GrassTweaks/BepInExPlugin.cs b/GrassTweaks/BepInExPlugin.cs index 49e0883..f7acd82 100644 --- a/GrassTweaks/BepInExPlugin.cs +++ b/GrassTweaks/BepInExPlugin.cs @@ -7,7 +7,7 @@ namespace GrassTweaks { - [BepInPlugin("aedenthorn.GrassTweaks", "Grass Tweaks", "0.1.1")] + [BepInPlugin("aedenthorn.GrassTweaks", "Grass Tweaks", "0.2.0")] public class BepInExPlugin: BaseUnityPlugin { private static readonly bool isDebug = true; @@ -94,10 +94,10 @@ static void Postfix(InstanceRenderer __instance) __instance.m_useXZLodDistance = useXZLodDistance.Value; } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/HelmetHairToggle/BepInExPlugin.cs b/HelmetHairToggle/BepInExPlugin.cs index e0b9cbf..8ce2b10 100644 --- a/HelmetHairToggle/BepInExPlugin.cs +++ b/HelmetHairToggle/BepInExPlugin.cs @@ -6,7 +6,7 @@ namespace HelmetHairToggle { - [BepInPlugin("aedenthorn.HelmetHairToggle", "Helmet Hair Toggle", "0.2.0")] + [BepInPlugin("aedenthorn.HelmetHairToggle", "Helmet Hair Toggle", "0.3.0")] public class BepInExPlugin: BaseUnityPlugin { private static readonly bool isDebug = true; @@ -108,19 +108,22 @@ static void Postfix(VisEquipment __instance, GameObject ___m_helmetItemInstance) } } - [HarmonyPatch(typeof(Console), "InputText")] + + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; string text = __instance.m_input.text; - if (text.ToLower().Equals("hairtoggle reset")) + if (text.ToLower().Equals($"{typeof(BepInExPlugin).Namespace.ToLower()} reset")) { context.Config.Reload(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { "Hair toggle config reloaded" }).GetValue(); + context.Config.Save(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/HereFishy/BepInExPlugin.cs b/HereFishy/BepInExPlugin.cs index f2069ae..0438e33 100644 --- a/HereFishy/BepInExPlugin.cs +++ b/HereFishy/BepInExPlugin.cs @@ -11,7 +11,7 @@ namespace HereFishy { - [BepInPlugin("aedenthorn.HereFishy", "Here Fishy", "0.3.0")] + [BepInPlugin("aedenthorn.HereFishy", "Here Fishy", "0.4.0")] public class BepInExPlugin : BaseUnityPlugin { private static readonly bool isDebug = true; @@ -274,20 +274,21 @@ static bool Prefix() } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; string text = __instance.m_input.text; - if (text.ToLower().Equals("herefishy reset")) + if (text.ToLower().Equals($"{typeof(BepInExPlugin).Namespace.ToLower()} reset")) { context.Config.Reload(); context.Config.Save(); - Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); - Traverse.Create(__instance).Method("AddString", new object[] { "Here Fishy config reloaded" }).GetValue(); + + __instance.AddString(text); + __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); return false; } return true; diff --git a/HoeRadius/BepInExPlugin.cs b/HoeRadius/BepInExPlugin.cs index 5b0670a..2949bd2 100644 --- a/HoeRadius/BepInExPlugin.cs +++ b/HoeRadius/BepInExPlugin.cs @@ -159,10 +159,10 @@ static void Prefix(TerrainOp __instance) } } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/HotbarSwitch/BepInExPlugin.cs b/HotbarSwitch/BepInExPlugin.cs index 77a05eb..46aa72e 100644 --- a/HotbarSwitch/BepInExPlugin.cs +++ b/HotbarSwitch/BepInExPlugin.cs @@ -61,10 +61,10 @@ private void Update() } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/InstantMonsterDrop/BepInExPlugin.cs b/InstantMonsterDrop/BepInExPlugin.cs index 8762c1e..d50bff1 100644 --- a/InstantMonsterDrop/BepInExPlugin.cs +++ b/InstantMonsterDrop/BepInExPlugin.cs @@ -104,10 +104,10 @@ private static IEnumerator DestroyNow(Ragdoll ragdoll, ZNetView nview, EffectLis ZNetScene.instance.Destroy(ragdoll.gameObject); } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/InventoryHUD/BepInExPlugin.cs b/InventoryHUD/BepInExPlugin.cs index 926d43e..31d18f4 100644 --- a/InventoryHUD/BepInExPlugin.cs +++ b/InventoryHUD/BepInExPlugin.cs @@ -297,10 +297,10 @@ static void Prefix(Hud __instance) } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/ItemStorageComponent/BepInExPlugin.cs b/ItemStorageComponent/BepInExPlugin.cs index d3388a2..e830caf 100644 --- a/ItemStorageComponent/BepInExPlugin.cs +++ b/ItemStorageComponent/BepInExPlugin.cs @@ -377,10 +377,10 @@ private static bool ItemIsAllowed(string inventoryName, string itemName) return !itemStorageDict.Values.ToList().Exists(i => i.meta.itemName == inventoryName && ((i.meta.allowedItems.Length > 0 && !i.meta.allowedItems.Contains(itemName)) || (i.meta.allowedItems.Length == 0 && i.meta.disallowedItems.Length > 0 && i.meta.disallowedItems.Contains(itemName)))); } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/JumpRunDodgeSneakWalk/BepInExPlugin.cs b/JumpRunDodgeSneakWalk/BepInExPlugin.cs index 62ae5e0..f9d875f 100644 --- a/JumpRunDodgeSneakWalk/BepInExPlugin.cs +++ b/JumpRunDodgeSneakWalk/BepInExPlugin.cs @@ -159,10 +159,10 @@ static void Prefix(Animator ___m_animator, Character ___m_character, ref float s } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/LockableDoors/BepInExPlugin.cs b/LockableDoors/BepInExPlugin.cs index 3e6a268..b162d86 100644 --- a/LockableDoors/BepInExPlugin.cs +++ b/LockableDoors/BepInExPlugin.cs @@ -392,10 +392,10 @@ static void Postfix(ItemDrop.ItemData __instance, ref Sprite __result) } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/MapCoordinateDisplay/BepInExPlugin.cs b/MapCoordinateDisplay/BepInExPlugin.cs index 22ae22f..0d3b677 100644 --- a/MapCoordinateDisplay/BepInExPlugin.cs +++ b/MapCoordinateDisplay/BepInExPlugin.cs @@ -199,10 +199,10 @@ private void WindowBuilder(int id) } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/MapDetails/BepInExPlugin.cs b/MapDetails/BepInExPlugin.cs index 72a81d3..6bdc1ff 100644 --- a/MapDetails/BepInExPlugin.cs +++ b/MapDetails/BepInExPlugin.cs @@ -240,10 +240,10 @@ private static void SetMaps(Texture2D texture) } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/MapTeleport/BepInExPlugin.cs b/MapTeleport/BepInExPlugin.cs index 625f3cf..26a171f 100644 --- a/MapTeleport/BepInExPlugin.cs +++ b/MapTeleport/BepInExPlugin.cs @@ -1,13 +1,12 @@ using BepInEx; using BepInEx.Configuration; using HarmonyLib; -using System.Collections.Generic; using System.Reflection; using UnityEngine; namespace MapTeleport { - [BepInPlugin("aedenthorn.MapTeleport", "Map Teleport", "0.4.0")] + [BepInPlugin("aedenthorn.MapTeleport", "Map Teleport", "0.5.0")] public class BepInExPlugin: BaseUnityPlugin { private static readonly bool isDebug = true; @@ -52,7 +51,7 @@ static bool Prefix(Minimap __instance) { if (Player.m_localPlayer) { - typeof(Minimap).GetMethod("SetMapMode", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(Minimap.instance, new object[] { 1 }); + __instance.SetMapMode(Minimap.MapMode.Small); Minimap.instance.m_smallRoot.SetActive(true); HeightmapBuilder.HMBuildData data = new HeightmapBuilder.HMBuildData(pos, 1, 1, false, WorldGenerator.instance); @@ -67,10 +66,10 @@ static bool Prefix(Minimap __instance) return false; } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/MerchantSpawnTweaks/BepInExPlugin.cs b/MerchantSpawnTweaks/BepInExPlugin.cs index cb23ff4..eeb5303 100644 --- a/MerchantSpawnTweaks/BepInExPlugin.cs +++ b/MerchantSpawnTweaks/BepInExPlugin.cs @@ -136,10 +136,10 @@ private static void RelocateMerchant(Vector2 coords) } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/MiningMod/BepInExPlugin.cs b/MiningMod/BepInExPlugin.cs index 9709954..c58e1c8 100644 --- a/MiningMod/BepInExPlugin.cs +++ b/MiningMod/BepInExPlugin.cs @@ -231,10 +231,10 @@ static void Prefix(Destructible __instance, ref HitData hit) } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/MonsterAITweaks/BepInExPlugin.cs b/MonsterAITweaks/BepInExPlugin.cs index d79e414..9339c78 100644 --- a/MonsterAITweaks/BepInExPlugin.cs +++ b/MonsterAITweaks/BepInExPlugin.cs @@ -238,10 +238,10 @@ static bool Prefix(MonsterAI __instance, bool alert) } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/MovableChestInventory/BepInExPlugin.cs b/MovableChestInventory/BepInExPlugin.cs index 74f4556..a1a8b78 100644 --- a/MovableChestInventory/BepInExPlugin.cs +++ b/MovableChestInventory/BepInExPlugin.cs @@ -114,10 +114,10 @@ static void Postfix(InventoryGui __instance, Container ___m_currentContainer) lastMousePos = mousePos; } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/MovableInventoryWindows/BepInExPlugin.cs b/MovableInventoryWindows/BepInExPlugin.cs index 9eb89a9..c774275 100644 --- a/MovableInventoryWindows/BepInExPlugin.cs +++ b/MovableInventoryWindows/BepInExPlugin.cs @@ -172,10 +172,10 @@ private static bool IsDragging(RaycastResult rcr, string name) return false; } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/NexusUpdate/BepInExPlugin.cs b/NexusUpdate/BepInExPlugin.cs index f5a5e72..7169915 100644 --- a/NexusUpdate/BepInExPlugin.cs +++ b/NexusUpdate/BepInExPlugin.cs @@ -419,10 +419,10 @@ private IEnumerator CheckPlugins() finishedChecking = true; } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/NotificationTweaks/BepInExPlugin.cs b/NotificationTweaks/BepInExPlugin.cs index e1ad5d4..0bde51c 100644 --- a/NotificationTweaks/BepInExPlugin.cs +++ b/NotificationTweaks/BepInExPlugin.cs @@ -198,10 +198,10 @@ static void Postfix(MessageHud __instance, float ___m_msgQueueTimer, float dt) } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/PlantMod/BepInExPlugin.cs b/PlantMod/BepInExPlugin.cs index 35dfa70..22b2eb1 100644 --- a/PlantMod/BepInExPlugin.cs +++ b/PlantMod/BepInExPlugin.cs @@ -264,10 +264,10 @@ static void Postfix(Plant __instance, ref bool __result) } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/PlayerModelSwitch/BepInExPlugin.cs b/PlayerModelSwitch/BepInExPlugin.cs index 9b7b36f..81ab918 100644 --- a/PlayerModelSwitch/BepInExPlugin.cs +++ b/PlayerModelSwitch/BepInExPlugin.cs @@ -103,10 +103,10 @@ private static void ChangeModel(ref VisEquipment vis, string value, int which) } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/QuickCart/BepInExPlugin.cs b/QuickCart/BepInExPlugin.cs index 69c6c68..88d93ee 100644 --- a/QuickCart/BepInExPlugin.cs +++ b/QuickCart/BepInExPlugin.cs @@ -62,7 +62,7 @@ private void Update() } if(closestVagon != null) { - closestVagon.Interact(Player.m_localPlayer, false); + closestVagon.Interact(Player.m_localPlayer, false, false); } } } @@ -79,10 +79,10 @@ static bool Prefix(Vagon __instance, GameObject go, ref bool __result) } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/RealClockMod/Clock.cs b/RealClockMod/Clock.cs index 5cbd963..8bd2757 100644 --- a/RealClockMod/Clock.cs +++ b/RealClockMod/Clock.cs @@ -249,10 +249,10 @@ static void Postfix() } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/RecipeCustomization/BepInExPlugin.cs b/RecipeCustomization/BepInExPlugin.cs index 16ef31f..c1c4c19 100644 --- a/RecipeCustomization/BepInExPlugin.cs +++ b/RecipeCustomization/BepInExPlugin.cs @@ -294,10 +294,10 @@ private static RecipeData GetPieceRecipeByName(string name) return data; } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/RememberIP/BepInExPlugin.cs b/RememberIP/BepInExPlugin.cs index c738394..688a961 100644 --- a/RememberIP/BepInExPlugin.cs +++ b/RememberIP/BepInExPlugin.cs @@ -90,10 +90,10 @@ private static void SaveIPAddress(string text) context.Config.Save(); } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/RepairRequiresMats/BepInExPlugin.cs b/RepairRequiresMats/BepInExPlugin.cs index fb9b434..9b52539 100644 --- a/RepairRequiresMats/BepInExPlugin.cs +++ b/RepairRequiresMats/BepInExPlugin.cs @@ -254,10 +254,10 @@ private static Recipe RepairRecipe(ItemDrop.ItemData item, bool log = false) } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/RepairSpecificItems/BepInExPlugin.cs b/RepairSpecificItems/BepInExPlugin.cs index e79b8aa..0772f28 100644 --- a/RepairSpecificItems/BepInExPlugin.cs +++ b/RepairSpecificItems/BepInExPlugin.cs @@ -278,10 +278,10 @@ static bool Prefix(InventoryGui __instance) return false; } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/RepeatActions/BepInExPlugin.cs b/RepeatActions/BepInExPlugin.cs index 5d8d250..b5509a1 100644 --- a/RepeatActions/BepInExPlugin.cs +++ b/RepeatActions/BepInExPlugin.cs @@ -135,10 +135,10 @@ static void Prefix(PlayerController __instance, ref bool ___m_attackWasPressed, } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/RequirementCheck/BepInExPlugin.cs b/RequirementCheck/BepInExPlugin.cs index ed16f85..fabe0d5 100644 --- a/RequirementCheck/BepInExPlugin.cs +++ b/RequirementCheck/BepInExPlugin.cs @@ -385,10 +385,10 @@ private static bool CheckKeyReq(string keyList) return true; } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/ServerRewards/Patches.cs b/ServerRewards/Patches.cs index 45f2595..7cdbfc2 100644 --- a/ServerRewards/Patches.cs +++ b/ServerRewards/Patches.cs @@ -81,10 +81,10 @@ static bool Prefix(ZNetView ___m_nview, ref string __result) } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/ShipSpeed/BepInExPlugin.cs b/ShipSpeed/BepInExPlugin.cs index 0ea5964..72d2574 100644 --- a/ShipSpeed/BepInExPlugin.cs +++ b/ShipSpeed/BepInExPlugin.cs @@ -185,10 +185,10 @@ static void Postfix(Ship __instance, ref float __result) __result = Math.Min(1, __result); } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/ShowContainerContents/BepInExPlugin.cs b/ShowContainerContents/BepInExPlugin.cs index 51c3626..955c37d 100644 --- a/ShowContainerContents/BepInExPlugin.cs +++ b/ShowContainerContents/BepInExPlugin.cs @@ -111,10 +111,10 @@ static void Postfix(Container __instance, ref string __result) } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/SimpleSort/BepInExPlugin.cs b/SimpleSort/BepInExPlugin.cs index b632c65..c056a7a 100644 --- a/SimpleSort/BepInExPlugin.cs +++ b/SimpleSort/BepInExPlugin.cs @@ -252,10 +252,10 @@ public static void SortToGrid(Inventory inventory, bool player) } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/SleepWithoutSpawn/BepInExPlugin.cs b/SleepWithoutSpawn/BepInExPlugin.cs index 08466aa..ac11bc3 100644 --- a/SleepWithoutSpawn/BepInExPlugin.cs +++ b/SleepWithoutSpawn/BepInExPlugin.cs @@ -6,7 +6,7 @@ namespace SleepWithoutSpawn { - [BepInPlugin("aedenthorn.SleepWithoutSpawn", "Sleep Without Spawn", "0.1.1")] + [BepInPlugin("aedenthorn.SleepWithoutSpawn", "Sleep Without Spawn", "0.2.0")] public class BepInExPlugin : BaseUnityPlugin { private static readonly bool isDebug = true; @@ -94,7 +94,7 @@ static bool Prefix(Bed __instance, Humanoid human, bool repeat, ref bool __resul __result = false; return false; } - human.AttachStart(__instance.m_spawnPoint, true, true, "attach_bed", new Vector3(0f, 0.5f, 0f)); + human.AttachStart(__instance.m_spawnPoint, __instance.gameObject, true, true, false, "attach_bed", new Vector3(0f, 0.5f, 0f)); __result = false; return false; } @@ -102,10 +102,10 @@ static bool Prefix(Bed __instance, Humanoid human, bool repeat, ref bool __resul - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/TerraformTweaks/BepInExPlugin.cs b/TerraformTweaks/BepInExPlugin.cs index 4e36ac5..353097a 100644 --- a/TerraformTweaks/BepInExPlugin.cs +++ b/TerraformTweaks/BepInExPlugin.cs @@ -93,10 +93,10 @@ private static void SetVariables(TerrainModifier __instance) } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/TerrainReset/BepInExPlugin.cs b/TerrainReset/BepInExPlugin.cs index 4dfbe04..688f499 100644 --- a/TerrainReset/BepInExPlugin.cs +++ b/TerrainReset/BepInExPlugin.cs @@ -218,10 +218,10 @@ static bool Prefix(TerrainOp.Settings ___m_settings) } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/TimeMod/BepInExPlugin.cs b/TimeMod/BepInExPlugin.cs index 48c4942..1a2d777 100644 --- a/TimeMod/BepInExPlugin.cs +++ b/TimeMod/BepInExPlugin.cs @@ -288,10 +288,10 @@ static void Prefix() } } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true; diff --git a/TorchMod/TorchMod.cs b/TorchMod/TorchMod.cs index f90239a..b8c5b79 100644 --- a/TorchMod/TorchMod.cs +++ b/TorchMod/TorchMod.cs @@ -390,10 +390,10 @@ static void Postfix(Fireplace __instance) } - [HarmonyPatch(typeof(Console), "InputText")] + [HarmonyPatch(typeof(Terminal), "InputText")] static class InputText_Patch { - static bool Prefix(Console __instance) + static bool Prefix(Terminal __instance) { if (!modEnabled.Value) return true;