Ejemplo n.º 1
0
 protected override void OnEnable()
 {
     base.OnEnable ();
     current = this;
     canvas = GetComponentInParent<Canvas> ();
     base.Close ();
 }
Ejemplo n.º 2
0
 void OnTooltip(bool show)
 {
     if (show)
     {
         UITooltip.ShowText(roomInfo.desc);
     }
     else
     {
         UITooltip.ShowText(null);
     }
 }
Ejemplo n.º 3
0
    // Token: 0x06000631 RID: 1585 RVA: 0x00034D10 File Offset: 0x00032F10
    private void FillList()
    {
        int playerCoins = this.GetPlayerCoins();
        int num         = this.GetSelectedItemIndex();
        List <Trader.TradeItem> items = this.m_trader.m_items;

        foreach (GameObject obj in this.m_itemList)
        {
            UnityEngine.Object.Destroy(obj);
        }
        this.m_itemList.Clear();
        float num2 = (float)items.Count * this.m_itemSpacing;

        num2 = Mathf.Max(this.m_itemlistBaseSize, num2);
        this.m_listRoot.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, num2);
        for (int i = 0; i < items.Count; i++)
        {
            Trader.TradeItem tradeItem = items[i];
            GameObject       element   = UnityEngine.Object.Instantiate <GameObject>(this.m_listElement, this.m_listRoot);
            element.SetActive(true);
            (element.transform as RectTransform).anchoredPosition = new Vector2(0f, (float)i * -this.m_itemSpacing);
            bool  flag      = tradeItem.m_price <= playerCoins;
            Image component = element.transform.Find("icon").GetComponent <Image>();
            component.sprite = tradeItem.m_prefab.m_itemData.m_shared.m_icons[0];
            component.color  = (flag ? Color.white : new Color(1f, 0f, 1f, 0f));
            string text = Localization.instance.Localize(tradeItem.m_prefab.m_itemData.m_shared.m_name);
            if (tradeItem.m_stack > 1)
            {
                text = text + " x" + tradeItem.m_stack;
            }
            Text component2 = element.transform.Find("name").GetComponent <Text>();
            component2.text  = text;
            component2.color = (flag ? Color.white : Color.grey);
            UITooltip component3 = element.GetComponent <UITooltip>();
            component3.m_topic = tradeItem.m_prefab.m_itemData.m_shared.m_name;
            component3.m_text  = tradeItem.m_prefab.m_itemData.GetTooltip();
            Text component4 = Utils.FindChild(element.transform, "price").GetComponent <Text>();
            component4.text = tradeItem.m_price.ToString();
            if (!flag)
            {
                component4.color = Color.grey;
            }
            element.GetComponent <Button>().onClick.AddListener(delegate
            {
                this.OnSelectedItem(element);
            });
            this.m_itemList.Add(element);
        }
        if (num < 0)
        {
            num = 0;
        }
        this.SelectItem(num, false);
    }
Ejemplo n.º 4
0
 private void DelBtnClick(GameObject go)
 {
     if (null != DelEvent)
     {
         DelEvent(ID);
         if (m_ToolTipIsHover)
         {
             UITooltip.ShowText(null);
         }
     }
 }
