Beispiel #1
0
        public override void ModifyTooltips(List <TooltipLine> tooltips)
        {
            foreach (TooltipLine line in tooltips)
            {
                if (line.Name == "ItemName" && line.mod == "Terraria")
                {
                    line.text = GunHelper.GetToolName(parts) + " " + itemType;
                }
            }

            string effectsText = "";

            foreach (KeyValuePair <string, int> pair in effects)
            {
                EffectType effectType = GunHelper.GetEffectType(pair.Key);
                if (effectsText != "")
                {
                    effectsText += "\n";
                }

                effectsText += $"{effectType.name}";
                if (effectType.showLevel)
                {
                    effectsText += $" Level {pair.Value}";
                }
                if (Main.keyState.PressingShift())
                {
                    effectsText += $": {effectType.desc}";
                }
            }
            tooltips.Add(new TooltipLine(mod, "TerrariaConstruct:EffectsLine", effectsText));
            if (!Main.keyState.PressingShift() && effects.Count > 0)
            {
                tooltips.Add(new TooltipLine(mod, "TerrariaConstruct:ShiftMessageLine", "Press Shift to see descriptions!"));
            }

            if (GunHelper.CheckForBrokenParts(parts))
            {
                tooltips.Add(new TooltipLine(mod, "TerrariaConstruct:BrokenPartsLine", "This tool has broken parts! Did you disable a mod since you last played?"));
            }

            tooltips.Add(new TooltipLine(mod, "h", "Damage = " + GunHelper.DamageFromParts(parts)));
        }
Beispiel #2
0
 public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
 {
     item.SetNameOverride(GunHelper.GetToolName(parts) + " " + itemType);
     return(false);
 }
Beispiel #3
0
 public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
 {
     item.SetNameOverride(GunHelper.GetToolName(parts) + " " + itemType);
     return(false);
 }