示例#1
0
 public static void SetSelectedConceptCard(ConceptCardData data)
 {
     GetConceptCardListWindow.ClearSelectedConceptCard();
     if (data == null || data.Param == null)
     {
         return;
     }
     GetConceptCardListWindow.s_SelectedConceptCardID = data.Param.iname;
 }
示例#2
0
        private void OnListItemSelect(GameObject go)
        {
            ConceptCardIcon componentInChildren = (ConceptCardIcon)go.GetComponentInChildren <ConceptCardIcon>();

            if (!Object.op_Inequality((Object)componentInChildren, (Object)null) || componentInChildren.ConceptCard == null)
            {
                return;
            }
            GlobalVars.SelectedConceptCardData.Set(componentInChildren.ConceptCard);
            GetConceptCardListWindow.SetSelectedConceptCard(componentInChildren.ConceptCard);
            FlowNode_GameObject.ActivateOutputLinks((Component)this, 100);
        }
示例#3
0
        public override void OnActivate(int pinID)
        {
            switch (pinID)
            {
            case 0:
                MailWindow.MailReadRequestData dataOfClass = DataSource.FindDataOfClass <MailWindow.MailReadRequestData>(((Component)this).get_gameObject(), (MailWindow.MailReadRequestData)null);
                if (Network.Mode == Network.EConnectMode.Offline)
                {
                    this.ActivateOutputLinks(21);
                    ((Behaviour)this).set_enabled(false);
                    break;
                }
                List <MailData> currentMails = MonoSingleton <GameManager> .Instance.Player.CurrentMails;
                List <MailData> mailDataList = new List <MailData>();
                List <long>     ids          = new List <long>((IEnumerable <long>)dataOfClass.mailIDs);
                List <MailData> all          = currentMails.FindAll((Predicate <MailData>)(md =>
                {
                    if (!ids.Contains(md.mid))
                    {
                        return(false);
                    }
                    ids.Remove(md.mid);
                    return(true);
                }));
                if (all.Count < 1)
                {
                    this.ActivateOutputLinks(21);
                    ((Behaviour)this).set_enabled(false);
                    break;
                }
                List <GiftData> giftDataList = new List <GiftData>();
                using (FlowNode_ReadMail2.HaveCheckScope haveCheckScope = new FlowNode_ReadMail2.HaveCheckScope())
                {
                    using (List <MailData> .Enumerator enumerator = all.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            MailData current = enumerator.Current;
                            if (haveCheckScope.CheckReceivable(current))
                            {
                                mailDataList.Add(current);
                                if (current.gifts != null)
                                {
                                    for (int index = 0; index < current.gifts.Length; ++index)
                                    {
                                        if (current.gifts[index] != null)
                                        {
                                            giftDataList.Add(current.gifts[index]);
                                        }
                                    }
                                }
                                haveCheckScope.AddCurrentNum(current);
                            }
                        }
                    }
                }
                if (giftDataList.Count >= 1)
                {
                    GlobalVars.UnitGetReward = new UnitGetParam(giftDataList.ToArray());
                }
                if (mailDataList.Count < 1)
                {
                    this.ActivateOutputLinks(23);
                    ((Behaviour)this).set_enabled(false);
                    break;
                }
                this.mReceiveStatus = mailDataList.Count >= all.Count ? FlowNode_ReadMail2.ReceiveStatus.Recieve : FlowNode_ReadMail2.ReceiveStatus.NotReceiveSome;
                long[] mailids = new long[mailDataList.Count];
                for (int index = 0; index < mailDataList.Count; ++index)
                {
                    mailids[index] = mailDataList[index].mid;
                }
                this.ExecRequest((WebAPI) new ReqMailRead(mailids, dataOfClass.isPeriod, dataOfClass.page, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                break;

            case 5:
            case 6:
            case 7:
            case 8:
                string str = GlobalVars.UnlockUnitID;
                if (pinID == 5)
                {
                    str = GlobalVars.UnlockUnitID;
                    if (!string.IsNullOrEmpty(str))
                    {
                        GlobalVars.UnitGetReward = new UnitGetParam(MonoSingleton <GameManager> .Instance.GetItemParam(str));
                    }
                }
                else if (pinID == 6)
                {
                    str = GlobalVars.ItemSelectListItemData.iiname;
                }
                else if (pinID == 7)
                {
                    str = GlobalVars.ArtifactListItem.iname;
                }
                else if (pinID == 8)
                {
                    str = GetConceptCardListWindow.GetSelectedConceptCard();
                    GetConceptCardListWindow.ClearSelectedConceptCard();
                }
                this.mReceiveStatus = FlowNode_ReadMail2.ReceiveStatus.Recieve;
                if (Network.Mode == Network.EConnectMode.Offline)
                {
                    ((Behaviour)this).set_enabled(false);
                    this.Success();
                    break;
                }
                this.ExecRequest((WebAPI) new ReqMailRead((long)GlobalVars.SelectedMailUniqueID, (int)GlobalVars.SelectedMailPeriod == 1, (int)GlobalVars.SelectedMailPage, str, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                break;
            }
        }