From a5b05d172e61c30269fd8f00b13f807f67e428eb Mon Sep 17 00:00:00 2001 From: Pete Navarra Date: Mon, 18 Sep 2023 09:59:15 -0400 Subject: [PATCH 01/26] Release 1.2.17 ### 1.2.17 * Adding appropriate Dependency Checks to that Mod Detection actually works. * Fixing a logic error where it wasn't respecting the priority of Chatter and Sears Catalog correctly * This will provide the priority. # Conflicts: # Auga/Auga.cs # Auga/Properties/AssemblyInfo.cs # Auga/manifest.json --- Auga/Auga.cs | 7 ++++--- Auga/Chat_Setup.cs | 15 ++++++++++++--- Auga/Hud_Setup.cs | 15 ++++++++++++--- Auga/Properties/AssemblyInfo.cs | 4 ++-- Auga/manifest.json | 2 +- CHANGELOG.md | 13 ++++++++++++- 6 files changed, 43 insertions(+), 13 deletions(-) diff --git a/Auga/Auga.cs b/Auga/Auga.cs index 6544050..edb7afa 100644 --- a/Auga/Auga.cs +++ b/Auga/Auga.cs @@ -77,11 +77,13 @@ public class AugaColors [BepInPlugin(PluginID, "Project Auga", Version)] [BepInDependency("Menthus.bepinex.plugins.BetterTrader", BepInDependency.DependencyFlags.SoftDependency)] [BepInDependency("maximods.valheim.multicraft", BepInDependency.DependencyFlags.SoftDependency)] + [BepInDependency("redseiko.valheim.chatter", BepInDependency.DependencyFlags.SoftDependency)] + [BepInDependency("redseiko.valheim.searscatalog", BepInDependency.DependencyFlags.SoftDependency)] [BepInDependency("com.github.abearcodes.valheim.simplerecycling", BepInDependency.DependencyFlags.SoftDependency)] public class Auga : BaseUnityPlugin { public const string PluginID = "randyknapp.mods.auga"; - public const string Version = "1.2.15"; + public const string Version = "1.2.17"; public enum StatBarTextDisplayMode { JustValue, ValueAndMax, ValueMaxPercent, JustPercent } public enum StatBarTextPosition { Off = -1, Above, Below, Center, Start, End }; @@ -157,8 +159,7 @@ public void Awake() } } } - - + LoadDependencies(); LoadTranslations(); LoadConfig(); diff --git a/Auga/Chat_Setup.cs b/Auga/Chat_Setup.cs index 646adf0..e46b762 100644 --- a/Auga/Chat_Setup.cs +++ b/Auga/Chat_Setup.cs @@ -12,7 +12,10 @@ public static class Chat_Awake_Patch { public static bool Prefix(Chat __instance) { - if (!Auga.AugaChatShow.Value || Auga.HasChatter) + if (Auga.HasChatter) + return true; + + if (!Auga.AugaChatShow.Value ) return true; return !SetupHelper.IndirectTwoObjectReplace(__instance.transform, Auga.Assets.AugaChat, "Chat", "Chat_box", "AugaChat"); @@ -20,7 +23,10 @@ public static bool Prefix(Chat __instance) public static void Postfix(Chat __instance) { - if (!Auga.AugaChatShow.Value || Auga.HasChatter) + if (Auga.HasChatter) + return; + + if (!Auga.AugaChatShow.Value ) return; if (__instance.m_input != null) @@ -33,7 +39,10 @@ public static class Chat_SetNpcText_Patch { public static void Postfix(Chat __instance) { - if (!Auga.AugaChatShow.Value || Auga.HasChatter) + if (Auga.HasChatter) + return; + + if (!Auga.AugaChatShow.Value) return; var latestChatMessage = __instance.m_npcTexts.LastOrDefault(); diff --git a/Auga/Hud_Setup.cs b/Auga/Hud_Setup.cs index 98e1b26..384a995 100644 --- a/Auga/Hud_Setup.cs +++ b/Auga/Hud_Setup.cs @@ -617,7 +617,10 @@ public static class Hud_UpdatePieceList_Patch { public static bool Prefix(Hud __instance, Player player, Vector2Int selectedNr, Piece.PieceCategory category, bool updateAllBuildStatuses) { - if (!Auga.BuildMenuShow.Value || Auga.HasSearsCatalog) + if (Auga.HasSearsCatalog) + return true; + + if (!Auga.BuildMenuShow.Value ) return true; var buildPieces = player.GetBuildPieces(); @@ -691,7 +694,10 @@ public static class PieceTable_PrevCategory_Patch { public static bool Prefix(ref PieceTable __instance) { - if (!Auga.BuildMenuShow.Value || Auga.HasSearsCatalog) + if (Auga.HasSearsCatalog) + return true; + + if (!Auga.BuildMenuShow.Value ) return true; return Input.GetAxis("Mouse ScrollWheel") == 0; @@ -720,7 +726,10 @@ public static class PieceTable_NextCategory_Patch { public static bool Prefix(ref PieceTable __instance) { - if (!Auga.BuildMenuShow.Value || Auga.HasSearsCatalog) + if (Auga.HasSearsCatalog) + return true; + + if (!Auga.BuildMenuShow.Value ) return true; return Input.GetAxis("Mouse ScrollWheel") == 0; diff --git a/Auga/Properties/AssemblyInfo.cs b/Auga/Properties/AssemblyInfo.cs index dfc6f50..94b34b0 100644 --- a/Auga/Properties/AssemblyInfo.cs +++ b/Auga/Properties/AssemblyInfo.cs @@ -39,6 +39,6 @@ [assembly: AssemblyVersion("1.3")] [assembly: AssemblyFileVersion("1.3")] #else -[assembly: AssemblyVersion("1.2.15")] -[assembly: AssemblyFileVersion("1.2.15")] +[assembly: AssemblyVersion("1.2.17")] +[assembly: AssemblyFileVersion("1.2.17")] #endif diff --git a/Auga/manifest.json b/Auga/manifest.json index cc4f781..6c3cf7a 100644 --- a/Auga/manifest.json +++ b/Auga/manifest.json @@ -1,6 +1,6 @@ { "name": "Auga", - "version_number": "1.2.15", + "version_number": "1.2.17", "website_url": "https://github.com/RandyKnapp/Auga", "description": "A fresh new look for Valheim", "dependencies": [ diff --git a/CHANGELOG.md b/CHANGELOG.md index cacc6ed..44040ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +### 1.2.17 +* Adding appropriate Dependency Checks to that Mod Detection actually works. +* Fixing a logic error where it wasn't respecting the priority of Chatter and Sears Catalog correctly + * This will provide the priority. + ### 1.2.16 * Fixed Password Dialogue Box * Fixed Console Issue @@ -5,6 +10,10 @@ * Removed Blackbox from under Keybind in Hover Text's * Added Support for Comfy's Chatter Mod * Added Additional Support for Comfy's Sears Catalog + +
+Changelog History (click to expand) + ### 1.2.15 * Hildir's Request 0.217.14 Update * Known Issue: The chat input box is in the middle of the box. Minor issue. Not game breaking. @@ -144,4 +153,6 @@ ### 1.0.2 * Fixed overlapping names and health bars for enemies when using CLLC ### 1.0.1 - * Valheim+ Compatibility \ No newline at end of file + * Valheim+ Compatibility + +
\ No newline at end of file From 8e116d30fdd35143cb5d78308a2cbc554356635b Mon Sep 17 00:00:00 2001 From: Pete Navarra Date: Mon, 18 Sep 2023 23:34:27 -0400 Subject: [PATCH 02/26] Initial changes # Conflicts: # Auga/Auga.csproj # AugaUnityLib/AugaUnityLib.csproj --- Auga/API.External.cs | 3 +- Auga/API.cs | 3 +- Auga/Auga.csproj | 3 +- Auga/Hud_Setup.cs | 14 +- Auga/PlayerInventory_Setup.cs | 15 +- Auga/Properties/AssemblyInfo.cs | 8 +- Auga/SetupHelper.cs | 8 + AugaUnity/Assembly-CSharp-Editor.csproj | 3 - AugaUnity/AssetBundles/AssetBundles | Bin 1035 -> 1034 bytes AugaUnity/AssetBundles/AssetBundles.manifest | 2 +- AugaUnity/AssetBundles/augaassets | 4 +- AugaUnity/AssetBundles/augaassets.manifest | 12 +- .../Assets/ExternalLibraries/Unity.Auga.dll | Bin 106496 -> 113664 bytes .../Assets/Prefabs/AugaMessageHud.prefab | 362 ++++++++++++------ .../Packages/valheim/Assembly-CSharp.dll | Bin 25600 -> 25600 bytes .../Packages/valheim/ConnectedStorage.dll | Bin 3072 -> 3072 bytes .../Packages/valheim/Fishlabs.Common.dll | Bin 7168 -> 7168 bytes AugaUnity/Packages/valheim/Fishlabs.Core.dll | Bin 5632 -> 5632 bytes AugaUnity/Packages/valheim/PlayFabParty.dll | Bin 156160 -> 156160 bytes AugaUnity/Packages/valheim/XGamingRuntime.dll | Bin 340480 -> 342016 bytes .../Packages/valheim/assembly_guiutils.dll | Bin 25088 -> 24064 bytes .../valheim/assembly_simplemeshcombine.dll | Bin 7168 -> 7168 bytes .../Packages/valheim/assembly_sunshafts.dll | Bin 74752 -> 74752 bytes AugaUnity/Packages/valheim/assembly_utils.dll | Bin 73216 -> 76288 bytes .../Packages/valheim/assembly_valheim.dll | Bin 1618432 -> 1624576 bytes AugaUnity/Packages/valheim/ui_lib.dll | Bin 7680 -> 8192 bytes AugaUnityLib/AugaCraftingPanel.cs | 15 +- AugaUnityLib/AugaTopLeftMessage.cs | 3 +- AugaUnityLib/AugaUnityLib.csproj | 36 +- AugaUnityLib/CraftingRequirementsPanel.cs | 5 +- 30 files changed, 326 insertions(+), 170 deletions(-) diff --git a/Auga/API.External.cs b/Auga/API.External.cs index 9d5b039..7c0ad4c 100644 --- a/Auga/API.External.cs +++ b/Auga/API.External.cs @@ -5,6 +5,7 @@ using System.Reflection.Emit; using HarmonyLib; using JetBrains.Annotations; +using TMPro; using UnityEngine; using UnityEngine.UI; @@ -141,7 +142,7 @@ public static void ComplexTooltip_SetSkill(GameObject complexTooltipGO, Skills.S public static GameObject[] RequirementsPanel_RequirementList(GameObject requirementsPanelGO) => null; public static void RequirementsPanel_SetWires(GameObject requirementsPanelGO, RequirementWireState[] wireStates, bool canCraft) { } - public static Text CustomVariantPanel_Enable(string buttonLabel, Action onShow) => null; + public static TMP_Text CustomVariantPanel_Enable(string buttonLabel, Action onShow) => null; public static void CustomVariantPanel_SetButtonLabel(string buttonLabel) { } public static void CustomVariantPanel_Disable() { } } diff --git a/Auga/API.cs b/Auga/API.cs index d1baf05..3aebb8c 100644 --- a/Auga/API.cs +++ b/Auga/API.cs @@ -2,6 +2,7 @@ using System.Linq; using AugaUnity; using JetBrains.Annotations; +using TMPro; using UnityEngine; using UnityEngine.UI; using Object = UnityEngine.Object; @@ -799,7 +800,7 @@ public static void RequirementsPanel_SetWires(GameObject requirementsPanelGO, Re // Custom Variant Panel //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// [UsedImplicitly] - public static Text CustomVariantPanel_Enable(string buttonLabel, Action onShow) + public static TMP_Text CustomVariantPanel_Enable(string buttonLabel, Action onShow) { if (WorkbenchPanelController.instance == null) { diff --git a/Auga/Auga.csproj b/Auga/Auga.csproj index 6c36483..c52b39d 100644 --- a/Auga/Auga.csproj +++ b/Auga/Auga.csproj @@ -130,6 +130,7 @@ + @@ -200,7 +201,7 @@ ) if $(ConfigurationName) == API ( - xcopy "$(TargetDir)$(TargetFileName)" "C:\Users\rknapp\Documents\GitHub\ValheimMods\Libs\" /q /y /i + xcopy "$(TargetDir)$(TargetFileName)" "M:\Code\VapokModBase\References\AugaAPI\" /q /y /i ) else ( xcopy "$(TargetDir)$(TargetFileName)" "C:\Program Files (x86)\Steam\steamapps\common\Valheim\BepInEx\plugins\$(ProjectName)\" /q /y /i xcopy "$(TargetDir)$(TargetFileName).mdb" "C:\Program Files (x86)\Steam\steamapps\common\Valheim\BepInEx\plugins\$(ProjectName)\" /q /y /i diff --git a/Auga/Hud_Setup.cs b/Auga/Hud_Setup.cs index 384a995..6e2307f 100644 --- a/Auga/Hud_Setup.cs +++ b/Auga/Hud_Setup.cs @@ -42,12 +42,12 @@ public static void Hud_Awake_Postfix(Hud __instance) __instance.m_sleepingProgress = loadingScreen.Find("Sleeping").gameObject; __instance.m_teleportingProgress = loadingScreen.Find("Teleporting").gameObject; __instance.m_loadingImage = loadingScreen.Find("Loading/Image").GetComponent(); - __instance.m_loadingTip = loadingScreen.Find("Loading/Tip").GetComponent(); + __instance.m_loadingTip = loadingScreen.Find("Loading/Tip").GetComponent(); __instance.m_sleepingProgress.GetComponent().m_dreamTexts = originalDreamTexts; __instance.m_eventBar = __instance.Replace("hudroot/EventBar", Auga.Assets.Hud).gameObject; - __instance.m_eventName = __instance.m_eventBar.GetComponentInChildren(); + __instance.m_eventName = __instance.m_eventBar.GetComponentInChildren(); __instance.m_eventBar.gameObject.AddComponent().Init(TextAnchor.UpperCenter, 0, -90); __instance.m_damageScreen = __instance.Replace("hudroot/Damaged", Auga.Assets.Hud).GetComponent(); @@ -69,10 +69,10 @@ public static void Hud_Awake_Postfix(Hud __instance) var originalGuardianPowerMaterial = __instance.m_gpIcon.material; __instance.m_gpRoot = (RectTransform)__instance.Replace("hudroot/GuardianPower", Auga.Assets.Hud); - __instance.m_gpName = __instance.m_gpRoot.Find("Name").GetComponent(); + __instance.m_gpName = __instance.m_gpRoot.Find("Name").GetComponent(); __instance.m_gpIcon = __instance.m_gpRoot.Find("Icon").GetComponent(); __instance.m_gpIcon.material = originalGuardianPowerMaterial; - __instance.m_gpCooldown = __instance.m_gpRoot.Find("TimeText").GetComponent(); + __instance.m_gpCooldown = __instance.m_gpRoot.Find("TimeText").GetComponent(); __instance.m_gpRoot.gameObject.AddComponent().Init(TextAnchor.LowerLeft, 60, 70); @@ -120,7 +120,7 @@ public static void Hud_Awake_Postfix(Hud __instance) __instance.m_eitrText = null; __instance.m_actionBarRoot = __instance.Replace("hudroot/action_progress", Auga.Assets.Hud).gameObject; - __instance.m_actionName = __instance.m_actionBarRoot.GetComponentInChildren(); + __instance.m_actionName = __instance.m_actionBarRoot.GetComponentInChildren(); __instance.m_actionProgress = __instance.m_actionBarRoot.GetComponent(); __instance.m_actionBarRoot.gameObject.AddComponent().Init("ActionProgress", TextAnchor.LowerCenter, 0, 226); @@ -165,8 +165,8 @@ public static void Hud_Awake_Postfix(Hud __instance) __instance.m_pieceSelectionWindow.AddComponent().Init(TextAnchor.MiddleCenter, 0, 0); var selectedPiece = __instance.m_buildHud.transform.Find("SelectedPiece"); - __instance.m_buildSelection = selectedPiece.Find("Name").GetComponent(); - __instance.m_pieceDescription = selectedPiece.Find("Info").GetComponent(); + __instance.m_buildSelection = selectedPiece.Find("Name").GetComponent(); + __instance.m_pieceDescription = selectedPiece.Find("Info").GetComponent(); __instance.m_buildIcon = selectedPiece.Find("Darken/IconBG/PieceIcon").GetComponent(); selectedPiece.gameObject.AddComponent().Init(TextAnchor.LowerCenter, 0, 15); diff --git a/Auga/PlayerInventory_Setup.cs b/Auga/PlayerInventory_Setup.cs index 81849be..e9fc30a 100644 --- a/Auga/PlayerInventory_Setup.cs +++ b/Auga/PlayerInventory_Setup.cs @@ -1,6 +1,7 @@ using System.Globalization; using AugaUnity; using HarmonyLib; +using TMPro; using UnityEngine; using UnityEngine.UI; using Object = UnityEngine.Object; @@ -31,16 +32,16 @@ public static void Postfix(InventoryGui __instance) __instance.m_playerGrid = playerInventory.Find("PlayerGrid").GetComponent(); __instance.m_playerGrid.m_onSelected += __instance.OnSelectedItem; __instance.m_playerGrid.m_onRightClick += __instance.OnRightClickItem; - __instance.m_weight = playerInventory.Find("Weight/Text").GetComponent(); - __instance.m_armor = playerInventory.Find("Armor/Text").GetComponent(); + __instance.m_weight = playerInventory.Find("Weight/Text").GetComponent(); + __instance.m_armor = playerInventory.Find("Armor/Text").GetComponent(); var containerInventory = __instance.Replace("root/Container", Auga.Assets.InventoryScreen, "root/Container"); __instance.m_container = containerInventory.RectTransform(); - __instance.m_containerName = containerInventory.Find("ContainerHeader/Name").GetComponent(); + __instance.m_containerName = containerInventory.Find("ContainerHeader/Name").GetComponent(); __instance.m_containerGrid = containerInventory.Find("ContainerGrid").GetComponent(); __instance.m_containerGrid.m_onSelected += __instance.OnSelectedItem; __instance.m_containerGrid.m_onRightClick += __instance.OnRightClickItem; - __instance.m_containerWeight = containerInventory.Find("Weight/Text").GetComponent(); + __instance.m_containerWeight = containerInventory.Find("Weight/Text").GetComponent(); __instance.m_takeAllButton = containerInventory.Find("TakeAll").GetComponent(); __instance.m_takeAllButton.onClick.AddListener(__instance.OnTakeAll); @@ -65,7 +66,7 @@ public static void Postfix(InventoryGui __instance) rightPanel.SetSiblingIndex(craftingPanelSiblingIndex); CraftingPanel = rightPanel.GetComponentInChildren(true); CraftingPanel.SetMultiCraftEnabled(Auga.HasMultiCraft); - __instance.m_playerName = rightPanel.Find("DefaultContent/TitleContainer/PlayerPanelTitle").GetComponent(); + __instance.m_playerName = rightPanel.Find("DefaultContent/TitleContainer/PlayerPanelTitle").GetComponent(); __instance.m_pvp = rightPanel.Find("TabContent/TabContent_PVP/Dummy/PVPToggle").GetComponent(); __instance.m_recipeElementPrefab = CraftingPanel.RecipeItemPrefab; __instance.m_recipeListRoot = CraftingPanel.RecipeList; @@ -112,11 +113,11 @@ public static void Postfix(InventoryGui __instance) var splitDialog = __instance.Replace("root/SplitDialog", Auga.Assets.InventoryScreen, "root/SplitDialog"); __instance.m_splitPanel = splitDialog; __instance.m_splitSlider = splitDialog.Find("Dialog/Slider").GetComponent(); - __instance.m_splitAmount = splitDialog.Find("Dialog/InventoryElement/amount").GetComponent(); + __instance.m_splitAmount = splitDialog.Find("Dialog/InventoryElement/amount").GetComponent(); __instance.m_splitCancelButton = splitDialog.Find("Dialog/ButtonCancel").GetComponent