From aaaa5e2b6d3e606f360631c0caf9fdb2bdee03e0 Mon Sep 17 00:00:00 2001 From: Sean Petrie Date: Tue, 9 Nov 2021 17:30:56 -0600 Subject: [PATCH] Updated for release --- CHANGELOG.md | 5 +++-- README.md | 1 + .../{ItemEntityPatches.cs => DynamicItemNames.cs} | 11 ++++++++--- TabletopTweaks/Config/Fixes.json | 8 ++++++++ TabletopTweaks/Info.json | 4 ++-- TabletopTweaks/TabletopTweaks.csproj | 2 +- 6 files changed, 23 insertions(+), 8 deletions(-) rename TabletopTweaks/Bugfixes/General/{ItemEntityPatches.cs => DynamicItemNames.cs} (98%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72158043..d015497a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,13 @@ -## Version 1.9.7 +## Version 1.10.0 * Added homebrew flags in the settings * Fixed minor issues with AddFacts * Added Quick Draw * Celestial Bloodline now works correctly with Metamagic Rager * Adjusted Magical Tail Feats @Balkoth -* Kitsune polymorph is now correctly considered a polymorph +* Kitsune polymorph is now correctly considered a polymorph @Balkoth * Updated string handling to support general localization (will need help from speakers to do actual localization work) * Shadow Enchantment should now work correctly +* Added support for dynamic item naming ## Version 1.9.6b * Aspect of Omox DR now stacks globaly diff --git a/README.md b/README.md index 083f7654..ac2d30d6 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,7 @@ All fixes and added content are configurable and can be disabled by editing the Stalwart Improved Stalwart Celestial Servant + Quick Draw Adds the following rogue talents: Graceful Athlete diff --git a/TabletopTweaks/Bugfixes/General/ItemEntityPatches.cs b/TabletopTweaks/Bugfixes/General/DynamicItemNames.cs similarity index 98% rename from TabletopTweaks/Bugfixes/General/ItemEntityPatches.cs rename to TabletopTweaks/Bugfixes/General/DynamicItemNames.cs index cc3b7276..6dc5cc28 100644 --- a/TabletopTweaks/Bugfixes/General/ItemEntityPatches.cs +++ b/TabletopTweaks/Bugfixes/General/DynamicItemNames.cs @@ -9,13 +9,15 @@ using Kingmaker.Utility; using System.Collections.Generic; using System.Linq; +using TabletopTweaks.Config; using TabletopTweaks.Extensions; namespace TabletopTweaks.Bugfixes.General { - static class ItemEntityPatches { + static class DynamicItemNames { [HarmonyPatch(typeof(ItemEntity), nameof(ItemEntity.Name), MethodType.Getter)] static class ItemEntity_Names_Patch { static bool Prefix(ItemEntity __instance, ref string __result) { + if (ModSettings.Fixes.BaseFixes.IsDisabled("DynamicItemNaming")) { return true; } if (!__instance.IsIdentified) { return true; } string UniqueName = __instance.Blueprint.m_DisplayNameText; string DefaultName = ""; @@ -39,11 +41,12 @@ static bool Prefix(ItemEntity __instance, ref string __result) { } } private static string GetEnchantmentPrefixes(this IEnumerable enchants) { + var includeTemporary = ModSettings.Fixes.BaseFixes.IsEnabled("DynamicItemNamingTemporary"); if (enchants == null || enchants.Empty()) { return ""; } string text = ""; - foreach (BlueprintItemEnchantment blueprintEnchantment in enchants.Where(e => !e.IsTemporary).Select(e => e.Blueprint)) { + foreach (BlueprintItemEnchantment blueprintEnchantment in enchants.Where(e => includeTemporary ? true : !e.IsTemporary).Select(e => e.Blueprint)) { if (!blueprintEnchantment.Prefix.IsNullOrEmpty()) { text += blueprintEnchantment.Prefix + " "; } @@ -60,11 +63,12 @@ private static string GetCustomEnchantmentPrefixes(this ItemEntity item) { .GetEnchantmentPrefixes(); } private static string GetEnchantmentSuffixes(this IEnumerable enchants) { + var includeTemporary = ModSettings.Fixes.BaseFixes.IsEnabled("DynamicItemNamingTemporary"); if (enchants == null || enchants.Empty()) { return ""; } string text = ""; - foreach (BlueprintItemEnchantment blueprintEnchantment in enchants.Where(e => !e.IsTemporary).Select(e => e.Blueprint)) { + foreach (BlueprintItemEnchantment blueprintEnchantment in enchants.Where(e => includeTemporary ? true : !e.IsTemporary).Select(e => e.Blueprint)) { if (!blueprintEnchantment.Suffix.IsNullOrEmpty()) { text += " " + blueprintEnchantment.Suffix; } @@ -115,6 +119,7 @@ static class BlueprintsCache_Init_Patch { static void Postfix() { if (Initialized) return; Initialized = true; + if (ModSettings.Fixes.BaseFixes.IsDisabled("DynamicItemNaming")) { return; } Main.LogHeader("Patching Enchant Prefixes/Suffixes"); PatchWeaponEnchants(); diff --git a/TabletopTweaks/Config/Fixes.json b/TabletopTweaks/Config/Fixes.json index 36bfe77c..b93be13b 100644 --- a/TabletopTweaks/Config/Fixes.json +++ b/TabletopTweaks/Config/Fixes.json @@ -31,6 +31,14 @@ "Enabled": true, "Description": "Prevents most forms of damage reduction from stacking unless specifically specified" }, + "DynamicItemNaming": { + "Enabled": true, + "Description": "Allows Weapon/Armor names to be modified by any additional enchants they gain outside of thier base enchants." + }, + "DynamicItemNamingTemporary": { + "Enabled": true, + "Description": "Displays the names of temporary enchants as part of the equipment." + }, "FeatSelections": { "Enabled": true, "Description": "Cleans up limited feat selections (like fighter combat feats) to include all feats of the specified type." diff --git a/TabletopTweaks/Info.json b/TabletopTweaks/Info.json index cc77ff94..72a2d016 100644 --- a/TabletopTweaks/Info.json +++ b/TabletopTweaks/Info.json @@ -3,11 +3,11 @@ "Author": "Sean Petrie", "DisplayName": "Tabletop Tweaks", "EntryMethod": "TabletopTweaks.Main.Load", - "GameVersion": "1.1.0", + "GameVersion": "1.1.1", "HomePage": "https://github.com/Vek17/WrathMods-TabletopTweaks/releases", "Id": "TabletopTweaks", "ManagerVersion": "0.23.0", "Repository": "https://raw.githubusercontent.com/Vek17/WrathMods-TabletopTweaks/master/Repository.json", "Requirements": [], - "Version": "1.9.7" + "Version": "1.10.0" } \ No newline at end of file diff --git a/TabletopTweaks/TabletopTweaks.csproj b/TabletopTweaks/TabletopTweaks.csproj index 7cb89961..f39e96b6 100644 --- a/TabletopTweaks/TabletopTweaks.csproj +++ b/TabletopTweaks/TabletopTweaks.csproj @@ -162,7 +162,7 @@ - +