예제 #1
0
        private void SetRewordData(MailData[] mail_datas)
        {
            if (mail_datas == null || mail_datas.Length <= 0)
            {
                return;
            }
            RewardData rewardData1 = new RewardData();

            for (int index = 0; index < mail_datas.Length; ++index)
            {
                MailData mailData = mail_datas[index];
                if (mailData != null)
                {
                    RewardData rewardData2 = this.GiftDataToRewardData(mailData.gifts);
                    using (Dictionary <string, GiftRecieveItemData> .ValueCollection.Enumerator enumerator = rewardData2.GiftRecieveItemDataDic.Values.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            GiftRecieveItemData current = enumerator.Current;
                            rewardData1.AddReward(current);
                        }
                    }
                    rewardData1.Exp        += rewardData2.Exp;
                    rewardData1.Stamina    += rewardData2.Stamina;
                    rewardData1.Coin       += rewardData2.Coin;
                    rewardData1.Gold       += rewardData2.Gold;
                    rewardData1.ArenaMedal += rewardData2.ArenaMedal;
                    rewardData1.MultiCoin  += rewardData2.MultiCoin;
                    rewardData1.KakeraCoin += rewardData2.KakeraCoin;
                }
            }
            GlobalVars.LastReward.Set(rewardData1);
        }
예제 #2
0
 private string MakeTomorrowText(GiftRecieveItemData todaysBonusItem, GiftRecieveItemData tomorrowBonusItem)
 {
     return(LocalizedText.Get(todaysBonusItem == null || !(todaysBonusItem.iname == tomorrowBonusItem.iname) ? (string.IsNullOrEmpty(this.TommorowTextID1) ? (string.IsNullOrEmpty(this.TableID) ? "sys.LOGBO_TOMMOROW" : "sys.LOGBO_" + this.TableID.ToUpper() + "_TOMMOROW") : this.TommorowTextID1) : (string.IsNullOrEmpty(this.TommorowTextID2) ? (string.IsNullOrEmpty(this.TableID) ? "sys.LOGBO_TOMMOROW2" : "sys.LOGBO_" + this.TableID.ToUpper() + "_TOMMOROW2") : this.TommorowTextID2), new object[1]
     {
         (object)tomorrowBonusItem.name
     }));
 }
예제 #3
0
 private string GetPopupMessage(GiftRecieveItemData item)
 {
     if (item == null)
     {
         return((string)null);
     }
     return(LocalizedText.Get("sys.LOGBO_POPUP_MESSAGE", (object)item.name, (object)item.num));
 }
예제 #4
0
        private void FlipTodaysItem()
        {
            if (this.mLoginBonusCount <= 0 || this.mItems.Count < this.mLoginBonusCount)
            {
                return;
            }
            int            index = Math.Max(this.mLoginBonusCount - 1, 0);
            ListItemEvents mItem = this.mItems[index];

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.BonusParticleEffect, (UnityEngine.Object)null))
            {
                UIUtility.SpawnParticle(this.BonusParticleEffect, ((Component)mItem).get_transform() as RectTransform, new Vector2(0.5f, 0.5f));
            }
            GiftRecieveItemData dataOfClass    = DataSource.FindDataOfClass <GiftRecieveItemData>(((Component)mItem).get_gameObject(), (GiftRecieveItemData)null);
            ListItemEvents      listItemEvents = (ListItemEvents)UnityEngine.Object.Instantiate <ListItemEvents>((M0)this.Item_Taken);

            DataSource.Bind <GiftRecieveItemData>(((Component)listItemEvents).get_gameObject(), dataOfClass);
            ((Component)listItemEvents).get_transform().SetParent(((Component)mItem).get_transform().get_parent(), false);
            ((Component)listItemEvents).get_transform().SetSiblingIndex(((Component)mItem).get_transform().GetSiblingIndex());
            listItemEvents.OnSelect = new ListItemEvents.ListItemEvent(this.OnItemSelect);
            GiftRecieveItem componentInChildren = (GiftRecieveItem)((Component)listItemEvents).GetComponentInChildren <GiftRecieveItem>();

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)componentInChildren, (UnityEngine.Object)null))
            {
                componentInChildren.UpdateValue();
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TodayBadge, (UnityEngine.Object)null))
            {
                ((Transform)this.TodayBadge).SetParent(((Component)listItemEvents).get_transform(), false);
            }
            UnityEngine.Object.Destroy((UnityEngine.Object)((Component)mItem).get_gameObject());
            ((Component)listItemEvents).get_gameObject().SetActive(true);
            Transform child = ((Component)listItemEvents).get_transform().FindChild(this.CheckName);

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)child, (UnityEngine.Object)null))
            {
                Animator component = (Animator)((Component)child).GetComponent <Animator>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                {
                    ((Behaviour)component).set_enabled(true);
                }
            }
            if (index == 0)
            {
                this.DisableFirstDayHiddenOject(((Component)listItemEvents).get_gameObject());
            }
            this.mItems[index] = listItemEvents;
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Message, (UnityEngine.Object)null))
            {
                this.StartCoroutine(this.DelayPopupMessage());
            }
            else
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 13);
            }
        }
예제 #5
0
 private string GetGainLastItemMessage(GiftRecieveItemData item)
 {
     if (item == null)
     {
         return((string)null);
     }
     return(LocalizedText.Get("sys.LOGBO_GAIN_LASTITEM", new object[1]
     {
         (object)item.name
     }));
 }
예제 #6
0
        private void AddCurrentNum(GiftRecieveItemData data)
        {
            if (this.currentNums == null || !this.currentNums.ContainsKey(data.type))
            {
                return;
            }
            Dictionary <GiftTypes, int> currentNums;
            GiftTypes type;

            (currentNums = this.currentNums)[type = data.type] = currentNums[type] + data.num;
        }
