コード例 #1
0
 private void SetSuit(int QualityLevel, string suitIcon, int EquipLevel)
 {
     if (EquipLevel > 0)
     {
         Level.text = string.Format("+{0}", EquipLevel);
     }
     Level.gameObject.SetActive(EquipLevel > 0);
     LevelBG.spriteName  = UIItemLvlDataLookup.GetEquipLevelBGStr(QualityLevel);
     SuitType.spriteName = suitIcon;
 }
コード例 #2
0
        private void SetSuit(DetailedEquipmentInfo info)
        {
            LockObj.CustomSetActive(info.isLock);
            LevelBG.gameObject.CustomSetActive(info.EquipLevel > 0);
            if (info.EquipLevel > 0)
            {
                Level.text = string.Format("+{0}", info.EquipLevel);
            }
            LevelBG.spriteName  = UIItemLvlDataLookup.GetEquipLevelBGStr(info.QualityLevel);
            SuitType.spriteName = info.SuitIcon;

            SuitEffect.CustomSetActive(false);
            int count = (Hotfix_LT.Data.EconemyTemplateManager.Instance.GetSuitTypeInfoByEcidSuitType(info.SuitType).SuitAttr2 != 0) ? 2 : 4;//套装件数

            for (int i = 0; i < partnerData.EquipmentTotleAttr.SuitList.Count; i++)
            {
                if (partnerData.EquipmentTotleAttr.SuitList[i].SuitType == info.SuitType && partnerData.EquipmentTotleAttr.SuitList[i].count >= count)
                {
                    SuitEffect.CustomSetActive(true);
                    break;
                }
            }
        }
コード例 #3
0
        public override void Fill(BaseEquipmentInfo itemData)
        {
            if (itemData == null || string.IsNullOrEmpty(itemData.ECid))
            {
                Data = null;
                mDMono.transform.GetChild(0).gameObject.CustomSetActive(false);
                RefreshTips();
                return;
            }
            else
            {
                if (Data == itemData)
                {
                    if (LTPartnerEquipMainController.instance.CurrentEquipmentViewState == LTPartnerEquipMainController.EquipmentViewState.LevelView)
                    {
                        if (LTPartnerEquipDataManager.Instance.UpLevelSelectList.Contains(Data.Eid))
                        {
                            IsSelect = true;
                            SelectBG.CustomSetActive(true);
                        }
                        else
                        {
                            IsSelect = false;
                            SelectBG.CustomSetActive(false);
                        }
                        if (isEquipUpItem)
                        {
                            delGoodsCount = LTPartnerEquipDataManager.Instance.getEquipUpItemNum(Data.ECid);
                            ShowGoodsCount();
                            BreakItemObj.CustomSetActive(true);
                        }
                        else
                        {
                            ItemMask.CustomSetActive(false);
                            BreakItemObj.CustomSetActive(false);
                        }
                    }

                    RefreshTips();
                    return;
                }

                Data          = itemData;
                isEquipUpItem = LTPartnerEquipDataManager.Instance.isEquipUpItem(Data.ECid);
                mDMono.transform.GetChild(0).gameObject.CustomSetActive(true);

                if (LTPartnerEquipMainController.instance != null && LTPartnerEquipMainController.instance.CurrentEquipmentViewState == LTPartnerEquipMainController.EquipmentViewState.LevelView &&
                    LTPartnerEquipDataManager.Instance.UpLevelSelectList.Contains(Data.Eid))
                {
                    IsSelect = true;
                    SelectBG.CustomSetActive(true);
                }
                else
                {
                    IsSelect = false;
                    SelectBG.CustomSetActive(false);
                }

                if (LockBG != null)
                {
                    LockBG.CustomSetActive(Data.isLock);
                }

                if (LTPartnerEquipMainController.instance != null && LTPartnerEquipMainController.instance.CurrentEquipmentViewState == LTPartnerEquipMainController.EquipmentViewState.SynthesisView)
                {
                    if (DressBG != null)
                    {
                        DressBG.CustomSetActive(Data.isDress);
                    }
                }
                else
                {
                    DressBG.CustomSetActive(false);
                }
            }
            EquipmentIcon.spriteName = Data.IconName;
            BGIcon.spriteName        = UIItemLvlDataLookup.LvlToStr(Data.QualityLevel.ToString());
            if (Data.QualityLevel == 7)
            {
                BG2Icon.spriteName = "Ty_Quality_Xuancai_Di";
            }
            else
            {
                BG2Icon.spriteName = "Ty_Di_2";
            }
            BG2Icon.color       = LT.Hotfix.Utility.ColorUtility.QualityToFrameColor(Data.QualityLevel);
            SuitIcon.spriteName = Data.SuitIcon;
            if (LevelLabel == null)
            {
                EB.Debug.LogError("LevelLabel Null");
            }
            LevelLabel.transform.GetChild(0).GetComponent <UISprite>().spriteName = UIItemLvlDataLookup.GetEquipLevelBGStr(Data.QualityLevel);
            if (Data.EquipLevel > 0)
            {
                LevelLabel.text = string.Format("+{0}", Data.EquipLevel);
                LevelLabel.gameObject.CustomSetActive(true);
            }
            else
            {
                LevelLabel.gameObject.CustomSetActive(false);
            }
            if (isEquipUpItem)
            {
                delGoodsCount = LTPartnerEquipDataManager.Instance.getEquipUpItemNum(Data.ECid);
                ShowGoodsCount();
                BreakItemObj.CustomSetActive(true);
            }
            else
            {
                ItemMask.CustomSetActive(false);
                BreakItemObj.CustomSetActive(false);
            }

            RefreshTips();
        }
