示例#1
0
        public MailDetailDialogContext(MailDataItem mailData)
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "MailDetailDialogContext",
                viewPrefabPath = "UI/Menus/Dialog/MailDetailDialog"
            };

            base.config    = pattern;
            this._mailData = mailData;
        }
示例#2
0
        private void OnMailCheckBtnClick(MailDataItem mailData)
        {
            Singleton <MailModule> .Instance.SetMailAsOld(mailData);

            if (mailData.type == 3)
            {
                Singleton <MailModule> .Instance.SetMailRead(mailData);
            }
            this.SetupView();
            Singleton <MainUIManager> .Instance.ShowDialog(new MailDetailDialogContext(mailData), UIType.Any);
        }
示例#3
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);
        }
示例#4
0
 public static int CompareToTimeDesc(MailDataItem lobj, MailDataItem robj)
 {
     if (lobj.hasAttachment && !robj.hasAttachment)
     {
         return(-1);
     }
     if (!lobj.hasAttachment && robj.hasAttachment)
     {
         return(1);
     }
     if (!Singleton <MailModule> .Instance.IsMailRead(lobj) && Singleton <MailModule> .Instance.IsMailRead(robj))
     {
         return(-1);
     }
     if (Singleton <MailModule> .Instance.IsMailRead(lobj) && !Singleton <MailModule> .Instance.IsMailRead(robj))
     {
         return(1);
     }
     return(robj.time.CompareTo(lobj.time));
 }
示例#5
0
 private void OnMailGetBtnClick(MailDataItem mailData)
 {
     if (< > f__am$cache5 == null)
     {