예제 #7
0
        private RewardData GiftDataToRewardData(GiftData[] giftDatas)
        {
            RewardData rewardData = new RewardData();

            rewardData.Exp        = 0;
            rewardData.Stamina    = 0;
            rewardData.MultiCoin  = 0;
            rewardData.KakeraCoin = 0;
            GameManager instance = MonoSingleton <GameManager> .Instance;

            for (int index = 0; index < giftDatas.Length; ++index)
            {
                GiftData giftData = giftDatas[index];
                rewardData.Coin       += giftData.coin;
                rewardData.Gold       += giftData.gold;
                rewardData.ArenaMedal += giftData.arenacoin;
                rewardData.MultiCoin  += giftData.multicoin;
                rewardData.KakeraCoin += giftData.kakeracoin;
                if (giftData.iname != null)
                {
                    if (giftData.CheckGiftTypeIncluded(GiftTypes.Artifact))
                    {
                        ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(giftData.iname);

                        if (artifactParam != null)
                        {
                            if (rewardData.GiftRecieveItemDataDic.ContainsKey(giftData.iname))
                            {
                                rewardData.GiftRecieveItemDataDic[giftData.iname].num += giftData.num;
                            }
                            else
                            {
                                GiftRecieveItemData giftRecieveItemData = new GiftRecieveItemData();
                                giftRecieveItemData.Set(giftData.iname, GiftTypes.Artifact, artifactParam.rareini, giftData.num);
                                rewardData.GiftRecieveItemDataDic.Add(giftData.iname, giftRecieveItemData);
                            }
                        }
                    }
                    else
                    {
                        ItemData itemData = new ItemData();
                        if (itemData.Setup(0L, giftData.iname, giftData.num))
                        {
                            rewardData.Items.Add(itemData);
                            ItemData itemDataByItemId = instance.Player.FindItemDataByItemID(itemData.Param.iname);
                            int      num = itemDataByItemId == null ? 0 : itemDataByItemId.Num;
                            rewardData.ItemsBeforeAmount.Add(num);
                        }
                    }
                }
            }
            return(rewardData);
        }
예제 #8
0
 private void AddReward(string iname, GiftTypes giftTipe, int rarity, int num)
 {
     if (this.GiftRecieveItemDataDic.ContainsKey(iname))
     {
         this.GiftRecieveItemDataDic[iname].num += num;
     }
     else
     {
         GiftRecieveItemData giftRecieveItemData = new GiftRecieveItemData();
         giftRecieveItemData.Set(iname, giftTipe, rarity, num);
         this.GiftRecieveItemDataDic.Add(iname, giftRecieveItemData);
     }
 }
예제 #9
0
 public void AddReward(GiftRecieveItemData giftRecieveItemData)
 {
     if (giftRecieveItemData == null)
     {
         return;
     }
     if (this.GiftRecieveItemDataDic.ContainsKey(giftRecieveItemData.iname))
     {
         this.GiftRecieveItemDataDic[giftRecieveItemData.iname].num += giftRecieveItemData.num;
     }
     else
     {
         this.GiftRecieveItemDataDic.Add(giftRecieveItemData.iname, giftRecieveItemData);
     }
 }
예제 #10
0
        private bool CheckRecievable(RewardData reward)
        {
            int num = 0;

            using (Dictionary <string, GiftRecieveItemData> .ValueCollection.Enumerator enumerator = reward.GiftRecieveItemDataDic.Values.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    GiftRecieveItemData current = enumerator.Current;
                    if (current.type == GiftTypes.Artifact)
                    {
                        num += this.currentNums[GiftTypes.Artifact] + current.num;
                    }
                }
            }
            return(num < (int)MonoSingleton <GameManager> .Instance.MasterParam.FixParam.ArtifactBoxCap);
        }
예제 #11
0
        private void OnItemSelect(GameObject go)
        {
            GiftRecieveItemData dataOfClass = DataSource.FindDataOfClass <GiftRecieveItemData>(go, (GiftRecieveItemData)null);

            if (dataOfClass == null)
            {
                return;
            }
            if (dataOfClass.type == GiftTypes.Item)
            {
                GlobalVars.SelectedItemID = dataOfClass.iname;
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 14);
            }
            else if (dataOfClass.type == GiftTypes.ConceptCard)
            {
                ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(dataOfClass.iname);
                GlobalVars.SelectedConceptCardData.Set(cardDataForDisplay);
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 15);
            }
            else
            {
                DebugUtility.LogError(string.Format("不明な種類のログインボーナスが設定されています。{0} => {1}個", (object)dataOfClass.iname, (object)dataOfClass.num));
            }
        }
