예제 #1
0
        private void OnScrollChange(Transform trans, int index)
        {
            RewardUIData data      = this._mailData.attachment.itemList[index];
            Image        component = trans.Find("ItemIcon").GetComponent <Image>();
            Image        image2    = trans.Find("ItemIcon/Icon").GetComponent <Image>();

            component.gameObject.SetActive(true);
            trans.Find("SelectedMark").gameObject.SetActive(false);
            trans.Find("ProtectedMark").gameObject.SetActive(false);
            trans.Find("InteractiveMask").gameObject.SetActive(false);
            trans.Find("NotEnough").gameObject.SetActive(false);
            trans.Find("Star").gameObject.SetActive(false);
            trans.Find("StigmataType").gameObject.SetActive(false);
            trans.Find("UnidentifyText").gameObject.SetActive(false);
            trans.Find("QuestionMark").gameObject.SetActive(false);
            trans.Find("ItemIcon").GetComponent <Image>().color  = Color.white;
            trans.Find("ItemIcon").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(MiscData.Config.ItemRarityBGImgPath[0]);
            if (data.rewardType == ResourceType.Item)
            {
                StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(data.itemID, data.level);

                dummyStorageDataItem.number = data.value;
                MonoItemIconButton button = trans.GetComponent <MonoItemIconButton>();
                button.SetupView(dummyStorageDataItem, MonoItemIconButton.SelectMode.None, false, false, false);
                button.SetClickCallback(new MonoItemIconButton.ClickCallBack(this.OnItemClick));
            }
            else
            {
                image2.sprite = data.GetIconSprite();
                trans.Find("Text").GetComponent <Text>().text = "\x00d7" + data.value;
            }
        }
예제 #2
0
        private void OnScrollerChange(List <StorageDataItemBase> list, Transform trans, int index)
        {
            StorageDataItemBase item      = list[index];
            MonoItemIconButton  component = trans.GetComponent <MonoItemIconButton>();

            component.showProtected = true;
            component.blockSelect   = false;
            if (this.featureType == FeatureType.SelectForSell)
            {
                component.blockSelect = !this.FilterForSell(item);
            }
            else if (this.featureType == FeatureType.SelectForPowerUp)
            {
                component.blockSelect = !this.FilterForPowerUp(item);
            }
            bool flag  = ((this.featureType == FeatureType.SelectForSell) && (this._sellPanel != null)) && this._sellPanel.IsItemInSelectedMap(item);
            bool flag2 = ((this.featureType == FeatureType.SelectForPowerUp) && (this._powerUpPanel != null)) && this._powerUpPanel.IsItemInSelectedMap(item);
            bool bUsed = AvatarMetaDataReaderExtend.GetAvatarIDsByKey(item.avatarID) != null;

            component.SetupView(item, MonoItemIconButton.SelectMode.CheckWhenSelect, flag || flag2, false, bUsed);
            component.SetClickCallback(new MonoItemIconButton.ClickCallBack(this.OnItemButonClick));
            if (this.IsTabItemHeap(this._tabManager.GetShowingTabKey()) && flag2)
            {
                component.SetMinusBtnCallBack(new Action <StorageDataItemBase>(this.OnItemMinusBtnClick));
                component.ShowSelectedNum(this._powerUpPanel.GetItemSelectNum(item));
            }
        }
예제 #3
0
        private void OnChange(Transform trans, int index)
        {
            bool isSelected = this._showItemList[index] == this._selectedItem;
            MonoItemIconButton component = trans.GetComponent <MonoItemIconButton>();

            component.SetupView(this._showItemList[index], MonoItemIconButton.SelectMode.SmallWhenUnSelect, isSelected, false, false);
            component.SetClickCallback(new MonoItemIconButton.ClickCallBack(this.OnItemClick));
        }
예제 #4
0
        private void OnChange(Transform trans, int index)
        {
            MonoItemIconButton component = trans.GetComponent <MonoItemIconButton>();

            component.SetupView(this._showItemList[index].itemData, MonoItemIconButton.SelectMode.None, false, false, false);
            component.transform.Find("NotEnough").gameObject.SetActive(!this._showItemList[index].enough);
            component.SetClickCallback(new MonoItemIconButton.ClickCallBack(this.OnItemButonClick));
        }