Ejemplo n.º 5
0
 static public int Hide_s(IntPtr l)
 {
     try {
         UITooltip.Hide();
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 6
0
 void OnTooltip(bool show)
 {
     if (show)
     {
         UITooltip.ShowText(text);
     }
     else
     {
         UITooltip.ShowText(null);
     }
 }
Ejemplo n.º 7
0
 void OnTooltip(bool show)
 {
     if (show)
     {
         UITooltip.Show("test");
     }
     else
     {
         UITooltip.Hide();
     }
 }
Ejemplo n.º 8
0
 static void Postfix(UITooltip __instance, UITooltip ___m_current, GameObject ___m_tooltip)
 {
     if (!modEnabled.Value)
     {
         return;
     }
     if (___m_current == __instance && ___m_tooltip != null && ___m_current.transform.name == "RepairButton")
     {
         ___m_tooltip.transform.position = Input.mousePosition + new Vector3(-200, -100);
     }
 }
Ejemplo n.º 9
0
 void OnTooltip(bool show)
 {
     ReadContent();
     if (show)
     {
         UITooltip.Show(content.content);
     }
     else
     {
         UITooltip.Hide();
     }
 }
Ejemplo n.º 10
0
 static public int get_scalingTransitions(IntPtr l)
 {
     try {
         UITooltip self = (UITooltip)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.scalingTransitions);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 void OnTooltip(bool show)
 {
     if (show)
     {
         UITooltip.ShowText("highscore");
     }
     else
     {
         UITooltip.ShowText(null);
     }
     return;
 }
Ejemplo n.º 12
0
 static public int get_background(IntPtr l)
 {
     try {
         UITooltip self = (UITooltip)checkSelf(l);
         pushValue(l, true);
         pushValue(l, self.background);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 13
0
 static public int Show_s(IntPtr l)
 {
     try {
         System.String a1;
         checkType(l, 1, out a1);
         UITooltip.Show(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 14
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("");
     }
 }
Ejemplo n.º 15
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);
    }
Ejemplo n.º 16
0
    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));
            }
        }
    }
Ejemplo n.º 17
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.Show(t);
                return;
            }
        }
        UITooltip.Hide();
    }
Ejemplo n.º 18
0
 void OnTooltip(bool show)
 {
     if (0 != mStrID)
     {
         UITooltip.ShowText(PELocalization.GetString(mStrID));
         return;
     }
     else if (mTipContent != "")
     {
         UITooltip.ShowText(mTipContent);
         return;
     }
     UITooltip.ShowText(null);
 }