예제 #12
0
        private void Start()
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            Json_LoginBonus[] jsonLoginBonusArray = instance.Player.FindLoginBonuses(this.TableID);
            this.mLoginBonusCount = instance.Player.LoginCountWithType(this.TableID);
            GiftRecieveItemData        giftRecieveItemData1    = (GiftRecieveItemData)null;
            GiftRecieveItemData        giftRecieveItemData2    = (GiftRecieveItemData)null;
            List <GiftRecieveItemData> giftRecieveItemDataList = new List <GiftRecieveItemData>();
            bool flag1 = false;

            if (this.DebugItems != null && this.DebugItems.Length > 0)
            {
                jsonLoginBonusArray   = this.DebugItems;
                this.mLoginBonusCount = this.DebugBonusCount;
            }
            if (jsonLoginBonusArray != null)
            {
                for (int index = 0; index < jsonLoginBonusArray.Length; ++index)
                {
                    GiftRecieveItemData data = new GiftRecieveItemData();
                    giftRecieveItemDataList.Add(data);
                    string str = jsonLoginBonusArray[index].iname;
                    int    num = jsonLoginBonusArray[index].num;
                    if (string.IsNullOrEmpty(str) && jsonLoginBonusArray[index].coin > 0)
                    {
                        str = "$COIN";
                        num = jsonLoginBonusArray[index].coin;
                    }
                    if (!string.IsNullOrEmpty(str))
                    {
                        ItemParam itemParam = instance.MasterParam.GetItemParam(str, false);
                        if (itemParam != null)
                        {
                            data.Set(str, GiftTypes.Item, itemParam.rare, num);
                            data.name = itemParam.name;
                        }
                        ConceptCardParam conceptCardParam = instance.MasterParam.GetConceptCardParam(str);
                        if (conceptCardParam != null)
                        {
                            data.Set(str, GiftTypes.ConceptCard, conceptCardParam.rare, num);
                            data.name = conceptCardParam.name;
                        }
                        if (itemParam == null && conceptCardParam == null)
                        {
                            DebugUtility.LogError(string.Format("不明な識別子が報酬として設定されています。itemID => {0}", (object)str));
                        }
                        if (index == this.mLoginBonusCount - 1)
                        {
                            giftRecieveItemData1 = data;
                            if (jsonLoginBonusArray[index].vip != null && jsonLoginBonusArray[index].vip.lv > 0)
                            {
                                flag1 = true;
                            }
                        }
                        else if (index == this.mLoginBonusCount)
                        {
                            giftRecieveItemData2 = data;
                        }
                        ListItemEvents listItemEvents1 = index >= this.mLoginBonusCount - 1 ? this.Item_Normal : this.Item_Taken;
                        if (!Object.op_Equality((Object)listItemEvents1, (Object)null) && !Object.op_Equality((Object)this.ItemList, (Object)null))
                        {
                            ListItemEvents listItemEvents2 = (ListItemEvents)Object.Instantiate <ListItemEvents>((M0)listItemEvents1);
                            DataSource.Bind <GiftRecieveItemData>(((Component)listItemEvents2).get_gameObject(), data);
                            if (Object.op_Equality((Object)listItemEvents1, (Object)this.Item_Normal) && Object.op_Inequality((Object)this.VIPBadge, (Object)null) && (jsonLoginBonusArray[index].vip != null && jsonLoginBonusArray[index].vip.lv > 0))
                            {
                                LoginBonusVIPBadge loginBonusVipBadge = (LoginBonusVIPBadge)Object.Instantiate <LoginBonusVIPBadge>((M0)this.VIPBadge);
                                if (Object.op_Inequality((Object)loginBonusVipBadge.VIPRank, (Object)null))
                                {
                                    loginBonusVipBadge.VIPRank.set_text(jsonLoginBonusArray[index].vip.lv.ToString());
                                }
                                ((Component)loginBonusVipBadge).get_transform().SetParent(((Component)listItemEvents2).get_transform(), false);
                                ((RectTransform)((Component)loginBonusVipBadge).get_transform()).set_anchoredPosition(Vector2.get_zero());
                                ((Component)loginBonusVipBadge).get_gameObject().SetActive(true);
                            }
                            if (Object.op_Inequality((Object)this.TodayBadge, (Object)null) && index == this.mLoginBonusCount - 1)
                            {
                                ((Transform)this.TodayBadge).SetParent(((Component)listItemEvents2).get_transform(), false);
                                this.TodayBadge.set_anchoredPosition(Vector2.get_zero());
                                ((Component)this.TodayBadge).get_gameObject().SetActive(true);
                            }
                            else if (Object.op_Inequality((Object)this.TommorowBadge, (Object)null) && index == this.mLoginBonusCount)
                            {
                                ((Transform)this.TommorowBadge).SetParent(((Component)listItemEvents2).get_transform(), false);
                                this.TommorowBadge.set_anchoredPosition(Vector2.get_zero());
                                ((Component)this.TommorowBadge).get_gameObject().SetActive(true);
                            }
                            if (index < this.mLoginBonusCount - 1)
                            {
                                Transform child = ((Component)listItemEvents2).get_transform().FindChild(this.CheckName);
                                if (Object.op_Inequality((Object)child, (Object)null))
                                {
                                    Animator component = (Animator)((Component)child).GetComponent <Animator>();
                                    if (Object.op_Inequality((Object)component, (Object)null))
                                    {
                                        ((Behaviour)component).set_enabled(false);
                                    }
                                }
                            }
                            Transform transform = this.ItemList.get_transform();
                            if (this.PositionList != null && this.PositionList.Length > index && Object.op_Inequality((Object)this.PositionList[index], (Object)null))
                            {
                                transform = this.PositionList[index].get_transform();
                            }
                            if (index == 0)
                            {
                                this.DisableFirstDayHiddenOject(((Component)listItemEvents2).get_gameObject());
                            }
                            ((Component)listItemEvents2).get_transform().SetParent(transform, false);
                            ((Component)listItemEvents2).get_gameObject().SetActive(true);
                            ((GiftRecieveItem)((Component)listItemEvents2).GetComponentInChildren <GiftRecieveItem>()).UpdateValue();
                            this.mItems.Add(listItemEvents2);
                        }
                    }
                }
            }
            bool flag2 = instance.Player.IsLastLoginBonus(this.TableID);

            if (jsonLoginBonusArray != null && this.mLoginBonusCount == jsonLoginBonusArray.Length)
            {
                flag2 = true;
            }
            if (Object.op_Inequality((Object)this.Today, (Object)null) && giftRecieveItemData1 != null)
            {
                this.Today.set_text(this.MakeTodayText(giftRecieveItemData1));
            }
            if (Object.op_Inequality((Object)this.TodayItem, (Object)null))
            {
                DataSource.Bind <GiftRecieveItemData>(this.TodayItem.get_gameObject(), giftRecieveItemData1);
                ((GiftRecieveItem)this.TodayItem.get_gameObject().GetComponentInChildren <GiftRecieveItem>()).UpdateValue();
            }
            if (Object.op_Inequality((Object)this.TommorowItem, (Object)null))
            {
                DataSource.Bind <GiftRecieveItemData>(this.TommorowItem.get_gameObject(), giftRecieveItemData2);
                ((GiftRecieveItem)this.TommorowItem.get_gameObject().GetComponentInChildren <GiftRecieveItem>()).UpdateValue();
            }
            if (Object.op_Inequality((Object)this.Tommorow, (Object)null) && !flag2 && giftRecieveItemData2 != null)
            {
                this.Tommorow.set_text(this.MakeTomorrowText(giftRecieveItemData1, giftRecieveItemData2));
            }
            else if (Object.op_Inequality((Object)this.TommorowRow, (Object)null))
            {
                this.Tommorow.set_text(this.MakeLastText());
            }
            if (Object.op_Inequality((Object)this.VIPBonusRow, (Object)null))
            {
                this.VIPBonusRow.SetActive(flag1);
            }
            if (flag2)
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 12);
            }
            this.StartCoroutine(this.WaitLoadAsync());
        }
