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.
40 lines
1.4 KiB
C#
40 lines
1.4 KiB
C#
using Terraria.ID;
|
|
using Terraria.Localization;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Fishing
|
|
{
|
|
public abstract class BaseQuestFish : ModItem, ILocalizedModType
|
|
{
|
|
// The following two fields below are required.
|
|
// Condition(s) required for the fish to appear within the Angler quest pool. Defaults to no condition.
|
|
public virtual bool QuestCondition => true;
|
|
|
|
// Location where the fish is caught for purpose of tooltips and dialogues. Can be copied from other tooltips as needed.
|
|
public virtual LocalizedText Location => LocalizedText.Empty;
|
|
|
|
public new string LocalizationCategory => "Items.Fishing";
|
|
public override LocalizedText Tooltip => CalamityUtils.GetText($"Items.Fishing.LocationTooltip").WithFormatArgs(Location);
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
Item.ResearchUnlockCount = 2;
|
|
ItemID.Sets.CanBePlacedOnWeaponRacks[Type] = true;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Item.DefaultToQuestFish();
|
|
}
|
|
|
|
public override bool IsQuestFish() => true;
|
|
public override bool IsAnglerQuestAvailable() => QuestCondition;
|
|
|
|
public override void AnglerQuestChat(ref string description, ref string catchLocation)
|
|
{
|
|
description = this.GetLocalizedValue("QuestDescription");
|
|
catchLocation = Location.ToString();
|
|
}
|
|
}
|
|
}
|