예제 #5
0
        private void OnChange(Transform trans, int index)
        {
            MonoItemIconButton component = trans.GetComponent <MonoItemIconButton>();

            component.SetupView(this._materialList[index].item, MonoItemIconButton.SelectMode.ConsumeMaterial, false, false, false);
            component.transform.Find("NotEnough").gameObject.SetActive(!this._materialList[index].enough);
            component.SetClickCallback(new MonoItemIconButton.ClickCallBack(this.OnResourceItemButtonClick));
        }
예제 #6
0
        private void AddItem(int id, int num)
        {
            StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(id, 1);

            dummyStorageDataItem.number = num;
            MonoItemIconButton component = base.transform.AddChildFromPrefab(this.itemPrefab, null).GetComponent <MonoItemIconButton>();

            component.SetupView(dummyStorageDataItem, MonoItemIconButton.SelectMode.None, false, false, false);
            component.SetClickCallback(new MonoItemIconButton.ClickCallBack(this.OnItemButonClick));
        }
예제 #7
0
        private bool IsStorageItemDataEqual(RectTransform dataNew, RectTransform dataOld)
        {
            if ((dataNew == null) || (dataOld == null))
            {
                return(false);
            }
            MonoItemIconButton component = dataOld.GetComponent <MonoItemIconButton>();

            return(dataNew.GetComponent <MonoItemIconButton>()._item == component._item);
        }
예제 #8
0
        private void OnChange(Transform trans, int index)
        {
            StorageDataItemBase item     = this._showItemList[index];
            bool isSelected              = item == this._selectedItem;
            MonoItemIconButton component = trans.GetComponent <MonoItemIconButton>();

            component.showProtected = true;
            component.blockSelect   = item.isProtected || (item.avatarID > 0);
            component.SetupView(item, MonoItemIconButton.SelectMode.CheckWhenSelect, isSelected, false, item.avatarID > 0);
            component.SetClickCallback(new MonoItemIconButton.ClickCallBack(this.OnItemClick));
        }
예제 #9
0
 private void SetupResourceListView()
 {
     for (int i = 1; i <= 6; i++)
     {
         StorageDataItemBase item      = (i > this._resourceList.Count) ? null : this._resourceList[i - 1];
         MonoItemIconButton  component = base.view.transform.Find("ResourceList/Content/" + i).GetComponent <MonoItemIconButton>();
         component.SetupView(item, MonoItemIconButton.SelectMode.None, false, false, false);
         component.SetClickCallback(new MonoItemIconButton.ClickCallBack(this.OnResourceItemButtonClick));
     }
     base.view.transform.Find("ActionBtns/OkBtn").GetComponent <Button>().interactable = this.storageItem.level < this.storageItem.GetMaxLevel();
 }
예제 #10
0
        private void OnChange(Transform trans, int index)
        {
            StorageDataItemBase item     = this._showItemList[index];
            bool isSelected              = item == this._selectedItem;
            MonoItemIconButton component = trans.GetComponent <MonoItemIconButton>();
            bool bShowCostOver           = this.GetNewCostSum(item.GetCost()) > this.avatarData.MaxCost;
            bool bUsed = (item.avatarID > 0) && (item.avatarID != this.avatarData.avatarID);

            component.SetupView(item, MonoItemIconButton.SelectMode.SmallWhenUnSelect, isSelected, bShowCostOver, bUsed);
            component.SetClickCallback(new MonoItemIconButton.ClickCallBack(this.OnItemClick));
            trans.Find("AlreadyEquip").gameObject.SetActive((this.storageItem != null) && (this.storageItem == item));
        }
예제 #11
0
        private void SetupIconView(Transform trans, RewardUIData data)
        {
            if ((((data.rewardType == ResourceType.PlayerExp) || (data.rewardType == ResourceType.FriendPoint)) || ((data.rewardType == ResourceType.Hcoin) || (data.rewardType == ResourceType.Scoin))) || ((data.rewardType == ResourceType.SkillPoint) || (data.rewardType == ResourceType.Stamina)))
            {
                trans.Find("ItemIcon/Icon").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(data.iconPath);
                trans.Find("ItemIcon/Icon").GetComponent <Image>().SetNativeSize();
                trans.Find("QuestionMark").gameObject.SetActive(false);
                trans.Find("Star").gameObject.SetActive(false);
                trans.Find("Text").GetComponent <Text>().text       = string.Format("\x00d7{0}", data.value.ToString());
                trans.Find("ItemIcon").GetComponent <Image>().color = Color.white;
            }
            else
            {
                MonoItemIconButton component = trans.GetComponent <MonoItemIconButton>();
                if (component != null)
                {
                    StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(data.itemID, 1);

                    dummyStorageDataItem.number = data.value;
                    component.SetupView(dummyStorageDataItem, MonoItemIconButton.SelectMode.None, false, false, false);
                }
            }
        }