예제 #13
0
 public override void Complete(WWWResult www)
 {
     if (Network.IsError)
     {
         this.m_Node.OnFailed();
     }
     else
     {
         DebugMenu.Log("API", this.url + ":" + www.text);
         WebAPI.JSON_BodyResponse <FlowNode_ReqPresentList.Api_PresentListExec.Json> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqPresentList.Api_PresentListExec.Json> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         bool flag = false;
         if (jsonObject.body != null)
         {
             if (jsonObject.body.player != null)
             {
                 MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.player);
             }
             if (jsonObject.body.items != null)
             {
                 MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.items);
             }
             if (jsonObject.body.presents != null)
             {
                 RewardData rewardData = new RewardData();
                 for (int index = 0; index < jsonObject.body.presents.Length; ++index)
                 {
                     FlowNode_ReqPresentList.Api_PresentListExec.JsonItem present = jsonObject.body.presents[index];
                     if (present != null)
                     {
                         RewardData dataToRewardData = this.ReceiveDataToRewardData(present);
                         if (dataToRewardData != null)
                         {
                             rewardData.Exp        += dataToRewardData.Exp;
                             rewardData.Stamina    += dataToRewardData.Stamina;
                             rewardData.Coin       += dataToRewardData.Coin;
                             rewardData.Gold       += dataToRewardData.Gold;
                             rewardData.ArenaMedal += dataToRewardData.ArenaMedal;
                             rewardData.MultiCoin  += dataToRewardData.MultiCoin;
                             rewardData.KakeraCoin += dataToRewardData.KakeraCoin;
                             using (Dictionary <string, GiftRecieveItemData> .ValueCollection.Enumerator enumerator = dataToRewardData.GiftRecieveItemDataDic.Values.GetEnumerator())
                             {
                                 while (enumerator.MoveNext())
                                 {
                                     GiftRecieveItemData current = enumerator.Current;
                                     rewardData.AddReward(current);
                                 }
                             }
                             flag = true;
                         }
                     }
                 }
                 GlobalVars.LastReward.Set(rewardData);
                 if (rewardData != null)
                 {
                     MonoSingleton <GameManager> .Instance.Player.OnGoldChange(rewardData.Gold);
                 }
                 MonoSingleton <GameManager> .Instance.Player.ValidFriendPresent = false;
             }
         }
         Network.RemoveAPI();
         if (flag)
         {
             this.Success();
         }
         else
         {
             this.Failed();
         }
     }
 }
예제 #14
0
        public virtual void Refresh()
        {
            if (this.UseGlobalVar)
            {
                DataSource.Bind <RewardData>(((Component)this).get_gameObject(), (RewardData)GlobalVars.LastReward);
            }
            RewardData dataOfClass = DataSource.FindDataOfClass <RewardData>(((Component)this).get_gameObject(), (RewardData)null);

            GameUtility.DestroyGameObjects(this.mItems);
            this.mItems.Clear();
            if (dataOfClass == null)
            {
                return;
            }
            if (Object.op_Inequality((Object)this.ArenaMedalRow, (Object)null))
            {
                this.ArenaMedalRow.SetActive(dataOfClass.ArenaMedal > 0);
            }
            if (Object.op_Inequality((Object)this.MultiCoinRow, (Object)null))
            {
                this.MultiCoinRow.SetActive(dataOfClass.MultiCoin > 0);
            }
            if (Object.op_Inequality((Object)this.KakeraCoinRow, (Object)null))
            {
                this.KakeraCoinRow.SetActive(dataOfClass.KakeraCoin > 0);
            }
            if (Object.op_Inequality((Object)this.ExpRow, (Object)null))
            {
                this.ExpRow.SetActive(dataOfClass.Exp > 0);
            }
            if (Object.op_Inequality((Object)this.GoldRow, (Object)null))
            {
                this.GoldRow.SetActive(dataOfClass.Gold > 0);
            }
            if (Object.op_Inequality((Object)this.CoinRow, (Object)null))
            {
                this.CoinRow.SetActive(dataOfClass.Coin > 0);
            }
            if (Object.op_Inequality((Object)this.StaminaRow, (Object)null))
            {
                this.StaminaRow.SetActive(dataOfClass.Stamina > 0);
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
            if (Object.op_Inequality((Object)this.ItemSeparator, (Object)null))
            {
                this.ItemSeparator.SetActive(dataOfClass.Items.Count > 0);
            }
            if (Object.op_Inequality((Object)this.ArtifactTemplate, (Object)null))
            {
                Transform transform = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.ArtifactTemplate.get_transform().get_parent() : this.ItemList.get_transform();
                using (Dictionary <string, GiftRecieveItemData> .ValueCollection.Enumerator enumerator = dataOfClass.GiftRecieveItemDataDic.Values.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        GiftRecieveItemData current    = enumerator.Current;
                        GameObject          gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ArtifactTemplate);
                        this.mItems.Add(gameObject);
                        DataSource.Bind <GiftRecieveItemData>(gameObject, current);
                        gameObject.get_transform().SetParent(transform, false);
                        gameObject.SetActive(true);
                    }
                }
            }
            if (Object.op_Inequality((Object)this.ItemTemplate, (Object)null))
            {
                Transform itemParent = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.ItemTemplate.get_transform().get_parent() : this.ItemList.get_transform();
                this.RefreshItems(dataOfClass, itemParent, this.ItemTemplate);
            }
            if (!Object.op_Inequality((Object)this.ArtifactTemplate2, (Object)null))
            {
                return;
            }
            Transform parent = this.ArtifactTemplate2.get_transform().get_parent();

            this.RefreshArtifacts(dataOfClass, parent, this.ArtifactTemplate2);
        }