Ejemplo n.º 19
0
 static public int set_uiCamera(IntPtr l)
 {
     try {
         UITooltip          self = (UITooltip)checkSelf(l);
         UnityEngine.Camera v;
         checkType(l, 2, out v);
         self.uiCamera = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 20
0
 static public int set_appearSpeed(IntPtr l)
 {
     try {
         UITooltip     self = (UITooltip)checkSelf(l);
         System.Single v;
         checkType(l, 2, out v);
         self.appearSpeed = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 21
0
 static public int set_background(IntPtr l)
 {
     try {
         UITooltip self = (UITooltip)checkSelf(l);
         UISprite  v;
         checkType(l, 2, out v);
         self.background = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 22
0
 static public int set_scalingTransitions(IntPtr l)
 {
     try {
         UITooltip      self = (UITooltip)checkSelf(l);
         System.Boolean v;
         checkType(l, 2, out v);
         self.scalingTransitions = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 23
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);
    }
Ejemplo n.º 24
0
 // 툴팁 이벤트가 발생했을 때
 void OnTooltip(bool state)
 {
     // state가 참이면 type에 맞는 새로운 툴팁을 생성한다
     if (state)
     {
         //UITooltip.ShowText(Localization.Get(type.ToString() + "Tooltip"));
         UITooltip.Show(Localization.Get(type.ToString() + "Tooltip"));
     }
     else
     {
         //UITooltip.ShowText("");
         UITooltip.Show("");
     }
 }
Ejemplo n.º 25
0
        public void ShowTips(ItemInfo itemVo)
        {
            mItem = itemVo;
            if (!bInited)
            {
                return;
            }
            string str = "";

            str += itemVo.Name + "\n";
            str += itemVo.Tips;
            UITooltip.ShowText(str);
            Front();
        }
Ejemplo n.º 26
0
 static public int set_text(IntPtr l)
 {
     try {
         UITooltip self = (UITooltip)checkSelf(l);
         UILabel   v;
         checkType(l, 2, out v);
         self.text = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 27
0
 static public int set_tooltipRoot(IntPtr l)
 {
     try {
         UITooltip self = (UITooltip)checkSelf(l);
         UnityEngine.GameObject v;
         checkType(l, 2, out v);
         self.tooltipRoot = v;
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Ejemplo n.º 28
0
        private void SetupPieceInfo(Piece piece)
        {
            Player localPlayer = Player.m_localPlayer;

            Hud.instance.m_buildSelection.text   = Localization.instance.Localize(piece.m_name);
            Hud.instance.m_pieceDescription.text = Localization.instance.Localize(piece.m_description);
            Hud.instance.m_buildIcon.enabled     = true;
            Hud.instance.m_buildIcon.sprite      = piece.m_icon;
            GameObject[] uiRequirementPanels = Hud.instance.m_requirementItems;
            for (int j = 0; j < uiRequirementPanels.Length; j++)
            {
                if (j < piece.m_resources.Length)
                {
                    Piece.Requirement req = piece.m_resources[j];
                    uiRequirementPanels[j].SetActive(value: true);
                    SetupRequirement(uiRequirementPanels[j].transform, req, GetResourceCount(GetResourceName(req)));
                }
                else
                {
                    uiRequirementPanels[j].SetActive(value: false);
                }
            }
            if ((bool)piece.m_craftingStation)
            {
                CraftingStation craftingStation = CraftingStation.HaveBuildStationInRange(piece.m_craftingStation.m_name, localPlayer.transform.position);
                GameObject      obj             = uiRequirementPanels[piece.m_resources.Length];
                obj.SetActive(value: true);
                Image     component  = obj.transform.Find("res_icon").GetComponent <Image>();
                Text      component2 = obj.transform.Find("res_name").GetComponent <Text>();
                Text      component3 = obj.transform.Find("res_amount").GetComponent <Text>();
                UITooltip component4 = obj.GetComponent <UITooltip>();
                component.sprite  = piece.m_craftingStation.m_icon;
                component2.text   = Localization.instance.Localize(piece.m_craftingStation.m_name);
                component4.m_text = piece.m_craftingStation.m_name;
                if (craftingStation != null)
                {
                    craftingStation.ShowAreaMarker();
                    component.color  = Color.white;
                    component3.text  = "";
                    component3.color = Color.white;
                }
                else
                {
                    component.color  = Color.gray;
                    component3.text  = "None";
                    component3.color = ((Mathf.Sin(Time.time * 10f) > 0f) ? Color.red : Color.white);
                }
            }
        }
Ejemplo n.º 29
0
    void OnTooltip(bool show)
    {
        if (!show)
        {
            UITooltip.ShowText(null);
            return;
        }

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

        UITooltip.ShowText(_tooltipText);
    }
Ejemplo n.º 30
0
        private void OnTooltip(bool show)
        {
            return;

            if (show == true)
            {
                if (ToolTip != null)
                {
                    UITooltip.ShowText(ToolTip);
                }
            }
            else
            {
                UITooltip.ShowText(null);
            }
        }
        public static bool Prefix(ItemDrop.ItemData item, UITooltip tooltip)
        {
            string tooltipText;

            if (item.IsEquipable() && !item.m_equiped && Player.m_localPlayer != null && Player.m_localPlayer.HasEquipmentOfType(item.m_shared.m_itemType) && Input.GetKey(KeyCode.LeftControl))
            {
                var otherItem = Player.m_localPlayer.GetEquipmentOfType(item.m_shared.m_itemType);
                tooltipText = item.GetTooltip() + $"\n\n<color=#AAA><i>Currently Equipped:</i></color>\n<size=18>{otherItem.GetDecoratedName()}</size>\n" + otherItem.GetTooltip();
            }
            else
            {
                tooltipText = item.GetTooltip();
            }
            tooltip.Set(item.GetDecoratedName(), tooltipText);
            return(false);
        }
Ejemplo n.º 32
0
	void OnDestroy () { mInstance = null; }
Ejemplo n.º 33
0
	void Awake () { mInstance = this; }
Ejemplo n.º 34
0
	private void Awake () {
		instance = this; 
	}
Ejemplo n.º 35
0
	private void OnDestroy () {
		instance = null;
	}
Ejemplo n.º 36
0
 private void OnDestroy()
 {
     UITooltip.mInstance = null;
 }
Ejemplo n.º 37
0
 private void Awake()
 {
     UITooltip.mInstance = this;
 }