예제 #12
0
        private void DoSetupView()
        {
            Text component = base.transform.Find("Label/Text").GetComponent <Text>();

            if (this._inviteType == InviteTab.InviteeTab)
            {
                component.gameObject.SetActive(this._inviteeRewardData.get_levelSpecified());
                object[] replaceParams = new object[] { this._inviteeRewardData.get_level() };
                component.text = LocalizationGeneralLogic.GetText("InviteReward_Limit", replaceParams);
            }
            else
            {
                component.gameObject.SetActive(this._inviterRewardData.get_levelSpecified());
                object[] objArray2 = new object[] { this._inviterRewardData.get_level() };
                component.text = LocalizationGeneralLogic.GetText("InvitateeReward_Limit", objArray2);
            }
            if (this._inviteType == InviteTab.InviterTab)
            {
                base.transform.Find("Label/Current").gameObject.SetActive(true);
                base.transform.Find("Label/DivisionSign").gameObject.SetActive(true);
                base.transform.Find("Label/Max").gameObject.SetActive(true);
                base.transform.Find("Label/Current").GetComponent <Text>().text  = this._inviterRewardData.get_cur_num().ToString();
                base.transform.Find("Label/Current").GetComponent <Text>().color = (this._inviterRewardData.get_cur_num() < this._inviterRewardData.get_max_num()) ? MiscData.GetColor("WarningRed") : MiscData.GetColor("Blue");
                base.transform.Find("Label/Max").GetComponent <Text>().text      = this._inviterRewardData.get_max_num().ToString();
            }
            else
            {
                base.transform.Find("Label/Current").gameObject.SetActive(false);
                base.transform.Find("Label/DivisionSign").gameObject.SetActive(false);
                base.transform.Find("Label/Max").gameObject.SetActive(false);
            }
            this.SetupRewardList();
            Transform transform = base.transform.Find("Content");

            for (int i = 0; i < transform.childCount; i++)
            {
                Transform child = transform.GetChild(i);
                child.gameObject.SetActive(i < this._rewardUIDataList.Count);
                if (i < this._rewardUIDataList.Count)
                {
                    RewardUIData data   = this._rewardUIDataList[i];
                    Image        image  = child.Find("ItemIcon").GetComponent <Image>();
                    Image        image2 = child.Find("ItemIcon/Icon").GetComponent <Image>();
                    image.gameObject.SetActive(true);
                    child.Find("SelectedMark").gameObject.SetActive(false);
                    child.Find("ProtectedMark").gameObject.SetActive(false);
                    child.Find("InteractiveMask").gameObject.SetActive(false);
                    child.Find("NotEnough").gameObject.SetActive(false);
                    child.Find("Star").gameObject.SetActive(false);
                    child.Find("StigmataType").gameObject.SetActive(false);
                    child.Find("UnidentifyText").gameObject.SetActive(false);
                    child.Find("QuestionMark").gameObject.SetActive(false);
                    child.Find("ItemIcon").GetComponent <Image>().color  = Color.white;
                    child.Find("ItemIcon").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(MiscData.Config.ItemRarityBGImgPath[0]);
                    if (data.rewardType == ResourceType.Item)
                    {
                        StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(data.itemID, data.level);

                        dummyStorageDataItem.number = data.value;
                        MonoItemIconButton button = child.GetComponent <MonoItemIconButton>();
                        button.SetupView(dummyStorageDataItem, MonoItemIconButton.SelectMode.None, false, false, false);
                        button.SetClickCallback(new MonoItemIconButton.ClickCallBack(this.OnItemClick));
                    }
                    else
                    {
                        image2.sprite = data.GetIconSprite();
                        child.Find("Text").GetComponent <Text>().text = "\x00d7" + data.value;
                    }
                }
            }
            if (this._inviteType == InviteTab.InviteeTab)
            {
                base.transform.Find("AlreadyIssued").gameObject.SetActive(this._isAcceptInvitation && (Singleton <PlayerModule> .Instance.playerData.teamLevel >= this._inviteeRewardData.get_level()));
            }
            else
            {
                base.transform.Find("AlreadyIssued").gameObject.SetActive(this._inviterRewardData.get_cur_num() >= this._inviterRewardData.get_max_num());
            }
        }