예제 #15
0
        public virtual void Refresh()
        {
            if (this.UseGlobalVar)
            {
                DataSource.Bind <RewardData>(((Component)this).get_gameObject(), (RewardData)GlobalVars.LastReward);
            }
            RewardData dataOfClass = DataSource.FindDataOfClass <RewardData>(((Component)this).get_gameObject(), (RewardData)null);

            GameUtility.DestroyGameObjects(this.mItems);
            this.mItems.Clear();
            if (dataOfClass == null)
            {
                return;
            }
            if (Object.op_Inequality((Object)this.ArenaMedalRow, (Object)null))
            {
                this.ArenaMedalRow.SetActive(dataOfClass.ArenaMedal > 0);
            }
            if (Object.op_Inequality((Object)this.MultiCoinRow, (Object)null))
            {
                this.MultiCoinRow.SetActive(dataOfClass.MultiCoin > 0);
            }
            if (Object.op_Inequality((Object)this.KakeraCoinRow, (Object)null))
            {
                this.KakeraCoinRow.SetActive(dataOfClass.KakeraCoin > 0);
            }
            if (Object.op_Inequality((Object)this.ExpRow, (Object)null))
            {
                this.ExpRow.SetActive(dataOfClass.Exp > 0);
            }
            if (Object.op_Inequality((Object)this.GoldRow, (Object)null))
            {
                this.GoldRow.SetActive(dataOfClass.Gold > 0);
            }
            if (Object.op_Inequality((Object)this.CoinRow, (Object)null))
            {
                this.CoinRow.SetActive(dataOfClass.Coin > 0);
            }
            if (Object.op_Inequality((Object)this.StaminaRow, (Object)null))
            {
                this.StaminaRow.SetActive(dataOfClass.Stamina > 0);
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
            if (Object.op_Inequality((Object)this.ItemSeparator, (Object)null))
            {
                this.ItemSeparator.SetActive(dataOfClass.Items.Count > 0);
            }
            if (Object.op_Inequality((Object)this.ArtifactTemplate, (Object)null))
            {
                Transform transform = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.ArtifactTemplate.get_transform().get_parent() : this.ItemList.get_transform();
                using (Dictionary <string, GiftRecieveItemData> .ValueCollection.Enumerator enumerator = dataOfClass.GiftRecieveItemDataDic.Values.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        GiftRecieveItemData current    = enumerator.Current;
                        GameObject          gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ArtifactTemplate);
                        this.mItems.Add(gameObject);
                        DataSource.Bind <GiftRecieveItemData>(gameObject, current);
                        gameObject.get_transform().SetParent(transform, false);
                        gameObject.SetActive(true);
                    }
                }
            }
            if (!Object.op_Inequality((Object)this.ItemTemplate, (Object)null))
            {
                return;
            }
            Transform transform1 = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.ItemTemplate.get_transform().get_parent() : this.ItemList.get_transform();
            Transform transform2 = (Transform)null;

            if (Object.op_Inequality((Object)this.EventCoinTemplate, (Object)null))
            {
                transform2 = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.EventCoinTemplate.get_transform().get_parent() : this.ItemList.get_transform();
            }
            List <ItemParam> itemParamList = (List <ItemParam>)null;

            for (int index = 0; index < dataOfClass.Items.Count; ++index)
            {
                ItemData   data = dataOfClass.Items[index];
                GameObject gameObject;
                if (data.ItemType != EItemType.EventCoin || Object.op_Equality((Object)transform2, (Object)null))
                {
                    gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ItemTemplate);
                    gameObject.get_transform().SetParent(transform1, false);
                }
                else
                {
                    gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.EventCoinTemplate);
                    gameObject.get_transform().SetParent(transform2, false);
                }
                this.mItems.Add(gameObject);
                DataSource.Bind <ItemData>(gameObject, data);
                gameObject.SetActive(true);
                if (!this.UseBindDataOnly)
                {
                    if (itemParamList == null)
                    {
                        itemParamList = new List <ItemParam>();
                    }
                    itemParamList.Add(data.Param);
                }
            }
        }
