/// <summary> /// Prepares the tooltip with the specified item info. /// </summary> /// <param name="itemInfo">Item info.</param> public static void PrepareTooltip(UIItemInfo itemInfo) { if (itemInfo == null) { return; } // Set the title and description UITooltip.AddTitle("<color=#" + UIItemQualityColor.GetHexColor(itemInfo.Quality) + ">" + itemInfo.Name + "</color>"); // Spacer UITooltip.AddSpacer(); // Item types UITooltip.AddLineColumn(itemInfo.Type, "ItemAttribute"); UITooltip.AddLineColumn(itemInfo.Subtype, "ItemAttribute"); if (itemInfo.ItemType == 1) { UITooltip.AddLineColumn(itemInfo.Damage.ToString() + " Damage", "ItemAttribute"); UITooltip.AddLineColumn(itemInfo.AttackSpeed.ToString("0.0") + " Attack speed", "ItemAttribute"); UITooltip.AddLine("(" + ((float)itemInfo.Damage / itemInfo.AttackSpeed).ToString("0.0") + " damage per second)", "ItemAttribute"); } else { UITooltip.AddLineColumn(itemInfo.Armor.ToString() + " Armor", "ItemAttribute"); UITooltip.AddLineColumn(itemInfo.Block.ToString() + " Block", "ItemAttribute"); } UITooltip.AddSpacer(); UITooltip.AddLine("+" + itemInfo.Stamina.ToString() + " Stamina", "ItemStat"); UITooltip.AddLine("+" + itemInfo.Strength.ToString() + " Strength", "ItemStat"); // Set the item description if not empty if (!string.IsNullOrEmpty(itemInfo.Description)) { UITooltip.AddSpacer(); UITooltip.AddLine(itemInfo.Description, "ItemDescription"); } }
/// <summary> /// Prepares the tooltip with the specified item info. /// </summary> /// <param name="itemInfo">Item info.</param> public static void PrepareTooltip(UIItemInfo itemInfo) { if (itemInfo == null) { return; } // Set the title and description UITooltip.AddTitle(itemInfo.Name); // Item types UITooltip.AddLineColumn(itemInfo.Type); UITooltip.AddLineColumn(itemInfo.Subtype); if (itemInfo.ItemType == 1) { UITooltip.AddLineColumn(itemInfo.Damage.ToString() + " Damage"); UITooltip.AddLineColumn(itemInfo.AttackSpeed.ToString("0.0") + " Attack speed"); UITooltip.AddLine("(" + ((float)itemInfo.Damage / itemInfo.AttackSpeed).ToString("0.0") + " damage per second)"); } else { UITooltip.AddLineColumn(itemInfo.Block.ToString() + " Block"); UITooltip.AddLineColumn(itemInfo.Armor.ToString() + " Armor"); } UITooltip.AddLine("<color=#008000ff>+" + itemInfo.Stamina.ToString() + " Stamina</color>", new RectOffset(0, 0, 6, 0)); UITooltip.AddLine("<color=#008000ff>+" + itemInfo.Strength.ToString() + " Strength</color>"); // Set the item description if not empty if (!string.IsNullOrEmpty(itemInfo.Description)) { UITooltip.AddDescription(itemInfo.Description); } }
public static void PrepareTooltip(UISpellInfo spellInfo) { // Make sure we have spell info, otherwise game might crash if (spellInfo == null) { return; } // Set the spell name as title UITooltip.AddTitle(spellInfo.Name); // Prepare some attributes if (spellInfo.Flags.Has(UISpellInfo_Flags.Passive)) { UITooltip.AddLine("Passive"); } else { // Power consumption if (spellInfo.PowerCost > 0f) { if (spellInfo.Flags.Has(UISpellInfo_Flags.PowerCostInPct)) { UITooltip.AddLineColumn(spellInfo.PowerCost.ToString("0") + "% Energy"); } else { UITooltip.AddLineColumn(spellInfo.PowerCost.ToString("0") + " Energy"); } } // Range if (spellInfo.Range > 0f) { if (spellInfo.Range == 1f) { UITooltip.AddLineColumn("Melee range"); } else { UITooltip.AddLineColumn(spellInfo.Range.ToString("0") + " yd range"); } } // Cast time if (spellInfo.CastTime == 0f) { UITooltip.AddLineColumn("Instant"); } else { UITooltip.AddLineColumn(spellInfo.CastTime.ToString("0.0") + " sec cast"); } // Cooldown if (spellInfo.Cooldown > 0f) { UITooltip.AddLineColumn(spellInfo.Cooldown.ToString("0.0") + " sec cooldown"); } } // Set the spell description if not empty if (!string.IsNullOrEmpty(spellInfo.Description)) { UITooltip.AddDescription(spellInfo.Description); } }
/* * Function: PrepareTooltip * Prepares the tooltip with the specified item info. * All infomation are saved in iteminfodatabase. if the specific atrribute is 0, then it will not show up in tooltip panel * Parameter: itemInfo - UIItemInfo object */ public static void PrepareTooltip(UIItemInfo itemInfo) { if (itemInfo == null) { return; } // Set the title and description UITooltip.AddTitle(itemInfo.Name); UITooltip.AddLine(""); // Item types UITooltip.AddLineColumn(itemInfo.Type); UITooltip.AddLineColumn(itemInfo.Subtype); /*if (itemInfo.ItemType == 1) * { * UITooltip.AddLineColumn(itemInfo.Damage.ToString() + " Damage"); * UITooltip.AddLineColumn(itemInfo.AttackSpeed.ToString("0.0") + " Attack speed"); * * UITooltip.AddLine("(" + ((float)itemInfo.Damage / itemInfo.AttackSpeed).ToString("0.0") + " damage per second)"); * } * else * { * UITooltip.AddLineColumn(itemInfo.Block.ToString() + " Block"); * UITooltip.AddLineColumn(itemInfo.Armor.ToString() + " Armor"); * } * * UITooltip.AddLine("+" + itemInfo.Stamina.ToString() + " Stamina", new RectOffset(0, 0, 6, 0)); * UITooltip.AddLine("+" + itemInfo.Strength.ToString() + " Strength"); */ if (itemInfo.weight != 0) { UITooltip.AddLineColumn("Weight:" + itemInfo.weight.ToString()); UITooltip.AddLine(""); } if (itemInfo.gemSlot != 0) { UITooltip.AddLine("<color=#db81fc>" + (itemInfo.gemSlot == 1 ? "FlameStrike GEM" : "Rageful Laser GEM") + "</color>"); } if (itemInfo.Damage != 0) { UITooltip.AddLineColumn("<color=#fee95e>AttackPower:</color>"); UITooltip.AddLineColumn("<color=#00ff00> + " + itemInfo.Damage.ToString() + "</color>"); } if (itemInfo.Cooldown != 0) { UITooltip.AddLineColumn("<color=#fee95e>CoolingDown:</color>"); UITooltip.AddLineColumn("<color=#00ff00> + " + itemInfo.Cooldown.ToString() + "</color>"); } if (itemInfo.Lifesteal != 0) { UITooltip.AddLineColumn("<color=#fee95e>Life Steal:</color>"); UITooltip.AddLineColumn("<color=#00ff00> + " + itemInfo.Lifesteal.ToString() + "</color>"); } if (itemInfo.Range != 0) { UITooltip.AddLineColumn("<color=#fee95e>Skill Range:</color>"); UITooltip.AddLineColumn("<color=#00ff00> + " + itemInfo.Range.ToString() + "</color>"); } if (itemInfo.RageGen != 0) { UITooltip.AddLineColumn("<color=#fee95e>Rage generation:</color>"); UITooltip.AddLineColumn("<color=#00ff00> + " + itemInfo.RageGen.ToString() + "</color>"); } if (itemInfo.Radius != 0) { UITooltip.AddLineColumn("<color=#fee95e>Radius:</color>"); UITooltip.AddLineColumn("<color=#00ff00> + " + itemInfo.Radius.ToString() + "</color>"); } if (itemInfo.LastTime != 0) { UITooltip.AddLineColumn("<color=#fee95e>Last Time:</color>"); UITooltip.AddLineColumn("<color=#00ff00> + " + itemInfo.LastTime.ToString() + "</color>"); } if (itemInfo.Stamina != 0) { UITooltip.AddLineColumn("<color=#fee95e>Health:</color>"); UITooltip.AddLineColumn("<color=#00ff00> + " + itemInfo.Stamina.ToString() + "</color>"); } if (itemInfo.Armor != 0) { UITooltip.AddLineColumn("<color=#fee95e>Armor:</color>"); UITooltip.AddLineColumn("<color=#00ff00> + " + itemInfo.Armor.ToString() + "</color>"); } // Set the item description if not empty if (!string.IsNullOrEmpty(itemInfo.Description)) { UITooltip.AddDescription(itemInfo.Description); } UITooltip.AddLineColumn(""); UITooltip.AddLineColumn("<color=#fee95e>Sell: " + itemInfo.price.ToString() + "</color>"); }