コード例 #4
0
        private void SetBagContentFunc()
        {
            TextBG.CustomSetActive(true);
            NumLabel.text   = EB.Localizer.GetString("ID_LABEL_NAME_HADE") + EB.Dot.Integer("num", BagItemData, 0).ToString();
            templateid      = EB.Dot.String("economy_id", BagItemData, null);
            Icon.spriteName = Hotfix_LT.Data.EconemyTemplateManager.GetItemIcon(templateid);
            var item = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetItem(templateid);

            LTUIUtil.SetText(NameLabel, item.Name);
            ItemContent.text = item.Desc;
            int quality_level = EB.Dot.Integer("qualityLevel", BagItemData, 0);

            ShowItemFX(quality_level);
            Border.spriteName = UIItemLvlDataLookup.LvlToStr(quality_level + "");
            if (quality_level == 7)
            {
                FrameBG.spriteName = "Ty_Quality_Xuancai_Di";
            }
            else
            {
                FrameBG.spriteName = "Ty_Di_2";
            }
            FrameBG.color = UIItemLvlDataLookup.GetItemFrameBGColor(quality_level + "");
            FrameBG.gameObject.CustomSetActive(true);
            string itemType = EB.Dot.String("system", BagItemData, null);

            mClipFlag.CustomSetActive(itemType == "HeroShard");
            mCompoundRequest.gameObject.GetComponent <UIButton>().tweenTarget = null;
            if (itemType == "Generic")
            {
                bool        IsCanUse = IsItemCanUse();
                Color       btnColor = IsCanUse ? Color.white : Color.magenta;
                UISprite    useBtn   = mCompoundRequest.gameObject.GetComponent <UISprite>();
                BoxCollider colider  = mCompoundRequest.gameObject.GetComponent <BoxCollider>();
                colider.enabled = IsCanUse;
                useBtn.color    = btnColor;
            }

            mEquipSuitIcon.gameObject.CustomSetActive(itemType == "Equipment");
            mEquipLevel.gameObject.CustomSetActive(itemType == "Equipment");
            if (itemType == "Equipment")
            {
                int equipLevel = EB.Dot.Integer("currentLevel", BagItemData, 1);
                if (equipLevel <= 0)
                {
                    mEquipLevel.gameObject.CustomSetActive(false);
                }
                else
                {
                    mEquipLevel.gameObject.CustomSetActive(true);
                    mEquipLevel.text         = mEuqipLevelShadow.text = "+" + equipLevel;
                    mEquipLevelBG.spriteName = UIItemLvlDataLookup.GetEquipLevelBGStr(quality_level);
                }
                mEquipSuitIcon.spriteName = Hotfix_LT.Data.EconemyTemplateManager.GetEquipSuitIcon(templateid);
            }

            string suitIcon = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetEquipSuit(templateid);

            if (!string.IsNullOrEmpty(suitIcon))
            {
                mEquipSuitIcon.gameObject.CustomSetActive(true);
                mEquipSuitIcon.spriteName = suitIcon;
            }

            int grade = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetGoodsGradeNum(templateid);

            mboxGradeNumLab.gameObject.CustomSetActive(grade != 0);
            if (grade != 0)
            {
                mboxGradeNumLab.text = string.Format("+{0}", grade);
            }

            if (!(item is Hotfix_LT.Data.GeneralItemTemplate))
            {
                UseItem.CustomSetActive(false);
                CompoundItem.CustomSetActive(false);
            }
            else
            {
                var GeneralItem = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetGeneral(templateid);
                if (GeneralItem.CanUse)
                {
                    if (GeneralItem.CompoundItem != null)
                    {
                        UseItem.CustomSetActive(false);
                        CompoundItem.CustomSetActive(true);
                    }
                    else
                    {
                        UseItem.CustomSetActive(true);
                        CompoundItem.CustomSetActive(false);
                    }
                }
                else
                {
                    UseItem.CustomSetActive(false);
                    CompoundItem.CustomSetActive(false);
                }
            }
            SourceItem.GetComponent <BoxCollider>().enabled = true;
            SourceItem.GetComponent <UISprite>().color      = Color.white;
            SourceItem.CustomSetActive(true);
            BtnGrid.Reposition();
        }