예제 #16
0
        private void OnAllReadAccept()
        {
            if (this.mUnreadMails.Count < 1)
            {
                return;
            }
            this.RefreshCurrentNums();
            RewardData rewardData1 = new RewardData();
            List <MailList.ItemListEntity> itemListEntityList = new List <MailList.ItemListEntity>();
            int num1 = 0;

            for (int index1 = 0; index1 < this.mUnreadMails.Count && num1 < this.MaxReadCount; ++index1)
            {
                MailData dataOfClass = DataSource.FindDataOfClass <MailData>(this.mUnreadMails[index1], (MailData)null);
                if (dataOfClass != null)
                {
                    RewardData rewardData2 = this.GiftDataToRewardData(dataOfClass.gifts);
                    if (this.CheckRecievable(rewardData2))
                    {
                        ++num1;
                        using (Dictionary <string, GiftRecieveItemData> .ValueCollection.Enumerator enumerator = rewardData2.GiftRecieveItemDataDic.Values.GetEnumerator())
                        {
                            while (enumerator.MoveNext())
                            {
                                GiftRecieveItemData current = enumerator.Current;
                                if (rewardData1.GiftRecieveItemDataDic.ContainsKey(current.iname))
                                {
                                    rewardData1.GiftRecieveItemDataDic[current.iname].num += current.num;
                                }
                                else
                                {
                                    rewardData1.GiftRecieveItemDataDic.Add(current.iname, current);
                                }
                                this.AddCurrentNum(current);
                            }
                        }
                        rewardData1.Exp        += rewardData2.Exp;
                        rewardData1.Stamina    += rewardData2.Stamina;
                        rewardData1.Coin       += rewardData2.Coin;
                        rewardData1.Gold       += rewardData2.Gold;
                        rewardData1.ArenaMedal += rewardData2.ArenaMedal;
                        rewardData1.MultiCoin  += rewardData2.MultiCoin;
                        rewardData1.KakeraCoin += rewardData2.KakeraCoin;
                        for (int index2 = 0; index2 < rewardData2.Items.Count; ++index2)
                        {
                            ItemData itemData = rewardData2.Items[index2];
                            if (itemListEntityList.Count > 0)
                            {
                                bool flag = false;
                                for (int index3 = 0; index3 < itemListEntityList.Count; ++index3)
                                {
                                    if (itemListEntityList[index3].Item.ItemID == itemData.ItemID)
                                    {
                                        itemListEntityList[index3].Num += itemData.Num;
                                        flag = true;
                                        break;
                                    }
                                }
                                if (!flag)
                                {
                                    itemListEntityList.Add(new MailList.ItemListEntity(itemData.Num, itemData));
                                }
                            }
                            else
                            {
                                itemListEntityList.Add(new MailList.ItemListEntity(itemData.Num, itemData));
                            }
                        }
                    }
                }
            }
            GameManager instance = MonoSingleton <GameManager> .Instance;

            for (int index = 0; index < itemListEntityList.Count; ++index)
            {
                MailList.ItemListEntity itemListEntity = itemListEntityList[index];
                ItemData itemDataByItemId = instance.Player.FindItemDataByItemID(itemListEntity.Item.Param.iname);
                int      num2             = itemDataByItemId == null ? 0 : itemDataByItemId.Num;
                rewardData1.ItemsBeforeAmount.Add(num2);
                if (itemListEntity.Item.HaveCap < itemListEntity.Num)
                {
                    itemListEntity.Item.Gain(itemListEntity.Item.HaveCap);
                    rewardData1.Items.Add(itemListEntity.Item);
                    int      num3     = itemListEntity.Num - itemListEntity.Item.HaveCap;
                    ItemData itemData = new ItemData();
                    if (itemData.Setup(itemListEntity.Item.UniqueID, itemListEntity.Item.Param, num3))
                    {
                        rewardData1.Items.Add(itemData);
                        rewardData1.ItemsBeforeAmount.Add(itemData.HaveCap);
                    }
                }
                else
                {
                    itemListEntity.Item.Gain(itemListEntity.Num - itemListEntity.Item.Num);
                    rewardData1.Items.Add(itemListEntity.Item);
                }
            }
            GlobalVars.LastReward.Set(rewardData1);
            this.UpdateItems();
        }
