예제 #1
0
 private void SetupLine(Transform line, RewardUIData data, StorageDataItemBase item = null)
 {
     line.gameObject.SetActive(true);
     line.Find("Image").GetComponent <Image>().sprite = data.GetIconSprite();
     line.Find("Desc").GetComponent <Text>().text     = this.GetDesc(data.valueLabelTextID, data.itemID);
     line.Find("Number").GetComponent <Text>().text   = string.Format("\x00d7{0}", data.value);
 }
예제 #2
0
 private void SetupScrollView()
 {
     base.view.transform.Find("Dialog/Content/Rewards/ScrollView").GetComponent <MonoGridScroller>().Init(delegate(Transform trans, int index) {
         RewardUIData data = this._achieveRewardList[index];
         this.SetupIconView(trans, data);
     }, this._achieveRewardList.Count, null);
 }
예제 #3
0
        private void SetRarity(Transform tran, RewardUIData data)
        {
            StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(data.itemID, data.level);

            if (!(dummyStorageDataItem is AvatarFragmentDataItem))
            {
                if (dummyStorageDataItem is AvatarCardDataItem)
                {
                    tran.Find("x").gameObject.SetActive(false);
                    tran.Find("Number").gameObject.SetActive(false);
                    Transform transform = tran.Find("AvatarStar");
                    transform.gameObject.SetActive(true);
                    AvatarDataItem dummyAvatarDataItem = Singleton <AvatarModule> .Instance.GetDummyAvatarDataItem(AvatarMetaDataReaderExtend.GetAvatarIDsByKey(data.itemID).avatarID);

                    transform.GetComponent <MonoAvatarStar>().SetupView(dummyAvatarDataItem.star);
                }
                else
                {
                    Transform transform2 = tran.Find("Star");
                    transform2.gameObject.SetActive(true);
                    int rarity = dummyStorageDataItem.rarity;
                    if (dummyStorageDataItem is WeaponDataItem)
                    {
                        rarity = (dummyStorageDataItem as WeaponDataItem).GetMaxRarity();
                    }
                    else if (dummyStorageDataItem is StigmataDataItem)
                    {
                        rarity = (dummyStorageDataItem as StigmataDataItem).GetMaxRarity();
                    }
                    transform2.GetComponent <MonoItemIconStar>().SetupView(dummyStorageDataItem.rarity, rarity);
                }
            }
        }
예제 #4
0
 private void SetupDetailItem(GameObject item, RewardUIData data)
 {
     if (data == null)
     {
         item.SetActive(false);
     }
     else
     {
         item.SetActive(true);
         Text component = item.transform.Find("Item").GetComponent <Text>();
         Text text2     = item.transform.Find("Number").GetComponent <Text>();
         if (data.rewardType == ResourceType.PlayerExp)
         {
             component.text = LocalizationGeneralLogic.GetText("Menu_Level", new object[0]);
         }
         else if (data.rewardType == ResourceType.Scoin)
         {
             component.text = LocalizationGeneralLogic.GetText("Menu_Scoin", new object[0]);
         }
         else if (data.rewardType == ResourceType.Hcoin)
         {
             component.text = LocalizationGeneralLogic.GetText("Menu_Hcoin", new object[0]);
         }
         else if (data.rewardType == ResourceType.FriendPoint)
         {
             component.text = LocalizationGeneralLogic.GetText("10119", new object[0]);
         }
         else if (data.rewardType == ResourceType.Item)
         {
             component.text = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(data.itemID, 1).GetDisplayTitle();
         }
         text2.text = data.value.ToString();
     }
 }
예제 #5
0
        public MailDataItem(Mail mail)
        {
            MailAttachment attachment;

            if ((mail == null) || (mail.get_attachment() == null))
            {
                attachment = null;
            }
            else if (((mail.get_attachment().get_item_list() == null) || (mail.get_attachment().get_item_list().Count == 0)) && ((mail.get_attachment().get_hcoin() == 0) && (mail.get_attachment().get_scoin() == 0)))
            {
                attachment = null;
            }
            else
            {
                attachment = new MailAttachment();
                if (mail.get_attachment().get_hcoin() > 0)
                {
                    RewardUIData hcoinData = RewardUIData.GetHcoinData((int)mail.get_attachment().get_hcoin());
                    attachment.itemList.Add(hcoinData);
                }
                if (mail.get_attachment().get_scoin() > 0)
                {
                    RewardUIData scoinData = RewardUIData.GetScoinData((int)mail.get_attachment().get_scoin());
                    attachment.itemList.Add(scoinData);
                }
                foreach (MailItem item in mail.get_attachment().get_item_list())
                {
                    RewardUIData data3 = new RewardUIData(ResourceType.Item, (int)item.get_num(), RewardUIData.ITEM_ICON_TEXT_ID, string.Empty, (int)item.get_item_id(), (int)item.get_level());
                    attachment.itemList.Add(data3);
                }
            }
            bool isAttachmentGot = mail.get_is_attachment_gotSpecified() && mail.get_is_attachment_got();

            this.Init((int)mail.get_id(), mail.get_type(), mail.get_title(), mail.get_content(), mail.get_sender(), mail.get_time(), attachment, isAttachmentGot);
        }