コード例 #5
0
        public override void Fill(DetailedEquipmentInfo itemData)
        {
            if (itemData == null || itemData.Eid == 0)
            {
                Data = null;
                SuitIcon.gameObject.SetActive(false);
                LockBG.SetActive(false);
                EquipmentIcon.spriteName = "";
                LevelLabel.gameObject.SetActive(false);
                IconBG.CustomSetActive(true);
                SetAddIconObj(IsHaveEquip);
                Frame.gameObject.SetActive(false);
                FxObj.SetActive(false);
                return;
            }
            else
            {
                SuitIcon.gameObject.SetActive(true);
                IconBG.CustomSetActive(false);
                Data = itemData;
            }

            EquipmentIcon.spriteName = Data.IconName;
            LockBG.SetActive(Data.isLock);
            SetFrame(Data.QualityLevel);
            Frame.gameObject.SetActive(true);
            SuitIcon.spriteName = Data.SuitIcon;//LTPartnerEquipConfig.SuitIconDic[Data.SuitType];

            if (Data.EquipLevel > 0)
            {
                LevelLabel.text = string.Format("+{0}", Data.EquipLevel);
                LevelLabel.transform.GetChild(0).GetComponent <UISprite>().spriteName = UIItemLvlDataLookup.GetEquipLevelBGStr(Data.QualityLevel);
                LevelLabel.gameObject.SetActive(true);
            }
            else
            {
                LevelLabel.gameObject.SetActive(false);
            }

            SetAddIconObj(false);
            FxObj.SetActive(false);
            int count = (Hotfix_LT.Data.EconemyTemplateManager.Instance.GetSuitTypeInfoByEcidSuitType(Data.SuitType).SuitAttr2 != 0) ? 2 : 4;//套装件数
            List <SuitAttrsSuitTypeAndCount> suitList;

            if (LTPartnerEquipMainController.instance.CurrentEquipmentViewState == LTPartnerEquipMainController.EquipmentViewState.PresetEditView ||
                LTPartnerEquipMainController.instance.CurrentEquipmentViewState == LTPartnerEquipMainController.EquipmentViewState.PresetView)
            {
                suitList = LTPartnerEquipmentInfoController.instance.CurrentEquipmentTotalAttr.SuitList;
            }
            else
            {
                suitList = LTPartnerEquipMainController.CurrentPartnerData.EquipmentTotleAttr.SuitList;
            }

            for (int i = 0; i < suitList.Count; i++)
            {
                if (suitList[i].SuitType == Data.SuitType && suitList[i].count >= count)
                {
                    FxObj.SetActive(true);
                }
            }
        }
