Exemple #1
0
 public void Show(ItemFielInfo selectItem, EquipmentUpgradePanel myParent)
 {
     MyParent = myParent;
     UpdateItemList();
     OnMyItemClick(selectItem);
     base.TweenShow();
 }
Exemple #2
0
 public void ShowEquipmentUpgradePanel(ItemFielInfo selectItem)
 {
     if (m_EquipmentUpgradePanel == null)
     {
         m_EquipmentUpgradePanel = NewPanelPos.InstantiateNGUIObj(EquipmentUpgradPanelPrefab).GetComponent <EquipmentUpgradePanel>();
     }
     m_EquipmentUpgradePanel.Show(selectItem);
 }
Exemple #3
0
        public void Show(ItemFielInfo itemFielInfo, EquipmentUpgradePanel myParent)
        {
            m_EquipmentEntity = itemFielInfo.equipmentEntity;
            MyParent          = myParent;
            m_UpgradItemMainProperty.Init(itemFielInfo);
            if (itemFielInfo == null)
            {
                ClearUpPanel();
                return;
            }
            var normalItem = itemFielInfo.LocalItemData as EquipmentData;
            var targetItem = ItemDataManager.Instance.GetItemData(((itemFielInfo.LocalItemData) as EquipmentData).UpgradeID) as EquipmentData;

            ShowMainEffectLabel(normalItem, targetItem);
            EquipmentData itemData    = itemFielInfo.LocalItemData as EquipmentData;
            string        needItemStr = "";

            if (itemData.UpgradeCost != "")
            {
                string[] costItemStr = itemData.UpgradeCost.Split('|');
                foreach (var child in costItemStr)
                {
                    string[] chacheStr = child.Split('+');
                    needItemStr += string.Format("{0}x{1}\n", LanguageTextManager.GetString(ItemDataManager.Instance.GetItemData(int.Parse(chacheStr[0]))._szGoodsName), chacheStr[1]);

                    if (ContainerInfomanager.Instance.GetOwnMaterialCount(int.Parse(chacheStr[0])) < int.Parse(chacheStr[1]))
                    {
                        needItemStr = NGUIColor.SetTxtColor(needItemStr, TextColor.red);
                    }
                    else
                    {
                        needItemStr = NGUIColor.SetTxtColor(needItemStr, TextColor.white);
                    }
                }
            }
            if (itemData.UpgradeID != 0)
            {
                int targetLevel = ItemDataManager.Instance.GetItemData(itemData.UpgradeID)._AllowLevel;

                string Levelstr = string.Format("{0}{1}", targetLevel, LanguageTextManager.GetString("IDS_H1_156"));

                if (PlayerManager.Instance.FindHeroDataModel().UnitValues.sMsgPropCreateEntity_SC_UnitVisibleValue.UNIT_FIELD_LEVEL < targetLevel)
                {
                    Levelstr = NGUIColor.SetTxtColor(Levelstr, TextColor.red);
                }
                else
                {
                    Levelstr = NGUIColor.SetTxtColor(Levelstr, TextColor.white);
                }
                LevelNeedLabel.SetText(Levelstr);
            }
            NeedItemDesLabel.SetText(needItemStr);
            HelpTipsLabel.SetText(LanguageTextManager.GetString("IDS_I10_4"));
            PriceLabel.SetText(normalItem._SaleCost + itemFielInfo.equipmentEntity.ITEM_FIELD_VISIBLE_COMM);
        }