-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathItemTooltips.cs
25 lines (23 loc) · 916 Bytes
/
ItemTooltips.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace WMITF
{
public class ItemTooltips : GlobalItem
{
public override void ModifyTooltips(Item item, List<TooltipLine> tooltips)
{
if (ModContent.GetInstance<Config>().DisplayItemTooltips && item.type != WMITF.unloadedItemType && (item.type != WMITF.aprilFoolsItemType || !WMITF.CheckAprilFools()))
{
if(item.ModItem != null && !item.Name.Contains("[" + item.ModItem.Mod.Name + "]") && !item.Name.Contains("[" + item.ModItem.Mod.DisplayName + "]"))
{
string text = ModContent.GetInstance<Config>().DisplayTechnicalNames ? (item.ModItem.Name + ":" + item.ModItem.Mod.Name) : item.ModItem.Mod.DisplayName;
TooltipLine line = new (Mod, "WMITF_" + Mod.Name, "[" + text + "]");
line.OverrideColor = Colors.RarityBlue;
tooltips.Add(line);
}
}
}
}
}