예제 #6
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;
            }
        }
        private void InitRewardList()
        {
            RewardData data = this._rewardDataList[0];

            this._missionRewardList.Clear();
            if (data.get_exp() > 0)
            {
                RewardUIData playerExpData = RewardUIData.GetPlayerExpData((int)data.get_exp());
                this._missionRewardList.Add(playerExpData);
            }
            if (data.get_scoin() > 0)
            {
                RewardUIData scoinData = RewardUIData.GetScoinData((int)data.get_scoin());
                this._missionRewardList.Add(scoinData);
            }
            if (data.get_hcoin() > 0)
            {
                RewardUIData hcoinData = RewardUIData.GetHcoinData((int)data.get_hcoin());
                this._missionRewardList.Add(hcoinData);
            }
            if (data.get_stamina() > 0)
            {
                RewardUIData staminaData = RewardUIData.GetStaminaData((int)data.get_stamina());
                this._missionRewardList.Add(staminaData);
            }
            if (data.get_skill_point() > 0)
            {
                RewardUIData skillPointData = RewardUIData.GetSkillPointData((int)data.get_skill_point());
                this._missionRewardList.Add(skillPointData);
            }
            if (data.get_friends_point() > 0)
            {
                RewardUIData friendPointData = RewardUIData.GetFriendPointData((int)data.get_friends_point());
                this._missionRewardList.Add(friendPointData);
            }
            foreach (RewardItemData data8 in data.get_item_list())
            {
                RewardUIData data9 = new RewardUIData(ResourceType.Item, (int)data8.get_num(), RewardUIData.ITEM_ICON_TEXT_ID, string.Empty, (int)data8.get_id(), (int)data8.get_level());
                this._missionRewardList.Add(data9);
                StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem((int)data8.get_id(), (int)data8.get_level());

                if (dummyStorageDataItem is AvatarCardDataItem)
                {
                    this._avatarData = dummyStorageDataItem as AvatarCardDataItem;
                }
            }
            if (this._dropItemList != null)
            {
                foreach (DropItem item in this._dropItemList)
                {
                    RewardUIData data10 = new RewardUIData(ResourceType.Item, (int)item.get_num(), RewardUIData.ITEM_ICON_TEXT_ID, string.Empty, (int)item.get_item_id(), (int)item.get_level());
                    this._missionRewardList.Add(data10);
                }
            }
        }
예제 #8
0
        public ResourceDetailDialogContext(RewardUIData resourceData)
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "ResourceDetailDialogContext",
                viewPrefabPath = "UI/Menus/Dialog/ItemDetailDialog",
                ignoreNotify   = true
            };

            base.config       = pattern;
            this.resourceData = resourceData;
        }
예제 #9
0
        private void InitRewardList()
        {
            RewardData data;

            if (this._signInRewardRsp != null)
            {
                data = this._signInRewardRsp.get_reward_list()[0];
            }
            else
            {
                return;
            }
            this._missionRewardList.Clear();
            if (data.get_exp() > 0)
            {
                RewardUIData playerExpData = RewardUIData.GetPlayerExpData((int)data.get_exp());
                this._missionRewardList.Add(playerExpData);
            }
            if (data.get_scoin() > 0)
            {
                RewardUIData scoinData = RewardUIData.GetScoinData((int)data.get_scoin());
                this._missionRewardList.Add(scoinData);
            }
            if (data.get_hcoin() > 0)
            {
                RewardUIData hcoinData = RewardUIData.GetHcoinData((int)data.get_hcoin());
                this._missionRewardList.Add(hcoinData);
            }
            if (data.get_stamina() > 0)
            {
                RewardUIData staminaData = RewardUIData.GetStaminaData((int)data.get_stamina());
                this._missionRewardList.Add(staminaData);
            }
            if (data.get_skill_point() > 0)
            {
                RewardUIData skillPointData = RewardUIData.GetSkillPointData((int)data.get_skill_point());
                this._missionRewardList.Add(skillPointData);
            }
            if (data.get_friends_point() > 0)
            {
                RewardUIData friendPointData = RewardUIData.GetFriendPointData((int)data.get_friends_point());
                this._missionRewardList.Add(friendPointData);
            }
            foreach (RewardItemData data8 in data.get_item_list())
            {
                RewardUIData item = new RewardUIData(ResourceType.Item, (int)data8.get_num(), RewardUIData.ITEM_ICON_TEXT_ID, string.Empty, (int)data8.get_id(), (int)data8.get_level());
                this._missionRewardList.Add(item);
            }
            foreach (RewardUIData data10 in this._missionRewardList)
            {
            }
        }
