//NGUI OnTooltip Event
 void OnTooltip(bool show)
 {
     if (show)
     {
         if (ActionBarCursor.Instance.ButtonInfo == null)
         {
             string Tip;
             if (Info != null)
             {
                 Tip  = "Display Tooltip for this Button's Skill or Item here!" + "\n";
                 Tip += "\n" + "Name: " + Info.Icon;
                 if (Info.Stackable)
                 {
                     Tip += "\n" + "Number of Stacks: " + Info.Stack;
                 }
                 Tip += "\n" + "Cooldown: " + Info.CooldownAmount;
                 if (Info.OnCooldown == true)
                 {
                     Tip += "\n" + "Cooldown Remaining: " + Mathf.Round((Info.CooldownRemaining)).ToString();
                 }
             }
             else
             {
                 Tip = "Empty Button";
             }
             UITooltip.ShowText(Tip);
             return;
         }
     }
     UITooltip.ShowText(null);
 }
Exemple #2
0
    void SetText(string content)
    {
        if (null != content)
        {
            mContent.text = content;
            mLine.gameObject.SetActive(true);
            if (content.Contains("[meat]"))
            {
//				mMeat.gameObject.SetActive(true);
//				string[] strlist = mContent.processedText.Split('\n');
//				for(int i=0 ; i<strlist.Length ; i++)
//				{
//					if(strlist[i].Contains("[meat]"))
//					{
//						mMeat.transform.localPosition = new Vector3(mContent.font.CalculatePrintedSize(strlist[i].Replace("[meat]","")
//							, true,UIFont.SymbolStyle.None).x * mContent.font.size + mContent.transform.localPosition.x-6
//							, -mContent.font.size * i + mContent.transform.localPosition.y,-1f);
//						break;
//					}
//				}
                mContent.text = content.Replace("[meat]", "");
            }
//			else
//				mMeat.gameObject.SetActive(false);
            UITooltip.ShowText(mContent.text);
        }
        else
        {
            mMeat.gameObject.SetActive(false);
            mLine.gameObject.SetActive(false);
            UITooltip.ShowText(content);
        }
    }
Exemple #3
0
    public virtual void showTooltip()
    {
        string tText = "[FFFF00]" + eName + "[-]\n";

        tText += "[D1D1D1]'" + eDescription + "'[-]";
        UITooltip.ShowText(tText);
    }
Exemple #4
0
 void Update()
 {
     if (Input.GetButtonDown("Fire1"))
     {
         UITooltip.ShowText("");
     }
 }
Exemple #5
0
 public void ShowTooltip(GameObject obj, bool bShow)
 {
     if (null == obj && !bShow)
     {
         UITooltip.ShowText(string.Empty);
     }
 }
Exemple #6
0
    void OnTooltip(bool show)
    {
        Debug.Log("Tool Tip " + show);

        if (show && key != null)
        {
            string t = StringData.getString(key);

            if (name != null)
            {
                t = t.Replace("%s", name.text);
            }

            if (isDisableCheck != null && isDisableCheck.gameObject.activeSelf)
            {
                UITooltip.ShowText(null);
                return;
            }

            UITooltip.ShowText(t);
            return;
        }
        else
        {
            UITooltip.ShowText(null);
        }
    }
Exemple #7
0
 void OnTooltip(bool show)
 {
     if (show)
     {
         UITooltip.ShowText(hoverText);
     }
     else
     {
         UITooltip.ShowText(null);
     }
 }
 private void DelBtnClick(GameObject go)
 {
     if (null != DelEvent)
     {
         DelEvent(ID);
         if (m_ToolTipIsHover)
         {
             UITooltip.ShowText(null);
         }
     }
 }
Exemple #9
0
 void OnTooltip(bool show)
 {
     if (show)
     {
         UITooltip.ShowText(furnishInfo.desc);
     }
     else
     {
         UITooltip.ShowText(null);
     }
 }
Exemple #10
0
 void OnTooltip(bool show)
 {
     if (show)
     {
         UITooltip.ShowText("Hire this person");
     }
     else
     {
         UITooltip.ShowText(null);
     }
 }
 void OnTooltip(bool active)
 {
     if (!active)
     {
         UITooltip.ShowText(null);
     }
     if (active && _describe != null)
     {
         UITooltip.ShowText(_describe);
     }
 }
 void OnTooltip(bool show)
 {
     if (show)
     {
         UITooltip.ShowText("highscore");
     }
     else
     {
         UITooltip.ShowText(null);
     }
     return;
 }
