Esempio n. 1
0
        /// <summary>
        /// Raises the tooltip event.
        /// </summary>
        /// <param name="show">If set to <c>true</c> show.</param>
        public override void OnTooltip(bool show)
        {
            // Make sure we have spell info, otherwise game might crash
            if (this.m_SpellInfo == null)
            {
                return;
            }

            // If we are showing the tooltip
            if (show)
            {
                // Prepare the tooltip lines
                UISpellSlot.PrepareTooltip(this.m_SpellInfo);

                // Anchor to this slot
                UITooltip.AnchorToRect(this.transform as RectTransform);

                // Show the tooltip
                UITooltip.Show();
            }
            else
            {
                // Hide the tooltip
                UITooltip.Hide();
            }
        }
        /// <summary>
        /// Raises the tooltip event.
        /// </summary>
        /// <param name="show">If set to <c>true</c> show.</param>
        public override void OnTooltip(bool show)
        {
            // Make sure we have spell info, otherwise game might crash
            if (this.m_ItemInfo == null)
            {
                return;
            }

            // If we are showing the tooltip
            if (show)
            {
                UITooltip.InstantiateIfNecessary(this.gameObject);

                // Prepare the tooltip
                UIItemSlot.PrepareTooltip(this.m_ItemInfo);

                // Anchor to this slot
                UITooltip.AnchorToRect(this.transform as RectTransform);

                // Show the tooltip
                UITooltip.Show();
            }
            else
            {
                // Hide the tooltip
                UITooltip.Hide();
            }
        }
        /// <summary>
        /// Raises the tooltip event.
        /// </summary>
        /// <param name="show">If set to <c>true</c> show.</param>
        public virtual void OnTooltip(bool show)
        {
            if (!this.enabled || !this.IsActive())
            {
                return;
            }

            UITooltip.InstantiateIfNecessary(this.gameObject);

            // If we are showing the tooltip
            if (show)
            {
                // Set the title if not empty
                if (!string.IsNullOrEmpty(this.m_Title))
                {
                    UITooltip.AddTitle(this.m_Title);
                }

                // Spacer
                if (!string.IsNullOrEmpty(this.m_Title) && !string.IsNullOrEmpty(this.m_Description))
                {
                    UITooltip.AddSpacer();
                }

                // Set description if not empty
                if (!string.IsNullOrEmpty(this.m_Description))
                {
                    UITooltip.AddDescription(this.m_Description);
                }

                // Anchor to this slot
                if (this.m_Position == Position.Anchored)
                {
                    UITooltip.AnchorToRect(this.transform as RectTransform);
                }

                // Show the tooltip
                UITooltip.Show();
            }
            else
            {
                // Hide the tooltip
                UITooltip.Hide();
            }
        }
        /// <summary>
        /// Raises the tooltip event.
        /// </summary>
        /// <param name="show">If set to <c>true</c> show.</param>
        public override void OnTooltip(bool show)
        {
            UITooltip.InstantiateIfNecessary(this.gameObject);

            // Handle unassigned
            if (!this.IsAssigned())
            {
                // If we are showing the tooltip
                if (show)
                {
                    UITooltip.AddTitle(UIEquipSlot.EquipTypeToString(this.m_EquipType));
                    UITooltip.SetHorizontalFitMode(ContentSizeFitter.FitMode.PreferredSize);
                    UITooltip.AnchorToRect(this.transform as RectTransform);
                    UITooltip.Show();
                }
                else
                {
                    UITooltip.Hide();
                }
            }
            else
            {
                // Make sure we have spell info, otherwise game might crash
                if (this.m_ItemInfo == null)
                {
                    return;
                }

                // If we are showing the tooltip
                if (show)
                {
                    UIItemSlot.PrepareTooltip(this.m_ItemInfo);
                    UITooltip.AnchorToRect(this.transform as RectTransform);
                    UITooltip.Show();
                }
                else
                {
                    UITooltip.Hide();
                }
            }
        }