예제 #10
0
 public void SetupView(RewardUIData rewardData)
 {
     this._rewardData = rewardData;
     if (rewardData == null)
     {
         base.gameObject.SetActive(false);
     }
     else
     {
         base.transform.Find("Number").GetComponent <Text>().text  = this._rewardData.value.ToString();
         base.transform.Find("Icon").GetComponent <Image>().sprite = this._rewardData.GetIconSprite();
     }
 }
예제 #11
0
 private void SetupContents()
 {
     switch (this._missionRewardList.Count)
     {
     case 1:
     {
         RewardUIData data = this._missionRewardList[0];
         Transform    line = base.view.transform.Find("Dialog/Content/RewardPanel");
         this.SetupLine(line, data);
         break;
     }
     }
 }
예제 #12
0
        public void SetupView(MailDataItem mailData, Action <MailDataItem> checkBtnCallBack, Action <MailDataItem> getBtnCallBack)
        {
            this._mailData         = mailData;
            this._checkBtnCallBack = checkBtnCallBack;
            this._getBtnCallBack   = getBtnCallBack;
            Image component = base.transform.Find("ItemIconButton/ItemIcon").GetComponent <Image>();
            Image image2    = base.transform.Find("ItemIconButton/ItemIcon/Icon").GetComponent <Image>();

            this.ResetIconImageSize();
            if (this._mailData.hasAttachment)
            {
                RewardUIData data = this._mailData.attachment.itemList[0];
                component.color = MiscData.GetColor("TotalWhite");
                if (data.rewardType == ResourceType.Item)
                {
                    image2.transform.GetComponent <MonoImageFitter>().enabled = true;
                    StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(data.itemID, 1);

                    component.sprite = Miscs.GetSpriteByPrefab(MiscData.Config.ItemRarityBGImgPath[dummyStorageDataItem.rarity]);
                }
                else
                {
                    component.sprite = Miscs.GetSpriteByPrefab(MiscData.Config.ItemRarityBGImgPath[0]);
                    image2.transform.GetComponent <MonoImageFitter>().enabled = false;
                }
                image2.sprite = data.GetIconSprite();
                base.transform.Find("ItemIconButton/Text").GetComponent <Text>().text = "\x00d7" + data.value;
            }
            else
            {
                image2.transform.GetComponent <MonoImageFitter>().enabled = true;
                if (Singleton <MailModule> .Instance.IsMailRead(this._mailData))
                {
                    component.color = MiscData.GetColor("MailUnreadGrey");
                    image2.sprite   = Miscs.GetSpriteByPrefab("SpriteOutput/Mail/IconMailOpen");
                    base.transform.Find("ItemIconButton/Text").GetComponent <Text>().text = LocalizationGeneralLogic.GetText("Menu_Desc_MailReaded", new object[0]);
                }
                else
                {
                    component.color = MiscData.GetColor("Blue");
                    image2.sprite   = Miscs.GetSpriteByPrefab("SpriteOutput/Mail/IconMailUnread");
                    base.transform.Find("ItemIconButton/Text").GetComponent <Text>().text = LocalizationGeneralLogic.GetText("Menu_Desc_MailUnRead", new object[0]);
                }
            }
            base.transform.Find("ItemIconButton/NewMark").gameObject.SetActive(Singleton <MailModule> .Instance.IsMailNew(this._mailData));
            base.transform.Find("Time/Time").GetComponent <Text>().text    = Miscs.GetBeforeTimeToShow(this._mailData.time);
            base.transform.Find("Info/Content").GetComponent <Text>().text = this.GetMailContentAbstract();
            base.transform.Find("Info/Sender").GetComponent <Text>().text  = this._mailData.sender;
            base.transform.Find("Title/Text").GetComponent <Text>().text   = this._mailData.title;
            base.transform.Find("ActionBtns/GetBtn").gameObject.SetActive(this._mailData.hasAttachment);
        }