Exemple #13
0
 //Called when a Tooltip event is triggered on this object
 void OnTooltip(bool state)
 {
     //If state is true, create a new Tooltip depending on the type
     if (state)
     {
         UITooltip.ShowText(Localization.Get(type.ToString() + "Tooltip"));
     }
     //If state is false, hide tooltip by setting an empty string
     else
     {
         UITooltip.ShowText("");
     }
 }
Exemple #14
0
    void OnClick()
    {
        string tooltipMessage;

        tooltipMessage  = "$gold " + GameController.instance.gold;
        tooltipMessage += " $grudge " + GameController.instance.grudge;
        tooltipMessage += " $level " + GameController.instance.level;
        tooltipMessage += " $unit " + GameController.instance.units + "/" + GameController.instance.maxUnits;
        tooltipMessage += "\n-------------------------------\n";
        tooltipMessage += "$tp " + GameController.instance.talentPoints;
        tooltipMessage += " $exp " + GameController.instance.experience + "/" + GameController.instance.expRequired;
        UITooltip.ShowText(tooltipMessage);
    }
    private void UpdateToolTip(IsoUploadInfoWndCtrl.UploadState step)
    {
        int tipID = GetTipIDByStep(step);

        if (-1 != tipID)
        {
            m_ShowToolTipItem.mStrID = tipID;
            if (m_ToolTipIsHover)
            {
                UITooltip.ShowText(PELocalization.GetString(tipID));
            }
        }
    }
Exemple #16
0
    /// <summary>
    /// Show a tooltip for the item.
    /// </summary>

    void OnTooltip(bool show)
    {
        InvGameItem item = show ? mItem : null;

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

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

                t += "[AFAFAF]Level " + item.itemLevel + " " + bi.slot;

                List <InvStat> stats = item.CalculateStats();

                for (int i = 0, imax = stats.Count; i < imax; ++i)
                {
                    InvStat stat = stats[i];
                    if (stat.amount == 0)
                    {
                        continue;
                    }

                    if (stat.amount < 0)
                    {
                        t += "\n[FF0000]" + stat.amount;
                    }
                    else
                    {
                        t += "\n[00FF00]+" + stat.amount;
                    }

                    if (stat.modifier == InvStat.Modifier.Percent)
                    {
                        t += "%";
                    }
                    t += " " + stat.id;
                    t += "[-]";
                }

                if (!string.IsNullOrEmpty(bi.description))
                {
                    t += "\n[FF9900]" + bi.description;
                }
                UITooltip.ShowText(t);
                return;
            }
        }
        UITooltip.ShowText(null);
    }
        public void ShowTips(ItemInfo itemVo)
        {
            mItem = itemVo;
            if (!bInited)
            {
                return;
            }
            string str = "";

            str += itemVo.Name + "\n";
            str += itemVo.Tips;
            UITooltip.ShowText(str);
            Front();
        }
Exemple #18
0
    private void OnTooltip(bool show)
    {
        var item     = !show ? null : mItem;
        var baseItem = item?.baseItem;

        if (baseItem != null)
        {
            string[] textArray1  = { "[", NGUITools.EncodeColor(item.color), "]", item.name, "[-]\n" };
            var      str2        = string.Concat(textArray1);
            object[] objArray1   = { str2, "[AFAFAF]Level ", item.itemLevel, " ", baseItem.slot };
            var      tooltipText = string.Concat(objArray1);
            var      list        = item.CalculateStats();
            var      num         = 0;
            var      count       = list.Count;
            while (num < count)
            {
                var stat = list[num];
                if (stat.amount != 0)
                {
                    if (stat.amount < 0)
                    {
                        tooltipText = tooltipText + "\n[FF0000]" + stat.amount;
                    }
                    else
                    {
                        tooltipText = tooltipText + "\n[00FF00]+" + stat.amount;
                    }

                    if (stat.modifier == InvStat.Modifier.Percent)
                    {
                        tooltipText = tooltipText + "%";
                    }

                    tooltipText = tooltipText + " " + stat.id + "[-]";
                }

                num++;
            }

            if (!string.IsNullOrEmpty(baseItem.description))
            {
                tooltipText = tooltipText + "\n[FF9900]" + baseItem.description;
            }

            UITooltip.ShowText(tooltipText);
            return;
        }

        UITooltip.ShowText(null);
    }
Exemple #19
0
 void OnTooltip(bool show)
 {
     if (0 != mStrID)
     {
         UITooltip.ShowText(PELocalization.GetString(mStrID));
         return;
     }
     else if (mTipContent != "")
     {
         UITooltip.ShowText(mTipContent);
         return;
     }
     UITooltip.ShowText(null);
 }
    void OnTooltip(bool show)
    {
        if (!show)
        {
            UITooltip.ShowText(null);
            return;
        }

        if (string.IsNullOrEmpty(_tooltipText))
        {
            return;
        }

        UITooltip.ShowText(_tooltipText);
    }
