2 - Converted all lore items and Midas Prime to the new system, removing their own hold shift code. 3 - Moved point blank and charge tooltips above reforge stats so they look less out of place. 4 - Localized a few UI elements that weren't localized before. 5 - Removed the hold shift tooltip utility function because items can now become hold shift tooltip items on their own.
39 lines
1.4 KiB
C#
39 lines
1.4 KiB
C#
using Microsoft.Xna.Framework;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.LoreItems
|
|
{
|
|
public abstract class LoreItem : ModItem, ILocalizedModType, IHoldShiftTooltipItem
|
|
{
|
|
public new string LocalizationCategory => "Items.Lore";
|
|
|
|
// When holding SHIFT on a lore item, the default tooltip is removed entirely.
|
|
public bool HidesNormalTooltip => true;
|
|
|
|
// Lore items have a flavorful extension indicator tooltip.
|
|
public string ExtensionIndicatorKey => $"{LocalizationCategory}.ShortTooltip";
|
|
|
|
// Each line of the extension indicator tooltip is manually colored, so don't provide an override color.
|
|
public Color? ExtensionIndicatorColor => null;
|
|
|
|
// The localization key for all lore items' full lore content is just "Lore".
|
|
public string TooltipExtensionKey => "Lore";
|
|
|
|
public override void SetStaticDefaults()
|
|
{
|
|
ItemID.Sets.ItemNoGravity[Item.type] = true;
|
|
}
|
|
|
|
public override bool CanUseItem(Player player) => false;
|
|
|
|
public override Color? GetAlpha(Color lightColor) => Color.White;
|
|
|
|
public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup)
|
|
{
|
|
itemGroup = (ContentSamples.CreativeHelper.ItemGroup)CalamityResearchSorting.LoreItems;
|
|
}
|
|
}
|
|
}
|