예제 #13
0
        protected override bool SetupView()
        {
            base.view.transform.Find("Btn").gameObject.SetActive(false);
            this._groupBGColor = Miscs.ParseColor(MiscData.Config.EndlessGroupBGColor[(int)this._rewardData.get_group_level()]);
            this.SetupRewardTilte();
            base.view.transform.Find("Dialog/Content/GroupPanel/GroupBGL/GroupIcon").GetComponent <Image>().sprite = Miscs.GetSpriteByPrefab(MiscData.Config.EndlessGroupSelectPrefabPath[(int)this._rewardData.get_group_level()]);
            Transform transform = base.view.transform.Find("Dialog/Content/GetProps");

            this.InitRewardList();
            for (int i = 1; i <= 3; i++)
            {
                Transform transform2 = transform.Find(i.ToString());
                if (i > this._gotRewardList.Count)
                {
                    transform2.gameObject.SetActive(false);
                }
                else
                {
                    RewardUIData data = this._gotRewardList[i - 1];
                    transform2.Find("Image").GetComponent <Image>().sprite = data.GetIconSprite();
                    transform2.Find("Num").GetComponent <Text>().text      = data.value.ToString();
                }
            }
            Transform transform3 = base.view.transform.Find("Dialog/Content/GroupPanel/Ranking");

            transform3.Find("Up").gameObject.SetActive(false);
            transform3.Find("Flat").gameObject.SetActive(false);
            transform3.Find("Down").gameObject.SetActive(false);
            switch (this._rewardData.get_reward_type())
            {
            case 1:
                transform3.Find("Up").gameObject.SetActive(true);
                break;

            case 2:
                transform3.Find("Flat").gameObject.SetActive(true);
                break;

            case 3:
                transform3.Find("Down").gameObject.SetActive(true);
                break;
            }
            base.view.transform.Find("Dialog/Content/GroupPanel/Label").gameObject.SetActive(false);
            return(false);
        }
예제 #14
0
        private void SetupItemFrame(Image frameImage, RewardUIData data)
        {
            ResourceType rewardType = data.rewardType;

            if (rewardType == ResourceType.Hcoin)
            {
                frameImage.sprite = Miscs.GetSpriteByPrefab("SpriteOutput/ItemFrame/FrameComPurple");
            }
            else if (rewardType == ResourceType.Item)
            {
                StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(data.itemID, 1);

                frameImage.sprite = Miscs.GetSpriteByPrefab(MiscData.Config.ItemRarityBGImgPath[dummyStorageDataItem.rarity]);
            }
            else
            {
                frameImage.sprite = Miscs.GetSpriteByPrefab("SpriteOutput/ItemFrame/FrameComBlue");
            }
        }
예제 #15
0
 private void SetupRewardList()
 {
     this._redeemRewardList = new List <RewardUIData>();
     if (this._redeemInfo.get_reward_list().Count >= 1)
     {
         RewardData data = this._redeemInfo.get_reward_list()[0];
         if (data.get_exp() > 0)
         {
             RewardUIData playerExpData = RewardUIData.GetPlayerExpData((int)data.get_exp());
             this._redeemRewardList.Add(playerExpData);
         }
         if (data.get_scoin() > 0)
         {
             RewardUIData scoinData = RewardUIData.GetScoinData((int)data.get_scoin());
             this._redeemRewardList.Add(scoinData);
         }
         if (data.get_hcoin() > 0)
         {
             RewardUIData hcoinData = RewardUIData.GetHcoinData((int)data.get_hcoin());
             this._redeemRewardList.Add(hcoinData);
         }
         if (data.get_stamina() > 0)
         {
             RewardUIData staminaData = RewardUIData.GetStaminaData((int)data.get_stamina());
             this._redeemRewardList.Add(staminaData);
         }
         if (data.get_skill_point() > 0)
         {
             RewardUIData skillPointData = RewardUIData.GetSkillPointData((int)data.get_skill_point());
             this._redeemRewardList.Add(skillPointData);
         }
         if (data.get_friends_point() > 0)
         {
             RewardUIData friendPointData = RewardUIData.GetFriendPointData((int)data.get_friends_point());
             this._redeemRewardList.Add(friendPointData);
         }
         foreach (RewardItemData data8 in data.get_item_list())
         {
             RewardUIData item = new RewardUIData(ResourceType.Item, (int)data8.get_num(), RewardUIData.ITEM_ICON_TEXT_ID, string.Empty, (int)data8.get_id(), (int)data8.get_level());
             this._redeemRewardList.Add(item);
         }
     }
 }