コード例 #6
0
        private void UpdateUI()
        {
            if (null != ItemData)
            {
                mDMono.gameObject.GetComponent <BoxCollider>().enabled = true;
                string templateid    = EB.Dot.String(m_EconomyIDPropertyName, ItemData, "");
                int    num           = EB.Dot.Integer(m_NumPropertyName, ItemData, 0);
                int    quality_level = EB.Dot.Integer(m_QualityLevelPropertyName, ItemData, 0);

                m_Icon.spriteName        = Hotfix_LT.Data.EconemyTemplateManager.GetItemIcon(templateid);
                m_Type                   = EB.Dot.String(m_TypeName, ItemData, "");
                m_LevelBorder.spriteName = UIItemLvlDataLookup.LvlToStr(quality_level + "");
                if (quality_level == 7)
                {
                    m_FrameBG.spriteName = "Ty_Quality_Xuancai_Di";
                }
                else
                {
                    m_FrameBG.spriteName = "Ty_Di_2";
                }
                m_FrameBG.color = UIItemLvlDataLookup.GetItemFrameBGColor(quality_level + "");
                m_LevelBorder.gameObject.CustomSetActive(true);

                HotfixCreateFX.ShowItemQualityFX(mQualityFX, mEffectClip, mDMono.transform, quality_level);

                m_Flag.CustomSetActive(m_Type == "HeroShard");
                m_EquipSuitIcon.gameObject.CustomSetActive(m_Type == "Equipment");
                m_EquipLevel.gameObject.CustomSetActive(m_Type == "Equipment");

                if (m_Type == "Equipment")
                {
                    int equipLevel = EB.Dot.Integer(m_EquipLevelStr, ItemData, 1);
                    if (equipLevel <= 0)
                    {
                        m_EquipLevel.gameObject.CustomSetActive(false);
                    }
                    else
                    {
                        m_EquipLevel.gameObject.CustomSetActive(true);
                        m_EquipLevel.text         = m_EuqipLevelShadow.text = "+" + equipLevel;
                        m_EquipLevelBG.spriteName = UIItemLvlDataLookup.GetEquipLevelBGStr(quality_level);
                    }
                    m_EquipSuitIcon.spriteName = Hotfix_LT.Data.EconemyTemplateManager.GetEquipSuitIcon(templateid);
                }

                int grade = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetGoodsGradeNum(templateid);
                m_boxGradeNumLab.gameObject.CustomSetActive(grade != 0);
                if (grade != 0)
                {
                    m_boxGradeNumLab.text = string.Format("+{0}", grade);
                }

                string suitIcon = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetEquipSuit(templateid);
                if (!string.IsNullOrEmpty(suitIcon))
                {
                    m_EquipSuitIcon.gameObject.CustomSetActive(true);
                    m_EquipSuitIcon.spriteName = suitIcon;
                }

                if (m_Count != null)
                {
                    if (num > 1)
                    {
                        m_Count.text = num + "";
                        m_Count.gameObject.CustomSetActive(true);
                    }
                    else
                    {
                        m_Count.gameObject.CustomSetActive(false);
                    }
                }
                string InventoryId = EB.Dot.String("inventory_id", ItemData, "");
                if (LTInventoryAllController._CurrentSelectCellId != null && LTInventoryAllController._CurrentSelectCellId.Contains(InventoryId))
                {
                    LTInventoryAllController._CurrentSelectCell = mDMono.transform.GetMonoILRComponentByClassPath <UIInventoryBagCellController>("Hotfix_LT.UI.UIInventoryBagCellController");
                    Border.CustomSetActive(true);
                }
                else
                {
                    Border.CustomSetActive(false);
                }

                //红点判断
                string eid = EB.Dot.String("economy_id", ItemData, null);
                if (eid != null)
                {
                    var GeneralItem = Hotfix_LT.Data.EconemyTemplateManager.Instance.GetGeneral(eid);
                    RedPoint.CustomSetActive(GeneralItem != null && GeneralItem.CanUse && !LTMainHudManager.Instance.ItemsList.Contains(InventoryId));
                }
            }
            else
            {
                m_Icon.spriteName = "";
                m_LevelBorder.gameObject.CustomSetActive(false);
                m_Flag.CustomSetActive(false);
                m_EquipSuitIcon.gameObject.CustomSetActive(false);
                m_EquipLevel.gameObject.CustomSetActive(false);
                m_boxGradeNumLab.gameObject.CustomSetActive(false);
                mDMono.gameObject.GetComponent <BoxCollider>().enabled = false;
                if (m_Count != null)
                {
                    m_Count.gameObject.CustomSetActive(false);
                }
                RedPoint.CustomSetActive(false);
                Border.CustomSetActive(false);
                if (mQualityFX != null)
                {
                    mQualityFX.gameObject.CustomSetActive(false);
                }
                else
                {
                    if (mDMono.transform.Find("QualityFX") != null)
                    {
                        mQualityFX  = mDMono.transform.Find("QualityFX").GetComponent <ParticleSystemUIComponent>();
                        mEffectClip = mDMono.transform.Find("QualityFX").GetComponent <EffectClip>();
                        mQualityFX.gameObject.CustomSetActive(false);
                    }
                }
            }
        }