From 40abe6f014b75f2cb7a6ea6401e3915f17c1a46f Mon Sep 17 00:00:00 2001 From: ZavarskiTheRealOne Date: Tue, 20 Jan 2026 13:17:33 +0800 Subject: [PATCH] Rewrote BaseQuestFish's location implementation This commit changes the way BaseQuestFish class renders its location text in both tooltip and quest description. Now the location text is written without quotation marks, and there is instead a "LocationTooltip" localization key which handles putting the location text into quotation marks for fish's description. This change is mostly for easing up the localization work, as it is easier to do this than removing every single quotation marks possible via code. --- Items/CalamityGlobalItemTooltip.cs | 4 ++-- Items/Fishing/BaseQuestFish.cs | 4 ++-- .../en-US/Mods.CalamityMod.Items.Fishing.hjson | 13 +++++++------ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 229a2f88bf..388bec75f7 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -152,8 +152,8 @@ namespace CalamityMod.Items WhipAutomaticTooltips(item, tooltips, ref lastTooltipIndex); // In GFB, replace all instances of "rogue" with "rouge". - string[] rogueKey = new string[] { CalamityUtils.GetTextValue($"Misc.GFBRogueUppercase"), CalamityUtils.GetTextValue($"Misc.GFBRogueLowercase") }; - string[] rougeKey = new string[] { CalamityUtils.GetTextValue($"Misc.GFBRougeUppercase"), CalamityUtils.GetTextValue($"Misc.GFBRougeLowercase") }; + string[] rogueKey = [CalamityUtils.GetTextValue($"Misc.GFBRogueUppercase"), CalamityUtils.GetTextValue($"Misc.GFBRogueLowercase")]; + string[] rougeKey = [CalamityUtils.GetTextValue($"Misc.GFBRougeUppercase"), CalamityUtils.GetTextValue($"Misc.GFBRougeLowercase")]; for (int n = 0; n < rogueKey.Length; n++) { if (Main.zenithWorld && rogueKey[n] != "") diff --git a/Items/Fishing/BaseQuestFish.cs b/Items/Fishing/BaseQuestFish.cs index e18d825cfa..7cf3ed426d 100644 --- a/Items/Fishing/BaseQuestFish.cs +++ b/Items/Fishing/BaseQuestFish.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Fishing public virtual LocalizedText Location => LocalizedText.Empty; public new string LocalizationCategory => "Items.Fishing"; - public override LocalizedText Tooltip => Location; + public override LocalizedText Tooltip => CalamityUtils.GetText($"Items.Fishing.LocationTooltip").WithFormatArgs(Location); public override void SetStaticDefaults() { @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Fishing public override void AnglerQuestChat(ref string description, ref string catchLocation) { description = this.GetLocalizedValue("QuestDescription"); - catchLocation = Location.ToString().Replace("'", string.Empty); + catchLocation = Location.ToString(); } } } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson index 01bff6009c..48756b94b9 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson @@ -1,9 +1,10 @@ -// Quest fish tooltips -CaughtInAstral: "'Caught in the Astral Infection'" -CaughtInBrimstoneCrag: "'Caught in the Brimstone Crag'" -CaughtInSnow: "'Caught in Tundra'" -CaughtInSpace: "'Caught in Sky Lakes'" -CaughtInSunkenSea: "'Caught in the Sunken Sea'" +// Quest fish tooltips +CaughtInAstral: Caught in the Astral Infection +CaughtInBrimstoneCrag: Caught in the Brimstone Crag +CaughtInSnow: Caught in Tundra +CaughtInSpace: Caught in Sky Lakes +CaughtInSunkenSea: Caught in the Sunken Sea +LocationTooltip: "'{0}'" // Astral Infection Catches AldebaranAlewife: {