예제 #16
0
        private void OnScrollChange(Transform trans, int index)
        {
            RewardUIData data = this._redeemRewardList[index];

            if (data.rewardType == ResourceType.Item)
            {
                StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(data.itemID, data.level);

                dummyStorageDataItem.number = data.value;
                trans.GetComponent <MonoLevelDropIconButton>().SetupView(dummyStorageDataItem, new DropItemButtonClickCallBack(this.OnDropItemButtonClick), true, false, false, false);
            }
            else
            {
                this.HideRewardTransSomePart(trans);
                trans.GetComponent <MonoLevelDropIconButton>().Clear();
                trans.Find("ItemIcon/ItemIcon/Icon").GetComponent <Image>().sprite = data.GetIconSprite();
                trans.Find("BG/Desc").GetComponent <Text>().text = "x" + data.value.ToString();
            }
            trans.GetComponent <MonoAnimationinSequence>().animationName = "DropItemScale10";
        }
예제 #17
0
        private void SetupContents()
        {
            int count = this._missionRewardList.Count;

            switch (count)
            {
            case 0:
                break;

            case 1:
            {
                RewardUIData data = this._missionRewardList[0];
                Transform    icon = base.view.transform.Find("Dialog/Content/RewardList/center");
                this.SetupIcon(icon, data);
                Transform line = base.view.transform.Find("Dialog/Content/TextList/line1");
                this.SetupLine(line, data);
                break;
            }

            default:
                if (count >= 2)
                {
                    RewardUIData data2      = this._missionRewardList[0];
                    Transform    transform3 = base.view.transform.Find("Dialog/Content/RewardList/left");
                    this.SetupIcon(transform3, data2);
                    data2 = this._missionRewardList[1];
                    Transform transform4 = base.view.transform.Find("Dialog/Content/RewardList/right");
                    this.SetupIcon(transform4, data2);
                    data2 = this._missionRewardList[0];
                    Transform transform5 = base.view.transform.Find("Dialog/Content/TextList/line1");
                    this.SetupLine(transform5, data2);
                    data2 = this._missionRewardList[1];
                    Transform transform6 = base.view.transform.Find("Dialog/Content/TextList/line2");
                    this.SetupLine(transform6, data2);
                    if (count <= 2)
                    {
                    }
                }
                break;
            }
        }
예제 #18
0
 private void InitRewardList()
 {
     this._achieveRewardList.Clear();
     if (this._rewardData.get_exp() > 0)
     {
         RewardUIData playerExpData = RewardUIData.GetPlayerExpData((int)this._rewardData.get_exp());
         this._achieveRewardList.Add(playerExpData);
     }
     if (this._rewardData.get_scoin() > 0)
     {
         RewardUIData scoinData = RewardUIData.GetScoinData((int)this._rewardData.get_scoin());
         this._achieveRewardList.Add(scoinData);
     }
     if (this._rewardData.get_hcoin() > 0)
     {
         RewardUIData hcoinData = RewardUIData.GetHcoinData((int)this._rewardData.get_hcoin());
         this._achieveRewardList.Add(hcoinData);
     }
     if (this._rewardData.get_stamina() > 0)
     {
         RewardUIData staminaData = RewardUIData.GetStaminaData((int)this._rewardData.get_stamina());
         this._achieveRewardList.Add(staminaData);
     }
     if (this._rewardData.get_skill_point() > 0)
     {
         RewardUIData skillPointData = RewardUIData.GetSkillPointData((int)this._rewardData.get_skill_point());
         this._achieveRewardList.Add(skillPointData);
     }
     if (this._rewardData.get_friends_point() > 0)
     {
         RewardUIData friendPointData = RewardUIData.GetFriendPointData((int)this._rewardData.get_friends_point());
         this._achieveRewardList.Add(friendPointData);
     }
     foreach (RewardItemData data7 in this._rewardData.get_item_list())
     {
         RewardUIData item = new RewardUIData(ResourceType.Item, (int)data7.get_num(), RewardUIData.ITEM_ICON_TEXT_ID, string.Empty, (int)data7.get_id(), (int)data7.get_level());
         this._achieveRewardList.Add(item);
     }
 }
