/// <summary> /// Raises the tooltip event. /// </summary> /// <param name="show">If set to <c>true</c> show.</param> public override void OnTooltip(bool show) { if (show && this.IsAssigned()) { // Show the tooltip RnMUI_ItemSlot.ShowTooltip(this.itemInfo, this.iconSprite as UIWidget); // Prevent hide return; } else if (show && !this.IsAssigned()) { RnMUI_Tooltip.SetTitle(this.EquipTypeToString()); // Set the tooltip position RnMUI_Tooltip.SetPosition(this.iconSprite as UIWidget); // Show the tooltip RnMUI_Tooltip.Show(); // Prevent hide return; } // Default hide RnMUI_Tooltip.Hide(); }
/// <summary> /// Raises the tooltip event. /// </summary> /// <param name="show">If set to <c>true</c> show.</param> public override void OnTooltip(bool show) { if (show && this.IsAssigned()) { // Show the tooltip RnMUI_ItemSlot.ShowTooltip(this.itemInfo, this.iconSprite as UIWidget); // Prevent hide return; } // Default hide RnMUI_Tooltip.Hide(); }
/// <summary> /// Raises the tooltip event. /// </summary> /// <param name="show">If set to <c>true</c> show.</param> public override void OnTooltip(bool show) { if (show && this.IsAssigned()) { // Set the title and description RnMUI_Tooltip.SetTitle(this.spellInfo.Name); RnMUI_Tooltip.SetDescription(this.spellInfo.Description); if (this.spellInfo.Flags.Has(UISpellInfo_Flags.Passive)) { RnMUI_Tooltip.AddAttribute("Passive", ""); } else { // Power consumption if (this.spellInfo.PowerCost > 0f) { if (this.spellInfo.Flags.Has(UISpellInfo_Flags.PowerCostInPct)) { RnMUI_Tooltip.AddAttribute(this.spellInfo.PowerCost.ToString("0") + "%", " Energy"); } else { RnMUI_Tooltip.AddAttribute(this.spellInfo.PowerCost.ToString("0"), " Energy"); } } // Range if (this.spellInfo.Range > 0f) { if (this.spellInfo.Range == 1f) { RnMUI_Tooltip.AddAttribute("Melee range", ""); } else { RnMUI_Tooltip.AddAttribute(this.spellInfo.Range.ToString("0"), " yd range"); } } // Cast time if (this.spellInfo.CastTime == 0f) { RnMUI_Tooltip.AddAttribute("Instant", ""); } else { RnMUI_Tooltip.AddAttribute(this.spellInfo.CastTime.ToString("0.0"), " sec cast"); } // Cooldown if (this.spellInfo.Cooldown > 0f) { RnMUI_Tooltip.AddAttribute(this.spellInfo.Cooldown.ToString("0.0"), " sec cooldown"); } } // Set the tooltip position RnMUI_Tooltip.SetPosition(this.iconSprite as UIWidget); // Show the tooltip RnMUI_Tooltip.Show(); // Prevent hide return; } // Default hide RnMUI_Tooltip.Hide(); }