From f96c3d290a915913664cdaf396ac84fe97ea85c3 Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Tue, 17 Sep 2024 01:53:35 -0400 Subject: [PATCH] Added LegendaryItem base class for extended tooltips --- Items/LegendaryItem.cs | 18 ++++++++++++++++++ .../en-US/Mods.CalamityMod.Items.Misc.hjson | 5 +++++ 2 files changed, 23 insertions(+) create mode 100644 Items/LegendaryItem.cs diff --git a/Items/LegendaryItem.cs b/Items/LegendaryItem.cs new file mode 100644 index 0000000000..0b0024fe72 --- /dev/null +++ b/Items/LegendaryItem.cs @@ -0,0 +1,18 @@ +using Microsoft.Xna.Framework; +using Terraria.ModLoader; + +namespace CalamityMod.Items +{ + // Since all legendary items do not use the same localization category, ILocalizedModType must be placed on each individual item file. + public abstract class LegendaryItem : ModItem, IHoldShiftTooltipItem + { + // All legendary items use the same extension indicator tooltip. + // This is given a null color, as it is colored manually. + public string ExtensionIndicatorKey => "Items.Misc.LegendaryShortTooltip"; + public Color? ExtensionIndicatorColor => null; + + // All full flavor tooltips use the same localization key. + // Unfortunately, as full tooltip color is different for each item, it must be set manually. + public string TooltipExtensionKey => "LegendaryText"; + } +} diff --git a/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson index 09d62b1f95..4917867a0e 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson @@ -326,6 +326,11 @@ ExhumeShortTooltip: [c/C61B40:'Ah, are you curious what I saw within this item?'] [c/BABABA:Press "Left Shift" to listen] ''' +LegendaryShortTooltip: + ''' + [c/FF6F00:Tales of legends past radiate around you...] + [c/BABABA:Press "Left Shift" to listen closer] + ''' AlicornonaStick: { DisplayName: Alicorn on a Stick