예제 #19
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);
                }
            }
        }
예제 #20
0
 private void SetupIcon(Transform icon, RewardUIData data)
 {
     icon.gameObject.SetActive(true);
     icon.Find("ItemIcon/Icon").GetComponent <Image>().sprite = data.GetIconSprite();
     icon.Find("Text").GetComponent <Text>().text             = string.Format("\x00d7{0}", data.value);
 }
예제 #21
0
 public void SetupRewardView(RewardUIData data, Transform rewardTrans)
 {
예제 #22
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());
            }
        }
예제 #23
0
        private void SetupRewardList()
        {
            Transform transform  = base.view.transform.Find("Dialog/Content/TextList/line1");
            Transform transform2 = base.view.transform.Find("Dialog/Content/TextList/line2");
            Transform transform3 = base.view.transform.Find("Dialog/Content/TextList/line3");

            transform.gameObject.SetActive(false);
            transform2.gameObject.SetActive(false);
            transform3.gameObject.SetActive(false);
            int typeCount = 0;

            this._nonItemRewardList = new List <RewardUIData>();
            if (this._rewardData.get_exp() > 0)
            {
                RewardUIData playerExpData = RewardUIData.GetPlayerExpData((int)this._rewardData.get_exp());
                this._nonItemRewardList.Add(playerExpData);
            }
            if (this._rewardData.get_scoin() > 0)
            {
                RewardUIData scoinData = RewardUIData.GetScoinData((int)this._rewardData.get_scoin());
                this._nonItemRewardList.Add(scoinData);
            }
            if (this._rewardData.get_hcoin() > 0)
            {
                RewardUIData hcoinData = RewardUIData.GetHcoinData((int)this._rewardData.get_hcoin());
                this._nonItemRewardList.Add(hcoinData);
            }
            if (this._rewardData.get_stamina() > 0)
            {
                RewardUIData staminaData = RewardUIData.GetStaminaData((int)this._rewardData.get_stamina());
                this._nonItemRewardList.Add(staminaData);
            }
            if (this._rewardData.get_skill_point() > 0)
            {
                RewardUIData skillPointData = RewardUIData.GetSkillPointData((int)this._rewardData.get_skill_point());
                this._nonItemRewardList.Add(skillPointData);
            }
            if (this._rewardData.get_friends_point() > 0)
            {
                RewardUIData friendPointData = RewardUIData.GetFriendPointData((int)this._rewardData.get_friends_point());
                this._nonItemRewardList.Add(friendPointData);
            }
            foreach (RewardUIData data7 in this._nonItemRewardList)
            {
                typeCount++;
                Transform[] lineTrans = new Transform[] { transform, transform2, transform3 };
                Transform   textLine  = this.GetTextLine(typeCount, lineTrans);
                if (textLine != null)
                {
                    this.SetupLine(textLine, data7, null);
                }
            }
            this._rewardItemDict = new Dictionary <int, StorageDataItemBase>();
            foreach (RewardItemData data8 in this._rewardData.get_item_list())
            {
                StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem((int)data8.get_id(), (int)data8.get_level());

                dummyStorageDataItem.number = (int)data8.get_num();
                if (this._rewardItemDict.ContainsKey(dummyStorageDataItem.ID))
                {
                    StorageDataItemBase local1 = this._rewardItemDict[dummyStorageDataItem.ID];
                    local1.number += dummyStorageDataItem.number;
                }
                else
                {
                    this._rewardItemDict[dummyStorageDataItem.ID] = dummyStorageDataItem;
                }
            }
            if (this._dropItemList != null)
            {
                foreach (DropItem item in this._dropItemList)
                {
                    StorageDataItemBase base3 = Singleton <StorageModule> .Instance.GetDummyStorageDataItem((int)item.get_item_id(), (int)item.get_level());

                    base3.number = (int)item.get_num();
                    if (this._rewardItemDict.ContainsKey(base3.ID))
                    {
                        StorageDataItemBase local2 = this._rewardItemDict[base3.ID];
                        local2.number += base3.number;
                    }
                    else
                    {
                        this._rewardItemDict[base3.ID] = base3;
                    }
                }
            }
            Transform trans = base.view.transform.Find("Dialog/Content/RewardList/Content");

            trans.DestroyChildren();
            foreach (RewardUIData data9 in this._nonItemRewardList)
            {
                Transform rewardTrans = UnityEngine.Object.Instantiate <GameObject>(Resources.Load <GameObject>("UI/Menus/Widget/Map/DropItemButton")).transform;
                rewardTrans.SetParent(trans, false);
                this.HideRewardTransSomePart(rewardTrans);
                rewardTrans.GetComponent <MonoLevelDropIconButton>().Clear();
                rewardTrans.Find("ItemIcon/ItemIcon/Icon").GetComponent <Image>().sprite = data9.GetIconSprite();
                rewardTrans.Find("BG/Desc").GetComponent <Text>().text = "\x00d7" + data9.value.ToString();
                rewardTrans.GetComponent <CanvasGroup>().alpha         = 1f;
            }
            foreach (StorageDataItemBase base4 in this._rewardItemDict.Values)
            {
                Transform transform7 = UnityEngine.Object.Instantiate <GameObject>(Resources.Load <GameObject>("UI/Menus/Widget/Map/DropItemButton")).transform;
                transform7.SetParent(trans, false);
                transform7.GetComponent <MonoLevelDropIconButton>().SetupView(base4, new DropItemButtonClickCallBack(this.OnDropItemButtonClick), true, false, false, false);
                transform7.GetComponent <CanvasGroup>().alpha = 1f;
            }
        }