Exemple #21
0
        private void OnTooltip(bool show)
        {
            return;

            if (show == true)
            {
                if (ToolTip != null)
                {
                    UITooltip.ShowText(ToolTip);
                }
            }
            else
            {
                UITooltip.ShowText(null);
            }
        }
Exemple #22
0
    private void OnTooltip(bool show)
    {
        InvGameItem item = !show ? null : this.mItem;

        if (item != null)
        {
            InvBaseItem baseItem = item.baseItem;
            if (baseItem != null)
            {
                string         str         = "[" + NGUITools.EncodeColor(item.color) + "]" + item.name + "[-]\n";
                string         tooltipText = string.Concat(new object[] { str, "[AFAFAF]Level ", item.itemLevel, " ", baseItem.slot });
                List <InvStat> list        = item.CalculateStats();
                int            num         = 0;
                int            count       = list.Count;
                while (num < count)
                {
                    InvStat stat = list[num];
                    if (stat.amount != 0)
                    {
                        if (stat.amount < 0)
                        {
                            tooltipText = tooltipText + "\n[FF0000]" + stat.amount;
                        }
                        else
                        {
                            tooltipText = tooltipText + "\n[00FF00]+" + stat.amount;
                        }
                        if (stat.modifier == InvStat.Modifier.Percent)
                        {
                            tooltipText = tooltipText + "%";
                        }
                        tooltipText = string.Concat(new object[] { tooltipText, " ", stat.id, "[-]" });
                    }
                    num++;
                }
                if (!string.IsNullOrEmpty(baseItem.description))
                {
                    tooltipText = tooltipText + "\n[FF9900]" + baseItem.description;
                }
                UITooltip.ShowText(tooltipText);
                return;
            }
        }
        UITooltip.ShowText(null);
    }
Exemple #23
0
    void onHoldDown()
    {
        string tooltip = "[2FC9DE]" + talent.name + "[-]\n";

        if (!talent.active && !window.checkRequisite(talent.slotIndex))
        {
            tooltip += "[FF0000]Requires prerequisite talent to be activated.[-]\n";
        }
        else if (!talent.active && GameController.instance.talentPoints == 0)
        {
            tooltip += "[FF0000]Not enough $tp.[-]\n";
        }
        else if (!talent.active)
        {
            tooltip += "[6BC963]Activate talent by paying $tp 1.[-]\n";
        }
        tooltip += talent.description;
        UITooltip.ShowText(tooltip);
    }
Exemple #24
0
 void OnItemToolTip(bool show, UIBuildWndItem.ItemType item_type, int item_index)
 {
     if (item_type == UIBuildWndItem.ItemType.mVoxelMat)
     {
         ItemProto proto = ItemProto.Mgr.Instance.Get(m_VoxelProtoItems[item_index]);
         UITooltip.ShowText(proto.GetName());
     }
     else if (item_type == UIBuildWndItem.ItemType.mBlockMat)
     {
         ItemProto proto = ItemProto.Mgr.Instance.Get(m_BlockProtoItems[item_index]);
         UITooltip.ShowText(proto.GetName());
     }
     else if (item_type == UIBuildWndItem.ItemType.mMenu)
     {
         UIBuildWndItem item = mMenuCtrl.mBoxBars.Items[item_index].GetComponent <UIBuildWndItem>();
         if (item != null)
         {
             if (item.mTargetItemType == UIBuildWndItem.ItemType.mVoxelMat)
             {
                 ItemProto proto = ItemProto.Mgr.Instance.Get(m_VoxelProtoItems[item.mTargetIndex]);
                 UITooltip.ShowText(proto.GetName());
             }
             else if (item.mTargetItemType == UIBuildWndItem.ItemType.mBlockMat)
             {
                 ItemProto proto = ItemProto.Mgr.Instance.Get(m_BlockProtoItems[item.mTargetIndex]);
                 UITooltip.ShowText(proto.GetName());
             }
             else if (item.mTargetItemType == UIBuildWndItem.ItemType.mVoxelType)
             {
                 int       proto_id = BSVoxelMatMap.GetItemID(item.ItemId);
                 ItemProto proto    = ItemProto.Mgr.Instance.Get(proto_id);
                 UITooltip.ShowText(proto.GetName());
             }
         }
     }
     else if (item_type == UIBuildWndItem.ItemType.mVoxelType)
     {
         int       proto_id = BSVoxelMatMap.GetItemID(m_VoxelTypeList[item_index]);
         ItemProto proto    = ItemProto.Mgr.Instance.Get(proto_id);
         UITooltip.ShowText(proto.GetName());
     }
 }
 void Start()
 {
     //lz-2016.06.30 套装按钮注册悬浮提示
     if (mSuiteBtns != null && mSuiteBtns.Count > 0)
     {
         for (int i = 0; i < mSuiteBtns.Count; i++)
         {
             UIEventListener.Get(mSuiteBtns[i].gameObject).onHover += (go, hover) => {
                 if (hover)
                 {
                     UITooltip.ShowText(PELocalization.GetString(8000542) + (mSuiteBtns.FindIndex(a => a.gameObject == go) + 1).ToString());
                 }
                 else
                 {
                     UITooltip.ShowText("");
                 }
             };
         }
     }
 }