예제 #17
0
        private void Start()
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            Json_LoginBonus[] jsonLoginBonusArray;
            if (this.IsConfigWindow)
            {
                jsonLoginBonusArray   = instance.Player.LoginBonus28days.bonuses;
                this.mLoginBonusCount = instance.Player.LoginBonus28days.count;
                this.mNotifyUnits     = instance.Player.LoginBonus28days.bonus_units;
            }
            else
            {
                jsonLoginBonusArray   = instance.Player.FindLoginBonuses(this.TableID);
                this.mLoginBonusCount = instance.Player.LoginCountWithType(this.TableID);
                this.mNotifyUnits     = instance.Player.GetLoginBonuseUnitIDs(this.TableID);
            }
            GiftRecieveItemData        data1 = (GiftRecieveItemData)null;
            GiftRecieveItemData        data2 = (GiftRecieveItemData)null;
            GiftRecieveItemData        data3 = (GiftRecieveItemData)null;
            List <GiftRecieveItemData> giftRecieveItemDataList = new List <GiftRecieveItemData>();

            if (this.DebugItems != null && this.DebugItems.Length > 0)
            {
                jsonLoginBonusArray   = this.DebugItems;
                this.mLoginBonusCount = this.DebugBonusCount;
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RemainingCount, (UnityEngine.Object)null))
            {
                this.RemainingCount.set_text(Math.Max(28 - this.mLoginBonusCount, 0).ToString());
            }
            this.mCurrentWeak = Math.Max(this.mLoginBonusCount - 1, 0) / 7;
            if (jsonLoginBonusArray != null && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Item_Normal, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ItemList, (UnityEngine.Object)null))
            {
                for (int index1 = 0; index1 < jsonLoginBonusArray.Length; ++index1)
                {
                    GiftRecieveItemData data4 = new GiftRecieveItemData();
                    giftRecieveItemDataList.Add(data4);
                    string str  = jsonLoginBonusArray[index1].iname;
                    int    num1 = jsonLoginBonusArray[index1].num;
                    if (string.IsNullOrEmpty(str) && jsonLoginBonusArray[index1].coin > 0)
                    {
                        str  = "$COIN";
                        num1 = jsonLoginBonusArray[index1].coin;
                    }
                    if (!string.IsNullOrEmpty(str))
                    {
                        ItemParam itemParam = instance.MasterParam.GetItemParam(str, false);
                        if (itemParam != null)
                        {
                            data4.Set(str, GiftTypes.Item, itemParam.rare, num1);
                            data4.name = itemParam.name;
                        }
                        ConceptCardParam conceptCardParam = instance.MasterParam.GetConceptCardParam(str);
                        if (conceptCardParam != null)
                        {
                            data4.Set(str, GiftTypes.ConceptCard, conceptCardParam.rare, num1);
                            data4.name = conceptCardParam.name;
                        }
                        if (itemParam == null && conceptCardParam == null)
                        {
                            DebugUtility.LogError(string.Format("不明な識別子が報酬として設定されています。itemID => {0}", (object)str));
                        }
                        int            num2           = this.mLoginBonusCount - (!this.IsConfigWindow ? 1 : 0);
                        ListItemEvents listItemEvents = (ListItemEvents)UnityEngine.Object.Instantiate <ListItemEvents>(index1 >= num2 ? (M0)this.Item_Normal : (M0)this.Item_Taken);
                        listItemEvents.OnSelect = new ListItemEvents.ListItemEvent(this.OnItemSelect);
                        DataSource.Bind <GiftRecieveItemData>(((Component)listItemEvents).get_gameObject(), data4);
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TodayBadge, (UnityEngine.Object)null) && index1 == this.mLoginBonusCount - 1)
                        {
                            ((Transform)this.TodayBadge).SetParent(((Component)listItemEvents).get_transform(), false);
                            this.TodayBadge.set_anchoredPosition(Vector2.get_zero());
                            ((Component)this.TodayBadge).get_gameObject().SetActive(true);
                        }
                        else if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TommorowBadge, (UnityEngine.Object)null) && index1 == this.mLoginBonusCount)
                        {
                            ((Transform)this.TommorowBadge).SetParent(((Component)listItemEvents).get_transform(), false);
                            this.TommorowBadge.set_anchoredPosition(Vector2.get_zero());
                            ((Component)this.TommorowBadge).get_gameObject().SetActive(true);
                        }
                        if (index1 < this.mLoginBonusCount - 1)
                        {
                            Transform child = ((Component)listItemEvents).get_transform().FindChild(this.CheckName);
                            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)child, (UnityEngine.Object)null))
                            {
                                Animator component = (Animator)((Component)child).GetComponent <Animator>();
                                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                                {
                                    ((Behaviour)component).set_enabled(false);
                                }
                            }
                        }
                        Transform transform = this.ItemList.get_transform();
                        int       index2    = index1 % 7;
                        if (this.PositionList != null && this.PositionList.Length > index2 && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PositionList[index2], (UnityEngine.Object)null))
                        {
                            transform = this.PositionList[index2].get_transform();
                        }
                        if (index1 == 0)
                        {
                            this.DisableFirstDayHiddenOject(((Component)listItemEvents).get_gameObject());
                        }
                        int num3 = index1 / 7;
                        ((Component)listItemEvents).get_transform().SetParent(transform, false);
                        ((Component)listItemEvents).get_gameObject().SetActive(num3 == this.mCurrentWeak);
                        if (num3 == this.mCurrentWeak)
                        {
                            ((GiftRecieveItem)((Component)listItemEvents).GetComponentInChildren <GiftRecieveItem>()).UpdateValue();
                        }
                        this.mItems.Add(listItemEvents);
                    }
                }
                int index            = this.mLoginBonusCount - 1;
                int mLoginBonusCount = this.mLoginBonusCount;
                if (index >= 0 && index < jsonLoginBonusArray.Length)
                {
                    data2 = giftRecieveItemDataList[index];
                }
                if (mLoginBonusCount >= 0 && mLoginBonusCount < jsonLoginBonusArray.Length)
                {
                    data3 = giftRecieveItemDataList[mLoginBonusCount];
                }
                data1 = DataSource.FindDataOfClass <GiftRecieveItemData>(((Component)this.mItems[this.mItems.Count - 1]).get_gameObject(), (GiftRecieveItemData)null);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PopupMessage, (UnityEngine.Object)null))
            {
                this.PopupMessage.set_text(this.GetPopupMessage(data2));
            }
            bool flag = instance.Player.IsLastLoginBonus(this.TableID);

            if (jsonLoginBonusArray != null && this.mLoginBonusCount == jsonLoginBonusArray.Length)
            {
                flag = true;
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RemainingCounter, (UnityEngine.Object)null))
            {
                this.RemainingCounter.SetActive(!flag);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TodayItem, (UnityEngine.Object)null))
            {
                DataSource.Bind <GiftRecieveItemData>(this.TodayItem.get_gameObject(), data2);
                ((GiftRecieveItem)this.TodayItem.get_gameObject().GetComponentInChildren <GiftRecieveItem>()).UpdateValue();
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TommorowItem, (UnityEngine.Object)null))
            {
                DataSource.Bind <GiftRecieveItemData>(this.TommorowItem.get_gameObject(), data3);
                ((GiftRecieveItem)this.TommorowItem.get_gameObject().GetComponentInChildren <GiftRecieveItem>()).UpdateValue();
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LastItem, (UnityEngine.Object)null))
            {
                DataSource.Bind <GiftRecieveItemData>(this.LastItem.get_gameObject(), data1);
                ((GiftRecieveItem)this.LastItem.get_gameObject().GetComponentInChildren <GiftRecieveItem>()).UpdateValue();
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.GainLastItemMessage, (UnityEngine.Object)null))
            {
                this.GainLastItemMessage.set_text(this.GetGainLastItemMessage(data1));
            }
            if (flag)
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 12);
            }
            if (this.WeakToggle != null)
            {
                for (int index1 = 0; index1 < this.WeakToggle.Count; ++index1)
                {
                    // ISSUE: object of a compiler-generated type is created
                    // ISSUE: variable of a compiler-generated type
                    LoginBonusWindow28days.\u003CStart\u003Ec__AnonStorey35A startCAnonStorey35A = new LoginBonusWindow28days.\u003CStart\u003Ec__AnonStorey35A();
                    // ISSUE: reference to a compiler-generated field
                    startCAnonStorey35A.\u003C\u003Ef__this = this;
                    int index2 = index1 * 7 + 6;
                    if (index2 < this.mItems.Count)
                    {
                        ItemData dataOfClass = DataSource.FindDataOfClass <ItemData>(((Component)this.mItems[index2]).get_gameObject(), (ItemData)null);
                        DataSource.Bind <ItemData>(((Component)this.WeakToggle[index1]).get_gameObject(), dataOfClass);
                    }
                    // ISSUE: reference to a compiler-generated field
                    startCAnonStorey35A.index = index1;
                    this.WeakToggle[index1].set_isOn(index1 == this.mCurrentWeak);
                    // ISSUE: method pointer
                    ((UnityEvent <bool>) this.WeakToggle[index1].onValueChanged).AddListener(new UnityAction <bool>((object)startCAnonStorey35A, __methodptr(\u003C\u003Em__35B)));
                }
            }
            string unit_iname = (string)null;

            if (this.mNotifyUnits != null && this.mNotifyUnits.Length > 0)
            {
                unit_iname = this.mNotifyUnits[new Random().Next() % this.mNotifyUnits.Length];
            }
            if (!string.IsNullOrEmpty(this.DebugNotifyUnitID))
            {
                unit_iname = this.DebugNotifyUnitID;
            }
            if (!string.IsNullOrEmpty(unit_iname))
            {
                this.mCurrentUnit = new UnitData();
                this.mCurrentUnit.Setup(unit_iname, 0, 0, 0, (string)null, 1, EElement.None, 0);
                GameObject gameObject = new GameObject("Preview", new System.Type[1]
                {
                    typeof(UnitPreview)
                });
                this.mCurrentPreview = (UnitPreview)gameObject.GetComponent <UnitPreview>();
                this.mCurrentPreview.DefaultLayer = GameUtility.LayerHidden;
                this.mCurrentPreview.SetupUnit(this.mCurrentUnit, -1);
                gameObject.get_transform().SetParent(this.PreviewParent, false);
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PreviewCamera, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PreviewImage, (UnityEngine.Object)null))
                {
                    int num = Mathf.FloorToInt((float)Screen.get_height() * 0.8f);
                    this.mPreviewUnitRT = RenderTexture.GetTemporary(num, num, 16, (RenderTextureFormat)7);
                    this.PreviewCamera.set_targetTexture(this.mPreviewUnitRT);
                    this.PreviewImage.set_texture((Texture)this.mPreviewUnitRT);
                }
                GameUtility.SetLayer((Component)this.mCurrentPreview, GameUtility.LayerCH, true);
            }
            this.StartCoroutine(this.WaitLoadAsync());
        }