예제 #24
0
 private void SetupRewardView()
 {
     this.RefreshRewardList();
     if (this.missionRewardList.Count != 0)
     {
         RewardUIData data;
         RewardUIData data2 = null;
         this._leftData  = null;
         this._rightData = null;
         if (this.missionRewardList.Count == 1)
         {
             data  = null;
             data2 = this.missionRewardList[0];
         }
         else
         {
             data  = this.missionRewardList[0];
             data2 = this.missionRewardList[1];
         }
         this._leftData  = data;
         this._rightData = data2;
         if (data != null)
         {
             Color color;
             base.transform.Find("Rewards/Left").gameObject.SetActive(true);
             base.transform.Find("Rewards/Left/RewardItem/Icon").GetComponent <Image>().sprite = data.GetIconSprite();
             base.transform.Find("Rewards/Left/RewardItem/Number").GetComponent <Text>().text  = string.Format("{0}", data.value);
             Text   component = base.transform.Find("Rewards/Left/RewardItem/x").GetComponent <Text>();
             string str       = !this.IsMissionActive() ? "##96b1c0FF" : "43C6FCFF";
             UIUtil.TryParseHexString(str, out color);
             component.color = color;
             base.transform.Find("Rewards/Left/RewardItem/Icon").GetComponent <Image>().material = !this.IsMissionActive() ? _grayMat : null;
             if (data.rewardType == ResourceType.Item)
             {
                 this.SetRarity(base.transform.Find("Rewards/Left/RewardItem"), data);
             }
             Button button = base.transform.Find("Rewards/Left/ShowDetailBtn").GetComponent <Button>();
             this._leftClickEvent = button.onClick;
             this._leftClickEvent.RemoveAllListeners();
             button.onClick.AddListener(new UnityAction(this.ShowDetailDialog_Left));
         }
         if (data2 != null)
         {
             Color color2;
             base.transform.Find("Rewards/Right").gameObject.SetActive(true);
             base.transform.Find("Rewards/Right/RewardItem/Icon").GetComponent <Image>().sprite = data2.GetIconSprite();
             base.transform.Find("Rewards/Right/RewardItem/Number").GetComponent <Text>().text  = string.Format("{0}", data2.value);
             Text   text4 = base.transform.Find("Rewards/Right/RewardItem/x").GetComponent <Text>();
             string str2  = !this.IsMissionActive() ? "##96b1c0FF" : "43C6FCFF";
             UIUtil.TryParseHexString(str2, out color2);
             text4.color = color2;
             base.transform.Find("Rewards/Right/RewardItem/Icon").GetComponent <Image>().material = !this.IsMissionActive() ? _grayMat : null;
             if (data2.rewardType == ResourceType.Item)
             {
                 this.SetRarity(base.transform.Find("Rewards/Right/RewardItem"), data2);
             }
             Button button2 = base.transform.Find("Rewards/Right/ShowDetailBtn").GetComponent <Button>();
             this._rightClickEvent = button2.onClick;
             this._rightClickEvent.RemoveAllListeners();
             button2.onClick.AddListener(new UnityAction(this.ShowDetailDialog_Right));
         }
     }
 }
