public override void ModifyTooltips(List<TooltipLine> tooltips) { TooltipLine line = new TooltipLine(mod, "Face", "I'm feeling just fine!"); line.overrideColor = new Color(100, 100, 255); tooltips.Add(line); foreach (TooltipLine line2 in tooltips) { if (line2.mod == "Terraria" && line2.Name == "ItemName") { line2.overrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); } } }
/// <summary> /// Creates a new DrawableTooltipLine object /// </summary> /// <param name="parent">The TooltipLine to make this DrawableTooltipLine from</param> /// <param name="index">The index of the line in the array</param> /// <param name="x">The X position where the tooltip would be drawn.</param> /// <param name="y">The Y position where the tooltip would be drawn.</param> /// <param name="color">The color the tooltip would be drawn in</param> public DrawableTooltipLine(TooltipLine parent, int index, int x, int y, Color color) : base(parent.mod, parent.Name, parent.text) { isModifier = parent.isModifier; isModifierBad = parent.isModifierBad; overrideColor = parent.overrideColor; oneDropLogo = parent.oneDropLogo; text = parent.text; this.index = index; OriginalX = x; OriginalY = y; this.Color = color; }
public override void ModifyTooltips(List<TooltipLine> tooltips) { tooltips[1] = new TooltipLine(mod, "equipline", "Equipable"); tooltips[2] = new TooltipLine(mod, "materialline", "Material"); tooltips[3] = new TooltipLine(mod, "defenseline", "8 defense"); }
public static void ModifyTooltips(Item item, ref int numTooltips, string[] names, ref string[] text, ref bool[] modifier, ref bool[] badModifier, ref int oneDropLogo, out Color?[] overrideColor) { List<TooltipLine> tooltips = new List<TooltipLine>(); for (int k = 0; k < numTooltips; k++) { TooltipLine tooltip = new TooltipLine(names[k], text[k]); tooltip.isModifier = modifier[k]; tooltip.isModifierBad = badModifier[k]; if (k == oneDropLogo) { tooltip.oneDropLogo = true; } tooltips.Add(tooltip); } if (IsModItem(item)) { item.modItem.ModifyTooltips(tooltips); } foreach (var hook in HookModifyTooltips) { hook(item, tooltips); } numTooltips = tooltips.Count; text = new string[numTooltips]; modifier = new bool[numTooltips]; badModifier = new bool[numTooltips]; oneDropLogo = -1; overrideColor = new Color?[numTooltips]; for (int k = 0; k < numTooltips; k++) { text[k] = tooltips[k].text; modifier[k] = tooltips[k].isModifier; badModifier[k] = tooltips[k].isModifierBad; if (tooltips[k].oneDropLogo) { oneDropLogo = k; } overrideColor[k] = tooltips[k].overrideColor; } }