Exemplo n.º 1
0
        private void SetupStigmata()
        {
            StigmataDataItem storageItem = this.storageItem as StigmataDataItem;

            base.view.transform.Find("Info/Content/Equipment/Title/TypeIcon").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(storageItem.GetSmallIconPath());
            string displayTitle = this.storageItem.GetDisplayTitle();

            if (storageItem.IsAffixIdentify)
            {
                string affixName = storageItem.GetAffixName();
                if (!string.IsNullOrEmpty(affixName))
                {
                    displayTitle = MiscData.AddColor("Blue", affixName) + " " + displayTitle;
                }
            }
            else
            {
                displayTitle = MiscData.AddColor("WarningRed", storageItem.GetAffixName()) + " " + displayTitle;
            }
            base.view.transform.Find("Info/Content/Equipment/Title/Name").GetComponent <Text>().text = displayTitle;
            base.view.transform.Find("Info/Content/Equipment/Cost/Num").GetComponent <Text>().text   = this.storageItem.GetCost().ToString();
            this.SetupItemProtectedStatus();
            base.view.transform.Find("Info/Content/Equipment/Star/EquipStar").GetComponent <MonoEquipSubStar>().SetupView(this.storageItem.rarity, this.storageItem.GetMaxRarity());
            base.view.transform.Find("Info/Content/Equipment/Star/EquipSubStar").GetComponent <MonoEquipSubStar>().SetupView(this.storageItem.GetSubRarity(), this.storageItem.GetMaxSubRarity() - 1);
            base.view.transform.Find("Info/Figure").GetComponent <MonoStigmataFigure>().SetupViewWithIdentifyStatus(storageItem, this.hideActionBtns && !this.unlock);
            if (storageItem.IsAffixIdentify)
            {
                bool flag = (storageItem.CanRefine && (Singleton <TutorialModule> .Instance != null)) && UnlockUIDataReaderExtend.UnlockByTutorial(5);
                base.view.transform.Find("ActionBtns/NewAffixBtn").GetComponent <Button>().interactable = flag;
                bool flag2 = Singleton <StorageModule> .Instance.GetStigmatasCanUseForNewAffix(storageItem).Count > 0;

                base.view.transform.Find("ActionBtns/NewAffixBtn/PopUp").gameObject.SetActive(flag2 && flag);
            }
            else
            {
                base.view.transform.Find("ActionBtns/PowerUpBtn").GetComponent <Button>().interactable  = false;
                base.view.transform.Find("ActionBtns/RarityUpBtn").GetComponent <Button>().interactable = false;
                base.view.transform.Find("ActionBtns/NewAffixBtn").GetComponent <Button>().interactable = false;
                base.view.transform.Find("ActionBtns/NewAffixBtn/PopUp").gameObject.SetActive(false);
            }
            base.view.transform.Find("Info/Figure/InfoMark").gameObject.SetActive(storageItem.IsAffixIdentify && this.unlock);
            base.view.transform.Find("Info/IdentifyBtn").gameObject.SetActive((!this.hideActionBtns || this.showIdentifyBtnOnly) && !storageItem.IsAffixIdentify);
            base.view.transform.Find("Info/IdentifyBtn").GetComponent <DragObject>().Init(this.storageItem);
            base.view.transform.Find("Info/Content/Equipment/Desc").GetComponent <Text>().text = this.storageItem.GetDescription();
            base.view.transform.Find("Info/Content").gameObject.SetActive(true);
            AvatarDataItem item2 = Singleton <AvatarModule> .Instance.TryGetAvatarByID(this.storageItem.avatarID);

            base.view.transform.Find("Info/Content/BtnInEquip").gameObject.SetActive(item2 != null);
            if (item2 != null)
            {
                base.view.transform.Find("Info/Content/BtnInEquip/EquipChara").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(item2.IconPath);
            }
        }
        protected override bool SetupView()
        {
            string str = MiscData.AddColor("Blue", LocalizationGeneralLogic.GetText("Menu_Scoin", new object[0])) + " + " + this._scoinNum;

            if (this._burstRate > 1f)
            {
                string   str2       = str;
                string[] textArray1 = new string[] { str2, " , ", MiscData.AddColor("Blue", LocalizationGeneralLogic.GetText("Menu_Desc_Critical", new object[0])), " \x00d7 ", string.Format("{0:0%}", this._burstRate) };
                str = string.Concat(textArray1);
            }
            base.view.transform.Find("Dialog/Content/TextScoin/line/Desc").GetComponent <Text>().text = str;
            base.view.transform.Find("Dialog/Content/MaterialList").gameObject.SetActive(this._materials.Count > 0);
            if (this._materials.Count >= 1)
            {
                if (this._materials.Count > this._max_materials_num)
                {
                }
                if (!Singleton <IslandModule> .Instance.IsDropMaterials() && (this._materials.Count > 0))
                {
                }
                for (int i = 0; i < this._max_materials_num; i++)
                {
                    int       num4      = i + 1;
                    Transform transform = base.view.transform.Find(string.Format("Dialog/Content/MaterialList/{0}", num4.ToString()));
                    if (i < this._materials.Count)
                    {
                        transform.gameObject.SetActive(true);
                        int metaId = (int)this._materials[i].get_item_id();
                        int level  = (int)this._materials[i].get_level();
                        StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(metaId, level);

                        if (dummyStorageDataItem != null)
                        {
                            transform.Find("ItemIcon/Icon").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(dummyStorageDataItem.GetIconPath());
                            transform.Find("Star").GetComponent <MonoItemIconStar>().SetupView(dummyStorageDataItem.rarity, dummyStorageDataItem.rarity);
                            transform.Find("Text").GetComponent <Text>().text = string.Format("x{0}", this._materials[i].get_num());
                        }
                    }
                    else
                    {
                        transform.gameObject.SetActive(false);
                    }
                }
            }
            return(false);
        }
