diff --git a/.gitignore b/.gitignore index b9a7b16..d784522 100644 --- a/.gitignore +++ b/.gitignore @@ -339,4 +339,5 @@ ASALocalRun/ .localhistory/ # BeatPulse healthcheck temp database -healthchecksdb \ No newline at end of file +healthchecksdb +/_CompiledBinaries diff --git a/AICustomization/Properties/AssemblyInfo.cs b/AICustomization/Properties/AssemblyInfo.cs deleted file mode 100644 index 17922a7..0000000 --- a/AICustomization/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("AICustomization")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AICustomization")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("db0a4c79-b840-4431-954b-43c26a1cbfb4")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AedenthornUtils/Properties/AssemblyInfo.cs b/AedenthornUtils/Properties/AssemblyInfo.cs deleted file mode 100644 index 112b858..0000000 --- a/AedenthornUtils/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("AedenthornUtils")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AedenthornUtils")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("eaed7b73-e459-489f-ac7d-4dacc3197d9a")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AutoFeed/BepInExPlugin.cs b/AutoFeed/BepInExPlugin.cs index 1890f53..9fa52eb 100644 --- a/AutoFeed/BepInExPlugin.cs +++ b/AutoFeed/BepInExPlugin.cs @@ -2,14 +2,17 @@ using BepInEx.Configuration; using HarmonyLib; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Reflection; using System.Threading.Tasks; using UnityEngine; +using UnityEngine.TextCore.Text; +using UnityEngine.UIElements; namespace AutoFeed { - [BepInPlugin("aedenthorn.AutoFeed", "Auto Feed", "0.8.0")] + [BepInPlugin("aedenthorn.AutoFeed", "Auto Feed", "0.8.3")] public class BepInExPlugin: BaseUnityPlugin { public static ConfigEntry isDebug; @@ -18,6 +21,7 @@ public class BepInExPlugin: BaseUnityPlugin public static ConfigEntry moveProximity; public static ConfigEntry feedDisallowTypes; public static ConfigEntry animalDisallowTypes; + public static ConfigEntry containerNameStartsWith; public static ConfigEntry toggleKey; public static ConfigEntry toggleString; public static ConfigEntry isOn; @@ -27,9 +31,6 @@ public class BepInExPlugin: BaseUnityPlugin public static ConfigEntry nexusID; private static BepInExPlugin context; - private static float lastFeed; - private static int feedCount; - public static void Dbgl(string str = "", bool pref = true) { @@ -45,12 +46,13 @@ private void Awake() requireMove = Config.Bind("Config", "RequireMove", true, "Require animals to move to container to feed."); requireOnlyFood = Config.Bind("Config", "RequireOnlyFood", false, "Don't allow feeding from containers that have items that the animal will not eat as well."); moveProximity = Config.Bind("Config", "MoveProximity", 2f, "How close to move towards the container if RequireMove is true."); - + containerNameStartsWith = Config.Bind("Config", "ContainerNameFilter", "piece_chest, Container", "Only feed from containers which's name start like this, comma-separated."); + toggleKey = Config.Bind("General", "ToggleKey", "", "Key to toggle behaviour. Leave blank to disable the toggle key. Use https://docs.unity3d.com/Manual/ConventionalGameInput.html"); toggleString = Config.Bind("General", "ToggleString", "Auto Feed: {0}", "Text to show on toggle. {0} is replaced with true/false"); modEnabled = Config.Bind("General", "Enabled", true, "Enable this mod"); - isDebug = Config.Bind("General", "IsDebug", true, "Show debug logs"); - nexusID = Config.Bind("General", "NexusID", 985, "Nexus mod ID for updates"); + isDebug = Config.Bind("General", "IsDebug", false, "Show debug logs"); + nexusID = Config.Bind("General", "NexusID", 2787, "Nexus mod ID for updates"); isOn = Config.Bind("ZAuto", "IsOn", true, "Behaviour is currently on or not"); @@ -82,148 +84,119 @@ private static string GetPrefabName(string name) return result; } - public static List GetNearbyContainers(Vector3 center, float range, MonsterAI monsterAI) - { - try { - List containers = new List(); - - foreach (Collider collider in Physics.OverlapSphere(center, Mathf.Max(range, 0), LayerMask.GetMask(new string[] { "piece" }))) - { - Container container = collider.transform.parent?.parent?.gameObject?.GetComponent(); - if (container?.GetComponent()?.IsValid() != true) - continue; - if ((container.name.StartsWith("piece_chest") || container.name.StartsWith("Container")) && container.GetInventory() != null) - { - if (requireOnlyFood.Value) - { - foreach(ItemDrop.ItemData item in container.GetInventory().GetAllItems()) - { - if(!monsterAI.m_consumeItems.Exists(i => i.m_itemData.m_shared.m_name == item.m_shared.m_name)) - continue; - } - } - containers.Add(container); - } - } - containers.OrderBy(c => Vector3.Distance(c.transform.position, center)); - return containers; - } - catch - { - return new List(); - } - } - [HarmonyPatch(typeof(MonsterAI), "UpdateConsumeItem")] static class UpdateConsumeItem_Patch { static void Postfix(MonsterAI __instance, ZNetView ___m_nview, Character ___m_character, Tameable ___m_tamable, List ___m_consumeItems, float dt, bool __result) { - if (!modEnabled.Value || !isOn.Value || __result || !___m_character || !___m_nview || !___m_nview.IsOwner() || ___m_tamable == null || !___m_tamable.IsHungry() || ___m_consumeItems == null || ___m_consumeItems.Count == 0) - return; - string name = GetPrefabName(__instance.gameObject.name); - - if (animalDisallowTypes.Value.Split(',').Contains(name)) + if (!modEnabled.Value || !isOn.Value + || __result || !___m_character || !___m_nview || !___m_nview.IsOwner() + || ___m_tamable == null || !___m_character.IsTamed() || !___m_tamable.IsHungry() + || ___m_consumeItems == null || ___m_consumeItems.Count == 0 + || animalDisallowTypes.Value.Split(',').Contains(name)) { return; } - var nearbyContainers = GetNearbyContainers(___m_character.gameObject.transform.position, containerRange.Value, __instance); - - using (List.Enumerator enumerator = __instance.m_consumeItems.GetEnumerator()) + Vector3 instancePosition = __instance.gameObject.transform.position; + Traverse traverseAI = Traverse.Create(__instance); + // Types like "HorseSize" seem to not work when Deer is tamed + traverseAI.Field("m_pathAgentType").SetValue(Pathfinding.AgentType.Humanoid); + Container closestContainer = null; + Vector3 closestContainerPosition = new Vector3(0f, 0f, 0f); + float closestContainerDistance = containerRange.Value + 1; + foreach (Collider collider in Physics.OverlapSphere(instancePosition, Mathf.Max(containerRange.Value, 0), LayerMask.GetMask(new string[] { "piece" }))) { - while (enumerator.MoveNext()) + Container container = collider.transform.parent?.parent?.gameObject?.GetComponent(); + if (container?.GetComponent()?.IsValid() == true) { - foreach (Container c in nearbyContainers) + //Dbgl($"{__instance.gameObject.name} valid found"); + foreach (string containerNameStart in containerNameStartsWith.Value.Split(',')) { - if (Utils.DistanceXZ(c.transform.position, __instance.transform.position) < moveProximity.Value && Mathf.Abs(c.transform.position.y - __instance.transform.position.y) > moveProximity.Value) - continue; - - ItemDrop.ItemData item = c.GetInventory().GetItem(enumerator.Current.m_itemData.m_shared.m_name); - if (item != null) + if (container.name.StartsWith(containerNameStart) && container.GetInventory() != null) { - if (feedDisallowTypes.Value.Split(',').Contains(item.m_dropPrefab.name)) - { - continue; - } - - if (Time.time - lastFeed < 0.1) + //Dbgl($"{__instance.gameObject.name} trough"); + Vector3 containerPosition = container.transform.position; + float distance = Vector3.Distance(containerPosition, instancePosition); + //Dbgl($"{__instance.gameObject.name} agentType: {traverseAI.Field("m_pathAgentType")}"); + if (distance < moveProximity.Value + || traverseAI.Method("HavePath", new object[] { containerPosition }).GetValue()) { - feedCount++; - FeedAnimal(__instance, ___m_tamable, ___m_character, c, item, feedCount * 33); + //Dbgl($"{__instance.gameObject.name} path"); + bool foundInedibleItem = true; + bool foundEdibleItem = false; + foreach (ItemDrop.ItemData item in container.GetInventory().GetAllItems()) + { + if (__instance.m_consumeItems.Exists(i => i.m_itemData.m_shared.m_name == item.m_shared.m_name) + && !feedDisallowTypes.Value.Split(',').Contains(item.m_dropPrefab.name)) + { + foundEdibleItem = true; + if (!requireOnlyFood.Value) + { + //Dbgl($"{__instance.gameObject.name} food found"); + break; + } + } + else if (requireOnlyFood.Value) + { + //Dbgl($"{__instance.gameObject.name} inedible found"); + foundInedibleItem = false; + break; + } + } + + if (foundInedibleItem && foundEdibleItem && closestContainerDistance > distance) + { + closestContainer = container; + closestContainerDistance = distance; + closestContainerPosition = containerPosition; + } } - else - { - feedCount = 0; - lastFeed = Time.time; - FeedAnimal(__instance, ___m_tamable, ___m_character, c, item, 0); - } - return; } } } } - } - } - public static async void FeedAnimal(MonsterAI monsterAI, Tameable tamable, Character character, Container c, ItemDrop.ItemData item, int delay) - { - await Task.Delay(delay); - - if (tamable is null || monsterAI is null || !tamable.IsHungry()) - return; - if (requireOnlyFood.Value) - { - foreach (ItemDrop.ItemData temp in c.GetInventory().GetAllItems()) + if (closestContainer != null) { - if (!monsterAI.m_consumeItems.Exists(i => i.m_itemData.m_shared.m_name == temp.m_shared.m_name)) - return; - } - } - - - if (requireMove.Value) - { - try - { - //Dbgl($"{monsterAI.gameObject.name} {monsterAI.transform.position} trying to move to {c.transform.position} {Utils.DistanceXZ(monsterAI.transform.position, c.transform.position)}"); - - ZoneSystem.instance.GetGroundHeight(c.transform.position, out float ground); - - Vector3 groundTarget = new Vector3(c.transform.position.x, ground, c.transform.position.z); - - Traverse traverseAI = Traverse.Create(monsterAI); - traverseAI.Field("m_lastFindPathTime").SetValue(0); - - if (!traverseAI.Method("MoveTo", new object[] { 0.05f, groundTarget, moveProximity.Value, false }).GetValue()) - return; - - if (Mathf.Abs(c.transform.position.y - monsterAI.transform.position.y) > moveProximity.Value) - return; + Dbgl($"{__instance.gameObject.name} found container: {closestContainerPosition}"); + if (requireMove.Value) + { + Dbgl($"{__instance.gameObject.name} {instancePosition} trying to move to {closestContainerPosition} {Utils.DistanceXZ(instancePosition, closestContainerPosition)}"); - traverseAI.Method("LookAt", new object[] { c.transform.position }).GetValue(); + traverseAI.Field("m_lastFindPathTime").SetValue(0); + if (!traverseAI.Method("MoveTo", new object[] { 0.05f, closestContainerPosition, moveProximity.Value, false }).GetValue()) + return; - if (!traverseAI.Method("IsLookingAt", new object[] { c.transform.position, 90f }).GetValue()) - return; + traverseAI.Method("LookAt", new object[] { closestContainerPosition }).GetValue(); + if (!traverseAI.Method("IsLookingAt", new object[] { closestContainerPosition, 20f, false }).GetValue()) + return; + } + using (List.Enumerator enumerator = __instance.m_consumeItems.GetEnumerator()) + { + while (enumerator.MoveNext()) + { + ItemDrop.ItemData item = closestContainer.GetInventory().GetItem(enumerator.Current.m_itemData.m_shared.m_name); + if (item != null && !feedDisallowTypes.Value.Split(',').Contains(item.m_dropPrefab.name)) + { + Dbgl($"{__instance.gameObject.name} {instancePosition} consuming {item.m_dropPrefab.name} at {closestContainerPosition}, distance {Utils.DistanceXZ(instancePosition, closestContainerPosition)}"); + ConsumeItem(item, __instance, ___m_character); - traverseAI.Field("m_aiStatus").SetValue("Consume item"); + closestContainer.GetInventory().RemoveItem(item.m_shared.m_name, 1); + typeof(Inventory).GetMethod("Changed", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(closestContainer.GetInventory(), new object[] { }); + typeof(Container).GetMethod("Save", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(closestContainer, new object[] { }); + return; + } + } + } } - catch + else { - + Dbgl($"{__instance.gameObject.name} could not find container"); } - - //Dbgl($"{monsterAI.gameObject.name} looking at"); } - - Dbgl($"{monsterAI.gameObject.name} {monsterAI.transform.position} consuming {item.m_dropPrefab.name} at {c.transform.position}, distance {Utils.DistanceXZ(monsterAI.transform.position, c.transform.position)}"); - ConsumeItem(item, monsterAI, character); - - c.GetInventory().RemoveItem(item.m_shared.m_name, 1); - typeof(Inventory).GetMethod("Changed", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(c.GetInventory(), new object[] { }); - typeof(Container).GetMethod("Save", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(c, new object[] { }); } private static void ConsumeItem(ItemDrop.ItemData item, MonsterAI monsterAI, Character character) @@ -247,8 +220,8 @@ static bool Prefix(Terminal __instance) context.Config.Reload(); context.Config.Save(); - __instance.AddString(text); - __instance.AddString($"{context.Info.Metadata.Name} config reloaded"); + Traverse.Create(__instance).Method("AddString", new object[] { text }).GetValue(); + Traverse.Create(__instance).Method("AddString", new object[] { $"{context.Info.Metadata.Name} config reloaded" }).GetValue(); return false; } return true; diff --git a/AutoFeed/Properties/AssemblyInfo.cs b/AutoFeed/Properties/AssemblyInfo.cs deleted file mode 100644 index 0b1698c..0000000 --- a/AutoFeed/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("AutoFeed")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AutoFeed")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("4a4941b7-3227-4d66-ae89-d9ffd36996c4")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AutoFuel/BepInExPlugin.cs b/AutoFuel/BepInExPlugin.cs index f385797..a8a6189 100644 --- a/AutoFuel/BepInExPlugin.cs +++ b/AutoFuel/BepInExPlugin.cs @@ -200,7 +200,7 @@ public static async void RefuelTorch(Fireplace fireplace, ZNetView znview, int d Destroy(item.gameObject); else ZNetScene.instance.Destroy(item.gameObject); - znview.InvokeRPC("AddFuel", new object[] { }); + znview.InvokeRPC("RPC_AddFuel", new object[] { }); if (distributedFilling.Value) return; break; @@ -208,7 +208,7 @@ public static async void RefuelTorch(Fireplace fireplace, ZNetView znview, int d } item.m_itemData.m_stack--; - znview.InvokeRPC("AddFuel", new object[] { }); + znview.InvokeRPC("RPC_AddFuel", new object[] { }); Traverse.Create(item).Method("Save").GetValue(); if (distributedFilling.Value) return; @@ -236,7 +236,7 @@ public static async void RefuelTorch(Fireplace fireplace, ZNetView znview, int d Dbgl($"container at {c.transform.position} has {fuelItem.m_stack} {fuelItem.m_dropPrefab.name}, taking one"); - znview.InvokeRPC("AddFuel", new object[] { }); + znview.InvokeRPC("RPC_AddFuel", new object[] { }); c.GetInventory().RemoveItem(fireplace.m_fuelItem.m_itemData.m_shared.m_name, 1); typeof(Container).GetMethod("Save", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(c, new object[] { }); @@ -351,14 +351,14 @@ public static async void RefuelSmelter(Smelter __instance, ZNetView ___m_nview, Destroy(item.gameObject); else ZNetScene.instance.Destroy(item.gameObject); - ___m_nview.InvokeRPC("AddOre", new object[] { name }); + ___m_nview.InvokeRPC("RPC_AddOre", new object[] { name }); if (distributedFilling.Value) ored = true; break; } item.m_itemData.m_stack--; - ___m_nview.InvokeRPC("AddOre", new object[] { name }); + ___m_nview.InvokeRPC("RPC_AddOre", new object[] { name }); Traverse.Create(item).Method("Save").GetValue(); if (distributedFilling.Value) ored = true; @@ -388,7 +388,7 @@ public static async void RefuelSmelter(Smelter __instance, ZNetView ___m_nview, Destroy(item.gameObject); else ZNetScene.instance.Destroy(item.gameObject); - ___m_nview.InvokeRPC("AddFuel", new object[] { }); + ___m_nview.InvokeRPC("RPC_AddFuel", new object[] { }); if (distributedFilling.Value) fueled = true; break; @@ -396,7 +396,7 @@ public static async void RefuelSmelter(Smelter __instance, ZNetView ___m_nview, } item.m_itemData.m_stack--; - ___m_nview.InvokeRPC("AddFuel", new object[] { }); + ___m_nview.InvokeRPC("RPC_AddFuel", new object[] { }); Traverse.Create(item).Method("Save").GetValue(); if (distributedFilling.Value) { @@ -427,7 +427,7 @@ public static async void RefuelSmelter(Smelter __instance, ZNetView ___m_nview, Dbgl($"container at {c.transform.position} has {oreItem.m_stack} {oreItem.m_dropPrefab.name}, taking one"); - ___m_nview.InvokeRPC("AddOre", new object[] { oreItem.m_dropPrefab?.name }); + ___m_nview.InvokeRPC("RPC_AddOre", new object[] { oreItem.m_dropPrefab?.name }); c.GetInventory().RemoveItem(itemConversion.m_from.m_itemData.m_shared.m_name, 1); typeof(Container).GetMethod("Save", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(c, new object[] { }); typeof(Inventory).GetMethod("Changed", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(c.GetInventory(), new object[] { }); @@ -461,7 +461,7 @@ public static async void RefuelSmelter(Smelter __instance, ZNetView ___m_nview, Dbgl($"container at {c.transform.position} has {fuelItem.m_stack} {fuelItem.m_dropPrefab.name}, taking one"); - ___m_nview.InvokeRPC("AddFuel", new object[] { }); + ___m_nview.InvokeRPC("RPC_AddFuel", new object[] { }); c.GetInventory().RemoveItem(__instance.m_fuelItem.m_itemData.m_shared.m_name, 1); typeof(Container).GetMethod("Save", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(c, new object[] { }); diff --git a/BackpackRedux/.gitignore b/BackpackRedux/.gitignore deleted file mode 100644 index 931849a..0000000 --- a/BackpackRedux/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.dll -*.suo -*.cache diff --git a/BuildPieceReplace/Properties/AssemblyInfo.cs b/BuildPieceReplace/Properties/AssemblyInfo.cs deleted file mode 100644 index fa00ed2..0000000 --- a/BuildPieceReplace/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("BuildPieceReplace")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("BuildPieceReplace")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("da3d9481-22d5-427a-9ecb-f60644fcab78")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/BuildingRepairRequiresMats/Properties/AssemblyInfo.cs b/BuildingRepairRequiresMats/Properties/AssemblyInfo.cs deleted file mode 100644 index 93d752f..0000000 --- a/BuildingRepairRequiresMats/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("BuildingRepairRequiresMats")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("BuildingRepairRequiresMats")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("4c30daee-fafd-4ca0-93b2-316f772d06ba")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/CartSupport/BepInExPlugin.cs b/CartSupport/BepInExPlugin.cs index 826de2a..4ba0ad6 100644 --- a/CartSupport/BepInExPlugin.cs +++ b/CartSupport/BepInExPlugin.cs @@ -3,6 +3,7 @@ using HarmonyLib; using System.Collections.Generic; using UnityEngine; +using UnityEngine.SocialPlatforms; namespace CartSupport { @@ -61,12 +62,19 @@ static void Prefix(Vagon __instance, ZNetView ___m_nview, ref float mass) float before = mass; - List players = new List(); - Player.GetPlayersInRange(__instance.gameObject.transform.position, playerRange.Value, players); - if(players.Count > (includePuller.Value ? 0 : 1)) - mass = Mathf.Max(0, mass - mass * playerMassReduction.Value * Mathf.Min(maxPlayers.Value, players.Count - (includePuller.Value ? 0 : 1))); + List s_players = Player.GetAllPlayers(); + int playerCount = 0; + foreach (Player s_player in s_players) + { + if (Vector3.Distance(s_player.transform.position, __instance.gameObject.transform.position) < playerRange.Value) + { + playerCount++; + } + } + if(playerCount > (includePuller.Value ? 0 : 1)) + mass = Mathf.Max(0, mass - mass * playerMassReduction.Value * Mathf.Min(maxPlayers.Value, playerCount - (includePuller.Value ? 0 : 1))); - //Dbgl($"mass players {players.Count} distance {Vector3.Distance(__instance.gameObject.transform.position, Player.m_localPlayer.transform.position)} before {before} after {mass} is owner {___m_nview.IsOwner()}"); + Dbgl($"mass players {playerCount} distance {Vector3.Distance(__instance.gameObject.transform.position, Player.m_localPlayer.transform.position)} before {before} after {mass} is owner {___m_nview.IsOwner()}"); } } diff --git a/CartSupport/Properties/AssemblyInfo.cs b/CartSupport/Properties/AssemblyInfo.cs deleted file mode 100644 index 4e1eeec..0000000 --- a/CartSupport/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("CartSupport")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("CartSupport")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("2a3a0c62-40e5-4d77-ae6e-6466d8ad7648")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/CartographyTableMapRestrict/BepInExPlugin.cs b/CartographyTableMapRestrict/BepInExPlugin.cs index 22d1b75..d86f8a4 100644 --- a/CartographyTableMapRestrict/BepInExPlugin.cs +++ b/CartographyTableMapRestrict/BepInExPlugin.cs @@ -1,6 +1,7 @@ using BepInEx; using BepInEx.Configuration; using HarmonyLib; +using System; using System.Reflection; using UnityEngine; @@ -11,10 +12,8 @@ public class BepInExPlugin : BaseUnityPlugin { private static readonly bool isDebug = true; - public static ConfigEntry hotKey; public static ConfigEntry modEnabled; - public static ConfigEntry attachDistance; - public static ConfigEntry allowOutOfPlaceAttach; + public static ConfigEntry suppressMessage; public static ConfigEntry nexusID; private static BepInExPlugin context; @@ -29,6 +28,7 @@ private void Awake() context = this; modEnabled = Config.Bind("General", "Enabled", true, "Enable this mod"); + suppressMessage = Config.Bind("General", "SupressMessage", true, "Supresses message on read"); nexusID = Config.Bind("General", "NexusID", 1739, "Nexus mod ID for updates"); Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), null); @@ -45,9 +45,14 @@ static void Postfix(Minimap __instance, Minimap.MapMode ___m_mode) __instance.SetMapMode(Minimap.MapMode.None); } } - [HarmonyPatch(typeof(MapTable), "OnRead")] + [HarmonyPatch(typeof(MapTable), "OnRead", new Type[] { typeof(Switch), typeof(Humanoid), typeof(ItemDrop.ItemData), typeof(bool) })] static class MapTable_OnRead_Patch { + static void Prefix(MapTable __instance, ref bool showMessage) + { + showMessage = showMessage && !suppressMessage.Value; + } + static void Postfix(MapTable __instance, ItemDrop.ItemData item) { if (!modEnabled.Value || Player.m_localPlayer == null || item != null) diff --git a/CombatMusic/Properties/AssemblyInfo.cs b/CombatMusic/Properties/AssemblyInfo.cs deleted file mode 100644 index 5aae65e..0000000 --- a/CombatMusic/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("CombatMusic")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("CombatMusic")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("42c550dd-ab81-427e-94fc-7f057941d6aa")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ControllerButtonSwitch/Properties/AssemblyInfo.cs b/ControllerButtonSwitch/Properties/AssemblyInfo.cs deleted file mode 100644 index c4e5c27..0000000 --- a/ControllerButtonSwitch/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ControllerButtonSwitch")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ControllerButtonSwitch")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("a775ed6f-5fd3-4315-bd97-537bf9999300")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/CustomArmorStats/BepInExPlugin.cs b/CustomArmorStats/BepInExPlugin.cs index 0c212bd..369124d 100644 --- a/CustomArmorStats/BepInExPlugin.cs +++ b/CustomArmorStats/BepInExPlugin.cs @@ -114,31 +114,6 @@ static void Postfix(ref float __result) } } - [HarmonyPatch(typeof(Player), "GetJogSpeedFactor")] - static class GetJogSpeedFactor_Patch - { - static bool Prefix(ref float __result, float ___m_equipmentMovementModifier) - { - if (!modEnabled.Value) - return true; - __result = 1 + ___m_equipmentMovementModifier * globalArmorMovementModMult.Value; - return false; - } - } - - [HarmonyPatch(typeof(Player), "GetRunSpeedFactor")] - static class GetRunSpeedFactor_Patch - { - static bool Prefix(Skills ___m_skills, float ___m_equipmentMovementModifier, ref float __result) - { - if (!modEnabled.Value) - return true; - float skillFactor = ___m_skills.GetSkillFactor(Skills.SkillType.Run); - __result = (1f + skillFactor * 0.25f) * (1f + ___m_equipmentMovementModifier * 1.5f * globalArmorMovementModMult.Value); - return false; - } - } - [HarmonyPatch(typeof(SEMan), "AddStatusEffect", new Type[] { typeof(StatusEffect), typeof(bool), typeof(int), typeof(float) })] static class SEMan_AddStatusEffect_Patch { @@ -238,10 +213,9 @@ static void Postfix(float dt, Player __instance, ItemDrop.ItemData ___m_chestIte { if (!modEnabled.Value) return; - - if (___m_seman.HaveStatusEffect("Wet")) + var hash = "Wet".GetStableHashCode(); + if (___m_seman.HaveStatusEffect(hash)) { - var hash = "Wet".GetStableHashCode(); HitData.DamageModifier water = GetNewDamageTypeMod(NewDamageTypes.Water, ___m_chestItem, ___m_legItem, ___m_helmetItem, ___m_shoulderItem); var wet = ___m_seman.GetStatusEffect(hash); var t = Traverse.Create(wet); diff --git a/CustomAudio/BepInExPlugin.cs b/CustomAudio/BepInExPlugin.cs index a7421ad..7df7a61 100644 --- a/CustomAudio/BepInExPlugin.cs +++ b/CustomAudio/BepInExPlugin.cs @@ -17,8 +17,10 @@ public class BepInExPlugin: BaseUnityPlugin { public static ConfigEntry isDebug; + public static ConfigEntry modEnabled; public static ConfigEntry dumpInfo; + public static ConfigEntry overwriteVol; public static ConfigEntry sfxVol; public static ConfigEntry musicVol; public static ConfigEntry ambientVol; @@ -45,9 +47,10 @@ private void Awake() modEnabled = Config.Bind("General", "Enabled", true, "Enable this mod"); isDebug = Config.Bind("General", "IsDebug", true, "Show debug log messages in the console"); dumpInfo = Config.Bind("General", "DumpInfo", true, "Dump audio info to the console"); + overwriteVol = Config.Bind("General", "OverwriteVol", true, "Overwrite game volume settings"); musicVol = Config.Bind("General", "MusicVol", 0.6f, "Music volume, 0.0 - 1.0"); //sfxVol = Config.Bind("General", "SfxVol", 1f, "SFX volume"); - ambientVol = Config.Bind("General", "AmbientVol", 0.3f, "Ambient volume"); + ambientVol = Config.Bind("General", "AmbientVol", 0.3f, "Ambient volume, 0.0 - 1.0"); nexusID = Config.Bind("General", "NexusID", 90, "Nexus mod ID for updates"); if (!modEnabled.Value) @@ -342,6 +345,9 @@ static void Postfix(AudioMan __instance, List ___m_rando dump.Add($"\tAmbient day tracks: (use {___m_randomAmbients[i].m_name}_day)"); for (int j = 0; j < ___m_randomAmbients[i].m_randomAmbientClipsDay.Count; j++) { + if (__instance.m_randomAmbients[i].m_randomAmbientClipsDay[j] == null) + continue; + dump.Add($"\t\ttrack name: {___m_randomAmbients[i].m_randomAmbientClipsDay[j].name}"); //Dbgl($"checking ambient day: { ___m_randomAmbients[i].m_name}, clip: {___m_randomAmbients[i].m_randomAmbientClipsDay[j].name}"); @@ -354,6 +360,9 @@ static void Postfix(AudioMan __instance, List ___m_rando dump.Add($"\tAmbient night tracks: (use {___m_randomAmbients[i].m_name}_night)"); for (int j = 0; j < ___m_randomAmbients[i].m_randomAmbientClipsNight.Count; j++) { + if (__instance.m_randomAmbients[i].m_randomAmbientClipsNight[j] == null) + continue; + dump.Add($"\t\ttrack name: {___m_randomAmbients[i].m_randomAmbientClipsNight[j].name}"); //Dbgl($"checking ambient night: { ___m_randomAmbients[i].m_name}, clip: {___m_randomAmbients[i].m_randomAmbientClipsNight[j].name}"); @@ -402,9 +411,10 @@ static void Prefix(ref MusicMan.NamedMusic ___m_currentMusic, ref MusicMan.Named if (!modEnabled.Value) return; - if (___m_queuedMusic != null) + if (___m_queuedMusic != null && overwriteVol.Value) { ___m_queuedMusic.m_volume = musicVol.Value; + Dbgl($"Set MusVol {musicVol.Value}"); } @@ -445,11 +455,12 @@ static class QueueAmbientLoop_Patch { static void Prefix(ref float ___m_queuedAmbientVol, ref float ___m_ambientVol, ref float vol) { - if (!modEnabled.Value) + if (!modEnabled.Value || !overwriteVol.Value) return; vol = ambientVol.Value; ___m_ambientVol = ambientVol.Value; ___m_queuedAmbientVol = ambientVol.Value; + Dbgl($"Set AmbVol {ambientVol.Value}"); } } diff --git a/CustomContainerSizes/BepInExPlugin.cs b/CustomContainerSizes/BepInExPlugin.cs index c289726..126c33c 100644 --- a/CustomContainerSizes/BepInExPlugin.cs +++ b/CustomContainerSizes/BepInExPlugin.cs @@ -18,6 +18,8 @@ public class BepInExPlugin : BaseUnityPlugin private static ConfigEntry chestHeight; private static ConfigEntry vikingShipChestWidth; private static ConfigEntry vikingShipChestHeight; + private static ConfigEntry drakkarShipChestWidth; + private static ConfigEntry drakkarShipChestHeight; private static ConfigEntry privateChestWidth; private static ConfigEntry privateChestHeight; private static ConfigEntry reinforcedChestWidth; @@ -46,6 +48,8 @@ private void Awake() karveChestHeight = Config.Bind("Sizes", "KarveChestHeight", 2, "Number of items tall for karve chest containers"); vikingShipChestWidth = Config.Bind("Sizes", "VikingShipChestWidth", 6, "Number of items wide for longship chest containers (max. 8)"); vikingShipChestHeight = Config.Bind("Sizes", "VikingShipChestHeight", 3, "Number of items tall for longship chest containers"); + drakkarShipChestWidth = Config.Bind("Sizes", "DrakkarShipChestWidth", 8, "Number of items wide for Drakkar chest containers (max. 8)"); + drakkarShipChestHeight = Config.Bind("Sizes", "DrakkarShipChestHeight", 4, "Number of items tall for Drakkar chest containers"); privateChestWidth = Config.Bind("Sizes", "PrivateChestWidth", 3, "Number of items wide for private chest containers (max. 8)"); privateChestHeight = Config.Bind("Sizes", "PrivateChestHeight", 2, "Number of items tall for private chest containers"); reinforcedChestWidth = Config.Bind("Sizes", "ReinforcedChestWidth", 6, "Number of items wide for reinforced chest containers (max. 8)"); @@ -60,6 +64,7 @@ private void Awake() chestWidth.Value = Math.Min(chestWidth.Value, 8); karveChestWidth.Value = Math.Min(karveChestWidth.Value, 8); vikingShipChestWidth.Value = Math.Min(vikingShipChestWidth.Value, 8); + drakkarShipChestWidth.Value = Math.Min(drakkarShipChestWidth.Value, 8); privateChestWidth.Value = Math.Min(privateChestWidth.Value, 8); reinforcedChestWidth.Value = Math.Min(reinforcedChestWidth.Value, 8); wagonWidth.Value = Math.Min(wagonWidth.Value, 8); @@ -91,6 +96,13 @@ static void Postfix(Container __instance, Inventory ___m_inventory) typeof(Inventory).GetField("m_width", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(___m_inventory, karveChestWidth.Value); typeof(Inventory).GetField("m_height", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(___m_inventory, karveChestHeight.Value); } + else if (ship.name.ToLower().Contains("ashland")) + { + Dbgl($"setting Drakkar chest size to {drakkarShipChestWidth.Value},{drakkarShipChestHeight.Value}"); + + typeof(Inventory).GetField("m_width", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(___m_inventory, drakkarShipChestWidth.Value); + typeof(Inventory).GetField("m_height", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(___m_inventory, drakkarShipChestHeight.Value); + } else if (ship.name.ToLower().Contains("vikingship")) { Dbgl($"setting VikingShip chest size to {vikingShipChestWidth.Value},{vikingShipChestHeight.Value}"); @@ -98,6 +110,7 @@ static void Postfix(Container __instance, Inventory ___m_inventory) typeof(Inventory).GetField("m_width", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(___m_inventory, vikingShipChestWidth.Value); typeof(Inventory).GetField("m_height", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(___m_inventory, vikingShipChestHeight.Value); } + } else if (__instance.m_wagon) { diff --git a/CustomDreamTexts/Properties/AssemblyInfo.cs b/CustomDreamTexts/Properties/AssemblyInfo.cs deleted file mode 100644 index b8392fa..0000000 --- a/CustomDreamTexts/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("CustomDreamTexts")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("CustomDreamTexts")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("8a279f25-fda7-4d4b-8d6f-bc6d1ad3b7ae")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/CustomTextures/BepInExPlugin.cs b/CustomTextures/BepInExPlugin.cs index 760b76c..4248ec2 100644 --- a/CustomTextures/BepInExPlugin.cs +++ b/CustomTextures/BepInExPlugin.cs @@ -11,7 +11,7 @@ namespace CustomTextures { - [BepInPlugin("aedenthorn.CustomTextures", "Custom Textures", "3.3.1")] + [BepInPlugin("aedenthorn.CustomTextures", "Custom Textures", "3.3.2")] public partial class BepInExPlugin: BaseUnityPlugin { public static ConfigEntry modEnabled; @@ -47,7 +47,7 @@ private void Awake() replaceLocationTextures = Config.Bind("General", "ReplaceLocationTextures", true, "Replace textures for special locations (can take a long time)"); reloadLocationTextures = Config.Bind("General", "ReloadLocationTextures", false, "Reload textures for special locations on manual reload (can take a long time)"); dumpSceneTextures = Config.Bind("General", "DumpSceneTextures", false, "Dump scene textures to BepInEx/plugins/CustomTextures/scene_dump.txt"); - nexusID = Config.Bind("General", "NexusID", 48, "Nexus mod ID for updates"); + nexusID = Config.Bind("General", "NexusID", 2796, "Nexus mod ID for updates"); if (!modEnabled.Value) return; diff --git a/CustomTextures/TextureReplacement.cs b/CustomTextures/TextureReplacement.cs index d7b8379..5680e61 100644 --- a/CustomTextures/TextureReplacement.cs +++ b/CustomTextures/TextureReplacement.cs @@ -72,7 +72,7 @@ private static void ReplaceZNetSceneTextures() var namedPrefabs = ((Dictionary)AccessTools.Field(typeof(ZNetScene), "m_namedPrefabs").GetValue(ZNetScene.instance)).Values; foreach (GameObject go in namedPrefabs) { - if (!gos.Contains(go)) + if (go != null && !gos.Contains(go)) gos.Add(go); } @@ -80,8 +80,10 @@ private static void ReplaceZNetSceneTextures() foreach (GameObject gameObject in gos) { - if (gameObject.name == "_NetSceneRoot") + if (gameObject == null || gameObject.name == "_NetSceneRoot") + { continue; + } ReplaceOneGameObjectTextures(gameObject, gameObject.name, "object"); } diff --git a/CustomTextures/TextureScale.cs b/CustomTextures/TextureScale.cs index 0793146..a8d9f97 100644 --- a/CustomTextures/TextureScale.cs +++ b/CustomTextures/TextureScale.cs @@ -98,7 +98,7 @@ private static void ThreadedScale(Texture2D tex, int newWidth, int newHeight, bo } } - tex.Resize(newWidth, newHeight); + tex.Reinitialize(newWidth, newHeight); tex.SetPixels(newColors); tex.Apply(); diff --git a/CustomToolbarHotkeys/BepInExPlugin.cs b/CustomToolbarHotkeys/BepInExPlugin.cs index e5abdf0..03c2d14 100644 --- a/CustomToolbarHotkeys/BepInExPlugin.cs +++ b/CustomToolbarHotkeys/BepInExPlugin.cs @@ -11,7 +11,7 @@ namespace CustomToolbarHotkeys [BepInPlugin("aedenthorn.CustomToolbarHotkeys", "Custom Toolbar Hotkeys", "0.4.0")] public class BepInExPlugin : BaseUnityPlugin { - private static readonly bool isDebug = true; + private static readonly bool isDebug = false; private static BepInExPlugin context; private static bool usingHotkey = false; @@ -44,7 +44,7 @@ private void Awake() nexusID = Config.Bind("General", "NexusID", 683, "Nexus mod ID for updates"); hideNumbers = Config.Bind("General", "HideNumbers", false, "Hide hotkey numbers on toolbar"); - showHotkeys = Config.Bind("General", "ShowHotkeys", false, "Show new hotkey strings on toolbar. Must set HideNumbers to true."); + showHotkeys = Config.Bind("General", "ShowHotkeys", false, "Show new hotkey strings on toolbar (takes priority over numbers or hidden)"); hotKey1 = Config.Bind("Hotkeys", "HotKey1", "1", "Hotkey 1 - Use https://docs.unity3d.com/Manual/ConventionalGameInput.html"); hotKey2 = Config.Bind("Hotkeys", "HotKey2", "2", "Hotkey 2 - Use https://docs.unity3d.com/Manual/ConventionalGameInput.html"); hotKey3 = Config.Bind("Hotkeys", "HotKey3", "3", "Hotkey 3 - Use https://docs.unity3d.com/Manual/ConventionalGameInput.html"); @@ -77,13 +77,42 @@ static class HotkeyBar_UpdateIcons_Patch { static void Postfix(HotkeyBar __instance) { - if (!modEnabled.Value || !hideNumbers.Value || __instance.name != "HotKeyBar") + if (!modEnabled.Value || __instance.name != "HotKeyBar") return; + int count = __instance.transform.childCount; - for(int i = 0; i < count; i++) + if (showHotkeys.Value) + { + Dbgl("Switching to Hotkeys"); + for (int i = 0; i < count; i++) + { + if (__instance.transform.GetChild(i).Find("binding")) + { + __instance.transform.GetChild(i).Find("binding").GetComponent().text = hotkeys[i].Value; + } + } + } + else if (hideNumbers.Value) { - if (__instance.transform.GetChild(i).Find("binding")) { } - __instance.transform.GetChild(i).Find("binding").GetComponent().text = showHotkeys.Value ? hotkeys[i].Value : ""; + Dbgl("Switching to Nothing"); + for (int i = 0; i < count; i++) + { + if (__instance.transform.GetChild(i).Find("binding")) + { + __instance.transform.GetChild(i).Find("binding").GetComponent().text = ""; + } + } + } + else + { + Dbgl("Switching to Numbers"); + for (int i = 0; i < count; i++) + { + if (__instance.transform.GetChild(i).Find("binding")) + { + __instance.transform.GetChild(i).Find("binding").GetComponent().text = (i+1).ToString(); + } + } } } } @@ -93,7 +122,7 @@ static class Player_Update_Patch { static bool Prefix(Player __instance) { - if (!modEnabled.Value || AedenthornUtils.IgnoreKeyPresses()) + if (!modEnabled.Value || AedenthornUtils.IgnoreKeyPresses(true)) return true; int which; @@ -141,19 +170,40 @@ static class InventoryGui_Update_Patch { static void Postfix(InventoryGrid ___m_playerGrid, Animator ___m_animator) { - if (!modEnabled.Value || !hideNumbers.Value || !___m_animator.GetBool("visible")) + if (!modEnabled.Value || ___m_playerGrid.m_gridRoot.transform.childCount < 8 || !___m_animator.GetBool("visible")) return; - for(int i = 0; i < 8; i++) + if (showHotkeys.Value) { - try + Dbgl("Switching to Hotkeys"); + for (int i = 0; i < 8; i++) { if (___m_playerGrid.m_gridRoot.transform.GetChild(i)?.Find("binding")) - ___m_playerGrid.m_gridRoot.transform.GetChild(i).Find("binding").GetComponent().text = showHotkeys.Value ? hotkeys[i].Value : ""; + { + ___m_playerGrid.m_gridRoot.transform.GetChild(i).Find("binding").GetComponent().text = hotkeys[i].Value; + } } - catch + } + else if (hideNumbers.Value) + { + Dbgl("Switching to Nothing"); + for (int i = 0; i < 8; i++) { - return; + if (___m_playerGrid.m_gridRoot.transform.GetChild(i)?.Find("binding")) + { + ___m_playerGrid.m_gridRoot.transform.GetChild(i).Find("binding").GetComponent().text = ""; + } + } + } + else + { + Dbgl("Switching to Numbers"); + for (int i = 0; i < 8; i++) + { + if (___m_playerGrid.m_gridRoot.transform.GetChild(i)?.Find("binding")) + { + ___m_playerGrid.m_gridRoot.transform.GetChild(i).Find("binding").GetComponent().text = (i + 1).ToString(); + } } } } diff --git a/CustomWeapons/Properties/AssemblyInfo.cs b/CustomWeapons/Properties/AssemblyInfo.cs deleted file mode 100644 index 626e5b7..0000000 --- a/CustomWeapons/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("CustomWeapons")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("CustomWeapons")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("0efd1fbe-b627-4680-9a66-b95aa347eb48")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/DamageMod/Properties/AssemblyInfo.cs b/DamageMod/Properties/AssemblyInfo.cs deleted file mode 100644 index 039013b..0000000 --- a/DamageMod/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("DamageMod")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("DamageMod")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("d08034eb-046a-4811-a84b-55a4db3386d4")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/EquipMultipleUtilityItems/Properties/AssemblyInfo.cs b/EquipMultipleUtilityItems/Properties/AssemblyInfo.cs deleted file mode 100644 index c536226..0000000 --- a/EquipMultipleUtilityItems/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("EquipMultipleUtilityItems")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("EquipMultipleUtilityItems")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("83ca0d39-50f6-450b-a596-5d3535675fd7")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ExtendedPlayerInventory/Properties/AssemblyInfo.cs b/ExtendedPlayerInventory/Properties/AssemblyInfo.cs deleted file mode 100644 index 1f2abf5..0000000 --- a/ExtendedPlayerInventory/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ExtendedPlayerInventory")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ExtendedPlayerInventory")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("ab1e5ca2-0722-4a12-99b5-9ea15c00b532")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/HaldorFetchQuests/Properties/AssemblyInfo.cs b/HaldorFetchQuests/Properties/AssemblyInfo.cs deleted file mode 100644 index e8aa0fe..0000000 --- a/HaldorFetchQuests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("HaldorFetchQuests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("HaldorFetchQuests")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("6c33bccd-3bc1-4c47-9baf-59ba4cc1a8a9")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/HereFishy/BepInExPlugin.cs b/HereFishy/BepInExPlugin.cs index a9b702d..f48686c 100644 --- a/HereFishy/BepInExPlugin.cs +++ b/HereFishy/BepInExPlugin.cs @@ -88,23 +88,10 @@ private void Update() } float closest = maxFishyDistance.Value; Fish closestFish = null; - foreach (Collider collider in Physics.OverlapSphere(Player.m_localPlayer.transform.position, maxFishyDistance.Value)) + foreach (Fish fish in Fish.Instances) { - int which = 0; - Fish fish = collider.transform.parent?.gameObject?.GetComponent(); - if(fish is null) + if (Vector3.Distance(Player.m_localPlayer.transform.position, fish.transform.position) < closest) { - which = 1; - fish = collider.GetComponent(); - } - if(fish is null) - { - which = 2; - fish = collider.transform.parent?.parent?.gameObject?.GetComponent(); - } - if (fish?.GetComponent()?.IsValid() == true) - { - float distance = Vector3.Distance(Player.m_localPlayer.transform.position, fish.gameObject.transform.position); if (distance < closest && !hereFishyFishies.Contains(fish.gameObject)) { diff --git a/HuginQuestFramework/Properties/AssemblyInfo.cs b/HuginQuestFramework/Properties/AssemblyInfo.cs deleted file mode 100644 index d99b67c..0000000 --- a/HuginQuestFramework/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("HuginQuestFramework")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("HuginQuestFramework")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("0841db40-1807-4cbf-9f54-9548d36c581d")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/InventoryHUD/Properties/AssemblyInfo.cs b/InventoryHUD/Properties/AssemblyInfo.cs deleted file mode 100644 index 1fc4704..0000000 --- a/InventoryHUD/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("InventoryHUD")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("InventoryHUD")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("2a3431ae-002d-4b07-b681-21942166995c")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/ItemStorageComponent/Properties/AssemblyInfo.cs b/ItemStorageComponent/Properties/AssemblyInfo.cs deleted file mode 100644 index b9551b6..0000000 --- a/ItemStorageComponent/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("ItemStorageComponent")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("ItemStorageComponent")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("0ed8cd74-bb01-4f5b-ab14-7d88515a0882")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/MapPinExport/BepInExPlugin.cs b/MapPinExport/BepInExPlugin.cs index 748cfe3..a126b6e 100644 --- a/MapPinExport/BepInExPlugin.cs +++ b/MapPinExport/BepInExPlugin.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Reflection; using UnityEngine; +using UnityEngine.UI; namespace MapPinExport { @@ -29,7 +30,7 @@ private void Awake() context = this; modEnabled = Config.Bind("General", "Enabled", true, "Enable this mod"); - isDebug = Config.Bind("General", "IsDebug", true, "Enable debug logs"); + isDebug = Config.Bind("General", "IsDebug", false, "Enable debug logs"); nexusID = Config.Bind("General", "NexusID", 1596, "Nexus mod ID for updates"); if (!modEnabled.Value) @@ -65,13 +66,16 @@ static bool Prefix(Terminal __instance) List output = new List(); foreach(var pin in pinList) { - if(IsCustomPin(pin)) + if (IsCustomPin(pin)) + { + Dbgl($"Found pin to export: {pin.m_name}; {pin.m_type}; x{pin.m_pos.x}; y{pin.m_pos.y}; z{pin.m_pos.z}"); output.Add(JsonUtility.ToJson(new MyPinData(pin))); + } } File.WriteAllText(Path.Combine(AedenthornUtils.GetAssetPath(context, true), file), $"{string.Join("\n", output)}"); __instance.AddString(text); __instance.AddString($"{context.Info.Metadata.Name} {output.Count} pins exported"); - return false; + return false; } if (Minimap.instance && text.ToLower().Equals($"{typeof(BepInExPlugin).Namespace.ToLower()} clear")) { @@ -81,7 +85,10 @@ static bool Prefix(Terminal __instance) { var pin = pinList[i]; if (IsCustomPin(pin)) + { + Minimap.instance.GetType().GetTypeInfo().GetDeclaredMethod("DestroyPinMarker").Invoke(Minimap.instance, new object[] { pin }); pinList.RemoveAt(i); + } } __instance.AddString($"{context.Info.Metadata.Name} all pins cleared from map"); return false; @@ -104,7 +111,7 @@ static bool Prefix(Terminal __instance) try { var pin = JsonUtility.FromJson(str); - Minimap.instance.AddPin(pin.position, (Minimap.PinType)pin.type, pin.name, true, false, 0L); + Minimap.instance.AddPin(pin.position, (Minimap.PinType)pin.type, pin.name, true, pin.isChecked, 0L); count++; } catch(Exception ex) @@ -120,7 +127,8 @@ static bool Prefix(Terminal __instance) private static bool IsCustomPin(Minimap.PinData pin) { - return pin.m_save && pin.m_type != Minimap.PinType.Death && pin.m_type != Minimap.PinType.Bed && pin.m_type != Minimap.PinType.Icon4 && pin.m_type != Minimap.PinType.Shout && pin.m_type != Minimap.PinType.None && pin.m_type != Minimap.PinType.Boss && pin.m_type != Minimap.PinType.Player && pin.m_type != Minimap.PinType.RandomEvent && pin.m_type != Minimap.PinType.Ping && pin.m_type != Minimap.PinType.EventArea && pin.m_type != Minimap.PinType.Hildir1 && pin.m_type != Minimap.PinType.Hildir2 && pin.m_type != Minimap.PinType.Hildir3; + return pin.m_save && (pin.m_type == Minimap.PinType.Icon0 || pin.m_type == Minimap.PinType.Icon1 || pin.m_type == Minimap.PinType.Icon2 || pin.m_type == Minimap.PinType.Icon3 || pin.m_type == Minimap.PinType.Icon4); + //return pin.m_save && pin.m_type != Minimap.PinType.Death && pin.m_type != Minimap.PinType.Bed && pin.m_type != Minimap.PinType.Icon4 && pin.m_type != Minimap.PinType.Shout && pin.m_type != Minimap.PinType.None && pin.m_type != Minimap.PinType.Boss && pin.m_type != Minimap.PinType.Player && pin.m_type != Minimap.PinType.RandomEvent && pin.m_type != Minimap.PinType.Ping && pin.m_type != Minimap.PinType.EventArea && pin.m_type != Minimap.PinType.Hildir1 && pin.m_type != Minimap.PinType.Hildir2 && pin.m_type != Minimap.PinType.Hildir3; } } } diff --git a/MapPinExport/MyPinData.cs b/MapPinExport/MyPinData.cs index e7e1be1..cfbcf60 100644 --- a/MapPinExport/MyPinData.cs +++ b/MapPinExport/MyPinData.cs @@ -7,12 +7,14 @@ public class MyPinData public string name; public Minimap.PinType type; public Vector3 position; + public bool isChecked; public MyPinData(Minimap.PinData pin) { name = pin.m_name; position = pin.m_pos; type = pin.m_type; + isChecked = pin.m_checked; } } } \ No newline at end of file diff --git a/MerchantSpawnTweaks/Properties/AssemblyInfo.cs b/MerchantSpawnTweaks/Properties/AssemblyInfo.cs deleted file mode 100644 index 4e20d4d..0000000 --- a/MerchantSpawnTweaks/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("MerchantSpawnTweaks")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("MerchantSpawnTweaks")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("4aa627b6-66ee-4a52-8983-28ada518c735")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/MiningMod/BepInExPlugin.cs b/MiningMod/BepInExPlugin.cs index 89e1b9b..c0803b8 100644 --- a/MiningMod/BepInExPlugin.cs +++ b/MiningMod/BepInExPlugin.cs @@ -11,7 +11,7 @@ namespace MiningMod [BepInPlugin("aedenthorn.MiningMod", "Mining Mod", "0.7.0")] public class BepInExPlugin: BaseUnityPlugin { - private static readonly bool isDebug = true; + private static readonly bool isDebug = false; private static BepInExPlugin context; public static ConfigEntry modEnabled; @@ -92,16 +92,7 @@ static void Postfix(ref MineRock __instance) } } - [HarmonyPatch(typeof(MineRock5), "Start", new Type[] { })] - static class MineRock5_Start_Patch - { - static void Postfix(ref MineRock5 __instance) - { - __instance.m_dropItems.m_dropMin = Mathf.RoundToInt(dropMinMult.Value * __instance.m_dropItems.m_dropMin); - __instance.m_dropItems.m_dropMax = Mathf.RoundToInt(dropMaxMult.Value * __instance.m_dropItems.m_dropMax); - __instance.m_dropItems.m_dropChance *= dropChanceMult.Value; - } - } + [HarmonyPatch(typeof(DropTable), "GetDropList", new Type[] { })] static class DropTable_GetDropList_Patch { @@ -131,7 +122,7 @@ static void Postfix(ref List __result) { count = Mathf.RoundToInt(count * oreDropMult.Value); } - //Dbgl($"loot drop had {kvp.Value.Count} {(kvp.Value.Count > 0? kvp.Value[0].name :"")} - changed amount to {count}"); + Dbgl($"loot drop had {kvp.Value.Count} {(kvp.Value.Count > 0? kvp.Value[0].name :"")} - changed amount to {count}"); if(kvp.Value.Count < count) { for (int i = kvp.Value.Count; i < count; i++) @@ -190,7 +181,7 @@ static class MineRock_Damage_Patch { static void Prefix(MineRock __instance, ref HitData hit) { - //Dbgl($"Damaging {__instance.gameObject.name}"); + Dbgl($"Damaging {__instance.gameObject.name}"); hit.m_damage.m_pickaxe *= damageMult.Value; hit.m_damage.m_blunt *= damageMult.Value; hit.m_damage.m_chop *= damageMult.Value; @@ -202,7 +193,7 @@ static class MineRock5_Damage_Patch { static void Prefix(MineRock5 __instance, ref HitData hit) { - //Dbgl($"Damaging {__instance.gameObject.name}"); + Dbgl($"Damaging {__instance.gameObject.name}"); hit.m_damage.m_pickaxe *= damageMult.Value; hit.m_damage.m_blunt *= damageMult.Value; @@ -217,7 +208,7 @@ static void Prefix(Destructible __instance, ref HitData hit) { if (__instance.GetComponent() && __instance.gameObject.name.Contains("Rock")) { - //Dbgl($"Damaging {__instance.gameObject.name}"); + Dbgl($"Damaging {__instance.gameObject.name}"); hit.m_damage.m_pickaxe *= damageMult.Value; hit.m_damage.m_blunt *= damageMult.Value; hit.m_damage.m_chop *= damageMult.Value; diff --git a/PostProcessing/Properties/AssemblyInfo.cs b/PostProcessing/Properties/AssemblyInfo.cs deleted file mode 100644 index 4d49acb..0000000 --- a/PostProcessing/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("PostProcessing")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("PostProcessing")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("836db46b-86d6-47dd-8cf9-39be99a17b13")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/QuestFramework/Properties/AssemblyInfo.cs b/QuestFramework/Properties/AssemblyInfo.cs deleted file mode 100644 index 4493966..0000000 --- a/QuestFramework/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("QuestFramework")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("QuestFramework")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("d464e26e-c684-4f58-ab02-1bc4ca32454b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/QuickStore/Properties/AssemblyInfo.cs b/QuickStore/Properties/AssemblyInfo.cs deleted file mode 100644 index a1605d4..0000000 --- a/QuickStore/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("QuickStore")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("QuickStore")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("26b8b5a6-6135-407b-b498-da38fced0c9e")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/RepeatActions/Properties/AssemblyInfo.cs b/RepeatActions/Properties/AssemblyInfo.cs deleted file mode 100644 index 899a0f2..0000000 --- a/RepeatActions/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("RepeatActions")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("RepeatActions")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("27964f69-935d-4366-9b2b-0632189c2b20")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/RequirementCheck/Properties/AssemblyInfo.cs b/RequirementCheck/Properties/AssemblyInfo.cs deleted file mode 100644 index f730356..0000000 --- a/RequirementCheck/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("KeyCheckAntiCheat")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("KeyCheckAntiCheat")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("cfbe6c20-076e-4427-ba49-557753ecdb09")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/TerraformTweaks/Properties/AssemblyInfo.cs b/TerraformTweaks/Properties/AssemblyInfo.cs deleted file mode 100644 index 1f4fedc..0000000 --- a/TerraformTweaks/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("TerraformTweaks")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("TerraformTweaks")] -[assembly: AssemblyCopyright("Copyright © 2021")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3c71e421-2a98-4b06-b708-888e5e77d7f3")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/valheim.targets b/valheim.targets index be591b3..c5e17c2 100644 --- a/valheim.targets +++ b/valheim.targets @@ -47,12 +47,12 @@ - + $(GamePath)\BepInEx $(GamePath)\valheim_Data\Managed - $(GamePath)\unstripped_corlib + $(GamePath)\valheim_Data\Managed @@ -65,207 +65,415 @@ + + False + $(BepInExPath)\core\BepInEx.dll + False + False $(BepInExPath)\core\0Harmony20.dll False - - False - $(BepInExPath)\core\BepInEx.dll - False - + + False + $(BepInExPath)\core\BepInEx.Preloader.dll + False + + + False + $(BepInExPath)\core\HarmonyXInterop.dll + False + + + False + $(BepInExPath)\core\Mono.Cecil.dll + False + + + False + $(BepInExPath)\core\MonoMod.Utils.dll + False + - - False - $(ManagedDataPath)\assembly_valheim.dll - False - - - False - $(ManagedDataPath)\assembly_googleanalytics.dll - False - - - False - $(ManagedDataPath)\assembly_guiutils.dll - False - - - False - $(ManagedDataPath)\ui_lib.dll - False - - - False - $(ManagedDataPath)\assembly_postprocessing.dll - False - - - False - $(ManagedDataPath)\assembly_steamworks.dll - False - - - False - $(ManagedDataPath)\assembly_sunshafts.dll - False - - - False - $(ManagedDataPath)\assembly_utils.dll - False - + + False + $(ManagedDataPath)\assembly_googleanalytics.dll + False + + + False + $(ManagedDataPath)\assembly_guiutils.dll + False + + + False + $(ManagedDataPath)\assembly_lux.dll + False + + + False + $(ManagedDataPath)\assembly_postprocessing.dll + False + + + False + $(ManagedDataPath)\assembly_simplemeshcombine.dll + False + + + False + $(ManagedDataPath)\assembly_sunshafts.dll + False + + + False + $(ManagedDataPath)\assembly_utils.dll + False + + + False + $(ManagedDataPath)\assembly_valheim.dll + False + - + - - False - $(UnityPath)\UnityEngine.dll - False - - - False - $(UnityPath)\UnityEngine.AccessibilityModule.dll - False - - - False - $(UnityPath)\UnityEngine.AIModule.dll - False - - - False - $(UnityPath)\UnityEngine.AnimationModule.dll - False - - - False - $(UnityPath)\UnityEngine.AudioModule.dll - False - - - False - $(UnityPath)\UnityEngine.ClothModule.dll - False - - - False - $(UnityPath)\UnityEngine.CoreModule.dll - False - - - False - $(UnityPath)\UnityEngine.InputLegacyModule.dll - False - - - False - $(UnityPath)\UnityEngine.ParticleSystemModule.dll - False - - - False - $(UnityPath)\UnityEngine.PhysicsModule.dll - False - - - False - $(UnityPath)\UnityEngine.ScreenCaptureModule.dll - False - - - False - $(ManagedDataPath)\Unity.TextMeshPro.dll - False - - - False - $(UnityPath)\UnityEngine.UI.dll - False - - - False - $(UnityPath)\UnityEngine.UIModule.dll - False - - - False - $(UnityPath)\UnityEngine.UIElementsModule.dll - False - - - False - $(UnityPath)\UnityEngine.InputModule.dll - False - - - False - $(UnityPath)\UnityEngine.JSONSerializeModule.dll - False - - - False - $(UnityPath)\UnityEngine.IMGUIModule.dll - False - - - False - $(UnityPath)\UnityEngine.ImageConversionModule.dll - False - - - False - $(UnityPath)\UnityEngine.TerrainModule.dll - False - - - False - $(UnityPath)\UnityEngine.TextCoreModule.dll - False - - - False - $(UnityPath)\UnityEngine.TextRenderingModule.dll - False - - - False - $(UnityPath)\UnityEngine.UnityWebRequestAudioModule.dll - False - - - False - $(UnityPath)\UnityEngine.UnityWebRequestModule.dll - False - - - False - $(UnityPath)\UnityEngine.UnityWebRequestWWWModule.dll - False - - - False - $(UnityPath)\UnityEngine.UnityWebRequestTextureModule.dll - False - - - False - $(UnityPath)\UnityEngine.AssetBundleModule.dll - False - + + $(ManagedDataPath)\Unity.TextMeshPro.dll + False + False + + + $(ManagedDataPath)\UnityEngine.dll + False + False + + + $(ManagedDataPath)\UnityEngine.AccessibilityModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.AIModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.AndroidJNIModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.AnimationModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.AssetBundleModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.AudioModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.ClothModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.ClusterInputModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.ClusterRendererModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.CoreModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.CrashReportingModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.DirectorModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.DSPGraphModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.GameCenterModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.GridModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.HotReloadModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.ImageConversionModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.IMGUIModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.InputLegacyModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.InputModule.dll + False + False + + + $(ManagedDataPath)\Unity.InputSystem.dll + False + False + + + $(ManagedDataPath)\UnityEngine.JSONSerializeModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.LocalizationModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.ParticleSystemModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.PerformanceReportingModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.Physics2DModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.PhysicsModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.ProfilerModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.ScreenCaptureModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.SharedInternalsModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.SpriteMaskModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.SpriteShapeModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.StreamingModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.SubstanceModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.SubsystemsModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.TerrainModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.TerrainPhysicsModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.TextRenderingModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.TilemapModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.TLSModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.UI.dll + False + False + + + $(ManagedDataPath)\UnityEngine.UIElementsModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.UIModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.UmbraModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.UnityAnalyticsModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.UnityConnectModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.UnityTestProtocolModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.UnityWebRequestAssetBundleModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.UnityWebRequestAudioModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.UnityWebRequestModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.UnityWebRequestTextureModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.UnityWebRequestWWWModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.VehiclesModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.VFXModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.VideoModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.VRModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.WindModule.dll + False + False + + + $(ManagedDataPath)\UnityEngine.XRModule.dll + False + False + + + + + $(ManagedDataPath)\Mono.Security.dll + False + False + + + $(ManagedDataPath)\gui_framework.dll + False + False + + + - + + + + + + + + +