예제 #18
0
        public void UpdateValue()
        {
            GiftRecieveItemData dataOfClass = DataSource.FindDataOfClass <GiftRecieveItemData>(((Component)this).get_gameObject(), (GiftRecieveItemData)null);

            if (dataOfClass == null)
            {
                return;
            }
            string path   = (string)null;
            Sprite sprite = (Sprite)null;
            string str1   = (string)null;
            string str2   = (string)null;

            switch (dataOfClass.type)
            {
            case GiftTypes.Item:
            case GiftTypes.Unit:
                ItemParam itemParam1 = MonoSingleton <GameManager> .Instance.GetItemParam(dataOfClass.iname);

                path   = this.GetIconPath(itemParam1);
                sprite = this.GetFrameSprite(itemParam1, dataOfClass.rarity);
                str1   = this.GetName(itemParam1);
                str2   = dataOfClass.num.ToString();
                break;

            case GiftTypes.Artifact:
                ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(dataOfClass.iname);

                path   = this.GetIconPath(artifactParam);
                sprite = this.GetFrameSprite(artifactParam, dataOfClass.rarity);
                str1   = this.GetName(artifactParam);
                str2   = dataOfClass.num.ToString();
                break;

            case GiftTypes.Award:
                ItemParam itemParam2 = MonoSingleton <GameManager> .Instance.GetAwardParam(dataOfClass.iname).ToItemParam();

                path             = this.GetIconPath(itemParam2);
                sprite           = this.GetFrameSprite(itemParam2, dataOfClass.rarity);
                str1             = LocalizedText.Get("sys.MAILBOX_ITEM_AWARD_RECEIVE") + this.GetName(itemParam2);
                this.HideNumText = false;
                break;
            }
            if (Object.op_Inequality((Object)this.Icon, (Object)null))
            {
                MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Icon, path);
            }
            if (Object.op_Inequality((Object)this.Frame, (Object)null))
            {
                this.Frame.set_sprite(sprite);
            }
            if (Object.op_Inequality((Object)this.NameText, (Object)null))
            {
                this.NameText.set_text(str1);
            }
            if (!Object.op_Inequality((Object)this.NumText, (Object)null))
            {
                return;
            }
            this.NumText.set_text(str2);
        }
예제 #19
0
 private string MakeTodayText(GiftRecieveItemData todaysBonusItem)
 {
     return(LocalizedText.Get(string.IsNullOrEmpty(this.TodayTextID) ? (string.IsNullOrEmpty(this.TableID) ? "sys.LOGBO_TODAY" : "sys.LOGBO_" + this.TableID.ToUpper() + "_TODAY") : this.TodayTextID, (object)todaysBonusItem.name, (object)todaysBonusItem.num, (object)this.mLoginBonusCount));
 }