Ejemplo n.º 1
0
        public sealed override void ModifyTooltips(List <TooltipLine> tooltips)
        {
            if (tooltips.TryFindTooltipLine("ItemName", out TooltipLine itemNameLine))
            {
                // If this item is exclusive to e-mode, give it a custom item "rarity" (not an actual rarity, wait for 1.4).
                // This is often overridden.
                if (Eternity)
                {
                    itemNameLine.OverrideColor = FargowiltasSouls.EModeColor();
                }

                // Call the artcle-prefix adjustment method.
                // This automatically handles fixing item names that begin with an article.
                itemNameLine.ArticlePrefixAdjustment(Item.prefix, Articles.ToArray());
            }

            SafeModifyTooltips(tooltips);

            // Add the Eternity toolip after tooltip modification in order to be displayed underneath any manual tooltips (i.e. SoE cycling).
            if (Eternity)
            {
                tooltips.Add(new TooltipLine(Mod, $"{Mod.Name}:Eternity", Language.GetTextValue($"Mods.{Mod.Name}.Message.EternityItem")));
            }
        }
Ejemplo n.º 2
0
 public override bool PreDrawTooltipLine(DrawableTooltipLine line, ref int yOffset)
 {
     if (line.Mod == "Terraria" && line.Name == "ItemName")
     {
         Main.spriteBatch.End(); //end and begin main.spritebatch to apply a shader
         Main.spriteBatch.Begin(SpriteSortMode.Immediate, null, null, null, null, null, Main.UIScaleMatrix);
         var lineshader = GameShaders.Misc["PulseUpwards"].UseColor(new Color(42, 42, 99)).UseSecondaryColor(FargowiltasSouls.EModeColor());
         lineshader.Apply(null);
         Utils.DrawBorderString(Main.spriteBatch, line.Text, new Vector2(line.X, line.Y), Color.White, 1); //draw the tooltip manually
         Main.spriteBatch.End();                                                                           //then end and begin again to make remaining tooltip lines draw in the default way
         Main.spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, Main.UIScaleMatrix);
         return(false);
     }
     return(true);
 }