示例#1
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);
        }
        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);
                }
            }
        }
示例#3
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)
            {
            }
        }
示例#4
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);
         }
     }
 }
示例#5
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);
     }
 }
示例#6
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);
                }
            }
        }
示例#7
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;
            }
        }