Exemplo n.º 3
0
        private void SetupStigmataInfo(StigmataDataItem m_stigmata, Transform trans)
        {
            trans.Find("Equipment/Content/Title/TypeIcon").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(m_stigmata.GetSmallIconPath());
            string displayTitle = m_stigmata.GetDisplayTitle();

            if (m_stigmata.IsAffixIdentify)
            {
                string affixName = m_stigmata.GetAffixName();
                if (!string.IsNullOrEmpty(affixName))
                {
                    displayTitle = MiscData.AddColor("Blue", affixName) + " " + displayTitle;
                }
            }
            else
            {
                displayTitle = MiscData.AddColor("WarningRed", m_stigmata.GetAffixName()) + " " + displayTitle;
            }
            trans.Find("Equipment/Content/Title/Name").GetComponent <Text>().text = displayTitle;
            trans.Find("Equipment/Content/Star/EquipStar").GetComponent <MonoEquipSubStar>().SetupView(m_stigmata.rarity, m_stigmata.GetMaxRarity());
            trans.Find("Equipment/Content/Star/EquipSubStar").GetComponent <MonoEquipSubStar>().SetupView(m_stigmata.GetSubRarity(), m_stigmata.GetMaxSubRarity() - 1);
            trans.Find("AffixSkills/Skills/Content").GetComponent <MonoStigmataAffixSkillPanel>().SetupView(m_stigmata, m_stigmata.GetAffixSkillList());
        }
Exemplo n.º 4
0
        public void SetupView(StorageDataItemBase item, SelectMode selectMode = 0, bool isSelected = false, bool bShowCostOver = false, bool bUsed = false)
        {
            this._item       = item;
            this.selectMode  = selectMode;
            this._isSelected = isSelected;
            base.transform.Find("SelectedMark").gameObject.SetActive(false);
            base.transform.Find("ProtectedMark").gameObject.SetActive(false);
            base.transform.Find("InteractiveMask").gameObject.SetActive(false);
            base.transform.Find("NotEnough").gameObject.SetActive(false);
            base.transform.Find("Star").gameObject.SetActive(false);
            base.transform.Find("StigmataType").gameObject.SetActive(false);
            base.transform.Find("UnidentifyText").gameObject.SetActive(false);
            base.transform.Find("QuestionMark").gameObject.SetActive(false);
            base.transform.Find("MinusBtn").gameObject.SetActive(false);
            if (this._item == null)
            {
                base.transform.Find("ItemIcon").gameObject.SetActive(false);
                base.transform.Find("Text").gameObject.SetActive(false);
            }
            else
            {
                base.transform.Find("ItemIcon").gameObject.SetActive(true);
                base.transform.Find("Text").gameObject.SetActive(true);
                Sprite spriteByPrefab = Miscs.GetSpriteByPrefab(item.GetIconPath());
                base.transform.Find("ItemIcon/Icon").GetComponent <Image>().sprite = spriteByPrefab;
                base.transform.Find("ItemIcon").GetComponent <Image>().color       = Color.white;
                base.transform.Find("ItemIcon").GetComponent <Image>().sprite      = Miscs.GetSpriteByPrefab(MiscData.Config.ItemRarityBGImgPath[item.rarity]);
                if ((this._item is WeaponDataItem) || (this._item is StigmataDataItem))
                {
                    base.transform.Find("Text").GetComponent <Text>().text = "LV." + item.level;
                }
                else if (this._item is MaterialDataItem)
                {
                    string str = "\x00d7" + item.number;
                    if (selectMode == SelectMode.ConsumeMaterial)
                    {
                        StorageDataItemBase base2 = Singleton <StorageModule> .Instance.TryGetMaterialDataByID(this._item.ID);

                        int num = (base2 != null) ? base2.number : 0;
                        if (this._item.number > num)
                        {
                            str = MiscData.AddColor("WarningRed", num + " / ") + MiscData.AddColor("TotalBlack", this._item.number.ToString());
                        }
                        else
                        {
                            str = MiscData.AddColor("TotalBlack", num + " / " + this._item.number);
                        }
                    }
                    base.transform.Find("Text").GetComponent <Text>().text = str;
                }
                else if (this._item is AvatarFragmentDataItem)
                {
                    base.transform.Find("Text").GetComponent <Text>().text = "\x00d7" + item.number;
                }
                else
                {
                    base.transform.Find("Text").gameObject.SetActive(false);
                }
                this.SetupRarityView();
                this.SetupStigmataTypeIcon();
                if (selectMode != SelectMode.None)
                {
                    this.SetupSelectedView(isSelected);
                }
                else
                {
                    base.transform.Find("BG/Unselected").gameObject.SetActive(true);
                    base.transform.Find("BG/Selected").gameObject.SetActive(false);
                }
                if (this.showProtected)
                {
                    this.SetupProtectedView();
                }
                this.SetupBlockSelectView();
                this.SetupCostView(bShowCostOver);
                this.SetupUsedView(bUsed);
                base.transform.Find("ItemIcon/Icon").GetComponent <Image>().material = null;
                base.transform.Find("ItemIcon/Icon").GetComponent <Image>().color    = MiscData.GetColor("TotalWhite");
                if (this._item is StigmataDataItem)
                {
                    this.SetupStigmataAffixView((this._item as StigmataDataItem).IsAffixIdentify);
                }
            }
        }