Exemple #26
0
    public override void showTooltip()
    {
        string tText = "[CFCC29]" + eName + "[-]\n";

        tText += "Attack: " + attackPower + "\n";
        tText += "Defense: " + defence + "\n";
        tText += "Crit Chance: " + critChance + "%\n";
        tText += "[CFCFCF]'" + eDescription + "'[-]\n";
        tText += "\n";
        tText += "Carries: $gold " + carriedGold + " $exp " + experience;

        foreach (Spell spell in GetComponents <Spell>())
        {
            if (spell.enabled)
            {
                tText += "\n\n";
                tText += spell.tooltipMessage();
            }
        }

        UITooltip.ShowText(tText);
    }
Exemple #27
0
    public override void showTooltip()
    {
        string tText = "[CF2945]" + eName + "[-]\n";

        tText += "[E6E477]'" + eDescription + "'[-]\n";
        tText += "Health: " + getMod_health() + "\n";
        tText += "Mana: " + getMod_mana() + "\n";
        tText += "Attack: " + getMod_attackPower() + "\n";
        tText += "Defense: " + getMod_defence() + "\n";
        tText += "Crit Chance: " + getMod_critChance() + "%\n";
        tText += "\n";
        if (GameController.instance.grudge >= grudgeCost)
        {
            tText += "[77E677]";
        }
        else
        {
            tText += "[ED1818]";
        }
        tText += "$grudge " + getMod_grudgeCost() + "[-]";
        UITooltip.ShowText(tText);
    }
Exemple #28
0
    public override void showTooltip()
    {
        string tText = "[CF2945]" + eName + "[-]\n";

        tText += "[E6E477]'" + eDescription + "'[-]\n";
        tText += "Health: " + health + "\n";
        tText += "Mana: " + mana + "\n";
        tText += "Attack: " + attackPower + "\n";
        tText += "Defense: " + defence + "\n";
        tText += "Crit Chance: " + critChance + "%\n";
        C_Boss boss = GetComponent <C_Boss>();

        for (int i = 0; i < 5; i++)
        {
            if (boss.abilities[i] != null)
            {
                tText += "\n";
                tText += boss.abilities[i].tooltipMessageMock();
            }
        }
        UITooltip.ShowText(tText);
    }
Exemple #29
0
    private void OnTooltip(bool show)
    {
        InvGameItem invGameItem = (!show) ? null : mItem;

        if (invGameItem != null)
        {
            InvBaseItem baseItem = invGameItem.baseItem;
            if (baseItem != null)
            {
                string text  = "[" + NGUITools.EncodeColor(invGameItem.color) + "]" + invGameItem.name + "[-]\n";
                string text2 = text;
                text = text2 + "[AFAFAF]Level " + invGameItem.itemLevel + " " + baseItem.slot;
                List <InvStat> list = invGameItem.CalculateStats();
                int            i    = 0;
                for (int count = list.Count; i < count; i++)
                {
                    InvStat invStat = list[i];
                    if (invStat.amount != 0)
                    {
                        text = ((invStat.amount >= 0) ? (text + "\n[00FF00]+" + invStat.amount) : (text + "\n[FF0000]" + invStat.amount));
                        if (invStat.modifier == InvStat.Modifier.Percent)
                        {
                            text += "%";
                        }
                        text  = text + " " + invStat.id;
                        text += "[-]";
                    }
                }
                if (!string.IsNullOrEmpty(baseItem.description))
                {
                    text = text + "\n[FF9900]" + baseItem.description;
                }
                UITooltip.ShowText(text);
                return;
            }
        }
        UITooltip.ShowText(null);
    }
Exemple #30
0
 void OnHover()
 {
     UITooltip.ShowText("");
 }