예제 #25
0
        private void InitRewardList()
        {
            this._rankRewardDataList.Clear();
            RewardData rewardDataByKey = RewardDataReader.GetRewardDataByKey(this._rewardID);

            if (rewardDataByKey != null)
            {
                if (rewardDataByKey.RewardExp > 0)
                {
                    RewardUIData playerExpData = RewardUIData.GetPlayerExpData(rewardDataByKey.RewardExp);
                    playerExpData.itemID = rewardDataByKey.RewardID;
                    this._rankRewardDataList.Add(playerExpData);
                }
                if (rewardDataByKey.RewardSCoin > 0)
                {
                    RewardUIData scoinData = RewardUIData.GetScoinData(rewardDataByKey.RewardSCoin);
                    scoinData.itemID = rewardDataByKey.RewardID;
                    this._rankRewardDataList.Add(scoinData);
                }
                if (rewardDataByKey.RewardHCoin > 0)
                {
                    RewardUIData hcoinData = RewardUIData.GetHcoinData(rewardDataByKey.RewardHCoin);
                    hcoinData.itemID = rewardDataByKey.RewardID;
                    this._rankRewardDataList.Add(hcoinData);
                }
                if (rewardDataByKey.RewardStamina > 0)
                {
                    RewardUIData staminaData = RewardUIData.GetStaminaData(rewardDataByKey.RewardStamina);
                    staminaData.itemID = rewardDataByKey.RewardID;
                    this._rankRewardDataList.Add(staminaData);
                }
                if (rewardDataByKey.RewardSkillPoint > 0)
                {
                    RewardUIData skillPointData = RewardUIData.GetSkillPointData(rewardDataByKey.RewardSkillPoint);
                    skillPointData.itemID = rewardDataByKey.RewardID;
                    this._rankRewardDataList.Add(skillPointData);
                }
                if (rewardDataByKey.RewardFriendPoint > 0)
                {
                    RewardUIData friendPointData = RewardUIData.GetFriendPointData(rewardDataByKey.RewardFriendPoint);
                    friendPointData.itemID = rewardDataByKey.RewardID;
                    this._rankRewardDataList.Add(friendPointData);
                }
                if (rewardDataByKey.RewardItem1ID > 0)
                {
                    RewardUIData item = new RewardUIData(ResourceType.Item, rewardDataByKey.RewardItem1Num, RewardUIData.ITEM_ICON_TEXT_ID, string.Empty, rewardDataByKey.RewardItem1ID, rewardDataByKey.RewardItem1Level);
                    this._rankRewardDataList.Add(item);
                }
                if (rewardDataByKey.RewardItem2ID > 0)
                {
                    RewardUIData data9 = new RewardUIData(ResourceType.Item, rewardDataByKey.RewardItem2Num, RewardUIData.ITEM_ICON_TEXT_ID, string.Empty, rewardDataByKey.RewardItem2ID, rewardDataByKey.RewardItem2Level);
                    this._rankRewardDataList.Add(data9);
                }
                if (rewardDataByKey.RewardItem3ID > 0)
                {
                    RewardUIData data10 = new RewardUIData(ResourceType.Item, rewardDataByKey.RewardItem3Num, RewardUIData.ITEM_ICON_TEXT_ID, string.Empty, rewardDataByKey.RewardItem3ID, rewardDataByKey.RewardItem3Level);
                    this._rankRewardDataList.Add(data10);
                }
                if (rewardDataByKey.RewardItem4ID > 0)
                {
                    RewardUIData data11 = new RewardUIData(ResourceType.Item, rewardDataByKey.RewardItem4Num, RewardUIData.ITEM_ICON_TEXT_ID, string.Empty, rewardDataByKey.RewardItem4ID, rewardDataByKey.RewardItem4Level);
                    this._rankRewardDataList.Add(data11);
                }
                if (rewardDataByKey.RewardItem5ID > 0)
                {
                    RewardUIData data12 = new RewardUIData(ResourceType.Item, rewardDataByKey.RewardItem5Num, RewardUIData.ITEM_ICON_TEXT_ID, string.Empty, rewardDataByKey.RewardItem5ID, rewardDataByKey.RewardItem5Level);
                    this._rankRewardDataList.Add(data12);
                }
            }
        }
예제 #26
0
 private void ShowDetailDialog(RewardUIData data)
 {
     UIUtil.ShowResourceDetail(data);
 }