UIItemSlot.OnTooltip C# (CSharp) Method

OnTooltip() public method

Show a tooltip for the item.
public OnTooltip ( bool show ) : void
show bool
return void
    void OnTooltip(bool show)
    {
        InvGameItem item = show ? mItem : null;

        if (item != null)
        {
            InvBaseItem bi = item.baseItem;

            if (bi != null)
            {
                string t = "[" + NGUITools.EncodeColor(item.color) + "]" + bi.name + "[-]\n";

                //t += "[AFAFAF]" + bi.slot + "[-]\n";

                if (!string.IsNullOrEmpty(bi.description)) t += "[FF9900]" + bi.description;
                UITooltip.ShowText(t);
                return;
            }
        }
        UITooltip.ShowText(null);
    }