示例#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 = Fargowiltas.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", "Eternity"));
            }
        }
 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(Fargowiltas.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);
 }