private void Refresh()
        {
            TowerParam tower = MonoSingleton <GameManager> .Instance.FindTower(GlobalVars.SelectedTowerID);

            if (tower == null)
            {
                return;
            }
            TowerFloorParam towerFloor = MonoSingleton <GameManager> .Instance.FindTowerFloor(GlobalVars.SelectedQuestID);

            if (towerFloor == null)
            {
                return;
            }
            QuestParam questParam = towerFloor.GetQuestParam();

            if (questParam == null || questParam.bonusObjective == null)
            {
                return;
            }
            int clearMissionNum = questParam.GetClearMissionNum();
            int length          = questParam.bonusObjective.Length;

            if (questParam.IsMissionCompleteALL())
            {
                this.ClearConditionText01.set_text(string.Format(LocalizedText.Get("sys.TOWER_CLEAR_CINDITION_01_CLEAR"), (object)clearMissionNum, (object)length));
                this.ClearConditionImage01.ImageIndex = 0;
            }
            else
            {
                this.ClearConditionText01.set_text(string.Format(LocalizedText.Get("sys.TOWER_CLEAR_CINDITION_01"), (object)clearMissionNum, (object)length));
                this.ClearConditionImage01.ImageIndex = 1;
            }
            if (questParam.state == QuestStates.Cleared)
            {
                this.ClearConditionText02.set_text(LocalizedText.Get("sys.TOWER_CLEAR_CINDITION_02_CLEAR"));
                this.ClearConditionImage02.ImageIndex = 0;
            }
            else
            {
                this.ClearConditionText02.set_text(LocalizedText.Get("sys.TOWER_CLEAR_CINDITION_02"));
                this.ClearConditionImage02.ImageIndex = 1;
            }
            if (Object.op_Inequality((Object)this.TowerName, (Object)null))
            {
                this.TowerName.set_text(tower.name);
            }
            if (Object.op_Inequality((Object)this.TowerFloorNum, (Object)null))
            {
                this.TowerFloorNum.set_text(towerFloor.name);
            }
            this.CreateResetMissionItems(questParam);
            if (this.m_MissionListItems != null && this.m_MissionListItems.Count > 0)
            {
                GameUtility.SetGameObjectActive((Component)this.m_MissionListTitle, true);
            }
            else
            {
                GameUtility.SetGameObjectActive((Component)this.m_MissionListTitleNoItem, true);
                GameUtility.SetGameObjectActive((Component)this.m_MissionListParent, false);
            }
        }
Пример #2
0
        private void RefreshData()
        {
            GameManager       instance       = MonoSingleton <GameManager> .Instance;
            PlayerData        player         = instance.Player;
            List <GameObject> gameObjectList = new List <GameObject>();
            int versusTowerKey = player.VersusTowerKey;
            VersusTowerParam versusTowerParam = instance.GetCurrentVersusTowerParam(-1);

            if (versusTowerParam != null)
            {
                int num = 0;
                while (num < (int)versusTowerParam.RankupNum)
                {
                    GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.template);
                    if (!UnityEngine.Object.op_Equality((UnityEngine.Object)gameObject, (UnityEngine.Object)null))
                    {
                        gameObject.SetActive(true);
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.parent, (UnityEngine.Object)null))
                        {
                            gameObject.get_transform().SetParent(this.parent.get_transform(), false);
                        }
                        Transform child1 = gameObject.get_transform().FindChild("on");
                        Transform child2 = gameObject.get_transform().FindChild("off");
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)child1, (UnityEngine.Object)null))
                        {
                            ((Component)child1).get_gameObject().SetActive(versusTowerKey > 0);
                        }
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)child2, (UnityEngine.Object)null))
                        {
                            ((Component)child2).get_gameObject().SetActive(versusTowerKey <= 0);
                        }
                        gameObjectList.Add(gameObject);
                    }
                    ++num;
                    --versusTowerKey;
                }
                this.template.SetActive(false);
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.nowKey, (UnityEngine.Object)null))
                {
                    this.nowKey.set_text(GameUtility.HalfNum2FullNum(player.VersusTowerKey.ToString()));
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.maxKey, (UnityEngine.Object)null))
                {
                    this.maxKey.set_text(GameUtility.HalfNum2FullNum(versusTowerParam.RankupNum.ToString()));
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.floor, (UnityEngine.Object)null))
                {
                    this.floor.set_text(player.VersusTowerFloor.ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.winbonus, (UnityEngine.Object)null))
                {
                    this.winbonus.SetActive(player.VersusTowerWinBonus > 1);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.keyrateup, (UnityEngine.Object)null))
                {
                    this.keyrateup.SetActive(player.VersusTowerWinBonus > 0 && (int)versusTowerParam.RankupNum > 0);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.bonusRate, (UnityEngine.Object)null) && player.VersusTowerWinBonus > 0 && (int)versusTowerParam.WinNum > 0)
                {
                    this.bonusRate.set_text((((int)versusTowerParam.WinNum + (int)versusTowerParam.BonusNum) / (int)versusTowerParam.WinNum).ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.winCnt, (UnityEngine.Object)null))
                {
                    this.winCnt.set_text(player.VersusTowerWinBonus.ToString());
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.endAt, (UnityEngine.Object)null))
                {
                    DateTime dateTime = TimeManager.FromUnixTime(instance.VersusTowerMatchEndAt);
                    this.endAt.set_text(string.Format(LocalizedText.Get("sys.MULTI_VERSUS_END_AT"), (object)dateTime.Year, (object)dateTime.Month, (object)dateTime.Day, (object)dateTime.Hour, (object)dateTime.Minute));
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.keyinfo, (UnityEngine.Object)null))
                {
                    this.keyinfo.SetActive((int)versusTowerParam.RankupNum != 0);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.keyname, (UnityEngine.Object)null))
                {
                    this.keyname.SetActive((int)versusTowerParam.RankupNum != 0);
                }
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.lastfloor, (UnityEngine.Object)null))
                {
                    return;
                }
                this.lastfloor.SetActive((int)versusTowerParam.RankupNum == 0 && instance.VersusTowerMatchBegin);
            }
            else
            {
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.lastfloor, (UnityEngine.Object)null))
                {
                    return;
                }
                this.lastfloor.SetActive(false);
            }
        }
Пример #3
0
 private void Success()
 {
     ((Behaviour)this).set_enabled(false);
     UIUtility.SystemMessage(LocalizedText.Get("sys.CAPTION_TOWER_RECOVERED"), LocalizedText.Get("sys.MSG_TOWER_RECOVERED", new object[1]
     {
         (object)this.usedCoin.ToString()
     }), (UIUtility.DialogResultEvent)(go => this.ActivateOutputLinks(1)), (GameObject)null, false, -1);
 }
Пример #4
0
        public override void OnActivate(int pinID)
        {
            if (pinID != 0 && pinID != 5)
            {
                return;
            }
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            FlowNode_RequestFriend.\u003COnActivate\u003Ec__AnonStorey2D4 activateCAnonStorey2D4 = new FlowNode_RequestFriend.\u003COnActivate\u003Ec__AnonStorey2D4();
            if (pinID == 5)
            {
                this.is_all = true;
            }
            if (Network.Mode == Network.EConnectMode.Offline)
            {
                this.Success();
            }
            else
            {
                // ISSUE: reference to a compiler-generated field
                activateCAnonStorey2D4.fuid = (string)null;
                if (!string.IsNullOrEmpty(GlobalVars.SelectedFriendID))
                {
                    // ISSUE: reference to a compiler-generated field
                    activateCAnonStorey2D4.fuid = GlobalVars.SelectedFriendID;
                }
                else if (GlobalVars.FoundFriend != null && !string.IsNullOrEmpty(GlobalVars.FoundFriend.FUID))
                {
                    // ISSUE: reference to a compiler-generated field
                    activateCAnonStorey2D4.fuid = GlobalVars.FoundFriend.FUID;
                }
                if (pinID == 5)
                {
                    this.index = 0;
                    FriendWindowItem[] componentsInChildren = (FriendWindowItem[])((Component)this).GetComponentsInChildren <FriendWindowItem>();
                    if (componentsInChildren == null)
                    {
                        this.Success();
                        return;
                    }
                    this.FriendItemList.Clear();
                    for (int index = 0; index < componentsInChildren.Length; ++index)
                    {
                        if (componentsInChildren[index].IsOn)
                        {
                            this.FriendItemList.Add(componentsInChildren[index]);
                        }
                    }
                    if (this.FriendItemList.Count <= 0)
                    {
                        this.Success();
                        return;
                    }
                }
                if (this.is_all && this.FriendItemList != null && this.FriendItemList.Count > this.index)
                {
                    FriendWindowItem friendItem = this.FriendItemList[this.index];
                    // ISSUE: reference to a compiler-generated field
                    activateCAnonStorey2D4.fuid = friendItem.PlayerParam.FUID;
                }
                // ISSUE: reference to a compiler-generated field
                if (activateCAnonStorey2D4.fuid == null)
                {
                    this.Success();
                }
                else
                {
                    // ISSUE: reference to a compiler-generated method
                    FriendData friendData = MonoSingleton <GameManager> .Instance.Player.Friends.Find(new Predicate <FriendData>(activateCAnonStorey2D4.\u003C\u003Em__2C3));

                    if (friendData != null)
                    {
                        string empty = string.Empty;
                        if (friendData.State == FriendStates.Friend)
                        {
                            UIUtility.SystemMessage((string)null, LocalizedText.Get("sys.FRIEND_ALREADY_FRIEND"), (UIUtility.DialogResultEvent)(go => {}), (GameObject)null, false, -1);
                            return;
                        }
                        if (friendData.State == FriendStates.Follow)
                        {
                            UIUtility.SystemMessage((string)null, LocalizedText.Get("sys.FRIEND_ALREADY_FOLLOW"), (UIUtility.DialogResultEvent)(go => {}), (GameObject)null, false, -1);
                            return;
                        }
                    }
                    // ISSUE: reference to a compiler-generated field
                    this.ExecRequest((WebAPI) new ReqFriendReq(activateCAnonStorey2D4.fuid, new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback)));
                    ((Behaviour)this).set_enabled(true);
                }
            }
        }
Пример #5
0
        public override void OnActivate(int pinID)
        {
            switch (pinID)
            {
            case 10:
                if (!string.IsNullOrEmpty(this.parentName))
                {
                    this.parent = GameObject.Find(this.parentName);
                    if (Object.op_Equality((Object)this.parent, (Object)null))
                    {
                        DebugUtility.LogWarning("can not found gameObject:" + this.parentName);
                    }
                }
                string text = LocalizedText.Get(this.Text);
                if (this.richTag)
                {
                    text = LocalizedText.ReplaceTag(text);
                }
                GameSettings instance = GameSettings.Instance;
                Canvas       canvas   = UIUtility.PushCanvas(this.systemModal, this.systemModalPriority);
                if (Object.op_Inequality((Object)this.parent, (Object)null))
                {
                    ((Component)canvas).get_transform().SetParent(this.parent.get_transform());
                }
                this.m_Window = (Win_SysMessage_Flx)Object.Instantiate <Win_SysMessage_Flx>((M0)instance.Dialogs.SysMsgDialog);
                ((Component)this.m_Window).get_transform().SetParent(((Component)canvas).get_transform(), false);
                this.m_Window.Text_Message.set_text(text);
                this.m_Window.Initialize(this.input, this.bgAlpha);
                if (this.anim)
                {
                    this.m_Window.StartAnim();
                }
                if ((double)this.autoClose > 0.0)
                {
                    this.m_Window.AutoClose(this.autoClose);
                }
                if (Object.op_Implicit((Object)this.m_Window) && this.unscaledTime)
                {
                    Animator component = (Animator)((Component)this.m_Window).GetComponent <Animator>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        component.set_updateMode((AnimatorUpdateMode)2);
                    }
                }
                this.ActivateOutputLinks(100);
                break;

            case 11:
                if (Object.op_Equality((Object)this.m_Window, (Object)null))
                {
                    break;
                }
                if (Object.op_Inequality((Object)this.m_Window, (Object)null))
                {
                    this.m_Window.BeginClose();
                    this.m_Window = (Win_SysMessage_Flx)null;
                }
                this.ActivateOutputLinks(101);
                break;
            }
        }
Пример #6
0
        public void SetData(int idx = 0)
        {
            GameManager          instance    = MonoSingleton <GameManager> .Instance;
            MultiTowerFloorParam dataOfClass = DataSource.FindDataOfClass <MultiTowerFloorParam>(((Component)this).get_gameObject(), (MultiTowerFloorParam)null);
            int floor = (int)dataOfClass.floor;

            if (dataOfClass == null)
            {
                return;
            }
            int mtRound = MonoSingleton <GameManager> .Instance.GetMTRound(GlobalVars.SelectedMultiTowerFloor);

            List <MultiTowerRewardItem> mtFloorReward        = instance.GetMTFloorReward(dataOfClass.reward_id, mtRound);
            MultiTowerRewardItem        multiTowerRewardItem = mtFloorReward[idx];

            MultiTowerRewardItem.RewardType rewardType = MultiTowerRewardItem.RewardType.Item;
            string str = string.Empty;
            int    num = 0;

            if (idx >= 0 && idx < mtFloorReward.Count)
            {
                rewardType = multiTowerRewardItem.type;
                str        = multiTowerRewardItem.itemname;
                num        = multiTowerRewardItem.num;
            }
            if (Object.op_Inequality((Object)this.itemObj, (Object)null))
            {
                this.itemObj.SetActive(true);
            }
            if (Object.op_Inequality((Object)this.amountObj, (Object)null))
            {
                this.amountObj.SetActive(true);
            }
            if (Object.op_Inequality((Object)this.unitObj, (Object)null))
            {
                this.unitObj.SetActive(false);
            }
            switch (rewardType)
            {
            case MultiTowerRewardItem.RewardType.Item:
                if (Object.op_Inequality((Object)this.itemObj, (Object)null) && Object.op_Inequality((Object)this.amountObj, (Object)null))
                {
                    ArtifactIcon componentInChildren = (ArtifactIcon)this.itemObj.GetComponentInChildren <ArtifactIcon>();
                    if (Object.op_Inequality((Object)componentInChildren, (Object)null))
                    {
                        ((Behaviour)componentInChildren).set_enabled(false);
                    }
                    this.itemObj.SetActive(true);
                    DataSource component1 = (DataSource)this.itemObj.GetComponent <DataSource>();
                    if (Object.op_Inequality((Object)component1, (Object)null))
                    {
                        component1.Clear();
                    }
                    DataSource component2 = (DataSource)this.amountObj.GetComponent <DataSource>();
                    if (Object.op_Inequality((Object)component2, (Object)null))
                    {
                        component2.Clear();
                    }
                    ItemParam itemParam = instance.GetItemParam(str);
                    DataSource.Bind <ItemParam>(this.itemObj, itemParam);
                    ItemData data = new ItemData();
                    data.Setup(0L, itemParam, num);
                    DataSource.Bind <ItemData>(this.amountObj, data);
                    Transform child = this.itemObj.get_transform().FindChild("icon");
                    if (Object.op_Inequality((Object)child, (Object)null))
                    {
                        GameParameter component3 = (GameParameter)((Component)child).GetComponent <GameParameter>();
                        if (Object.op_Inequality((Object)component3, (Object)null))
                        {
                            ((Behaviour)component3).set_enabled(true);
                        }
                    }
                    GameParameter.UpdateAll(this.itemObj);
                    if (Object.op_Inequality((Object)this.iconParam, (Object)null))
                    {
                        this.iconParam.UpdateValue();
                    }
                    if (Object.op_Inequality((Object)this.frameParam, (Object)null))
                    {
                        this.frameParam.UpdateValue();
                    }
                    if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                    {
                        this.rewardName.set_text(itemParam.name + string.Format(LocalizedText.Get("sys.CROSS_NUM"), (object)num));
                        break;
                    }
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Coin:
                if (Object.op_Inequality((Object)this.itemTex, (Object)null))
                {
                    GameParameter component = (GameParameter)((Component)this.itemTex).GetComponent <GameParameter>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        ((Behaviour)component).set_enabled(false);
                    }
                    this.itemTex.set_texture(this.coinTex);
                }
                if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.coinBase, (Object)null))
                {
                    this.frameTex.set_sprite(this.coinBase);
                }
                if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                {
                    this.rewardName.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)num));
                }
                if (Object.op_Inequality((Object)this.amountObj, (Object)null))
                {
                    this.amountObj.SetActive(false);
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Artifact:
                if (Object.op_Inequality((Object)this.itemObj, (Object)null))
                {
                    DataSource component = (DataSource)this.itemObj.GetComponent <DataSource>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        component.Clear();
                    }
                    ArtifactParam artifactParam = instance.MasterParam.GetArtifactParam(str);
                    DataSource.Bind <ArtifactParam>(this.itemObj, artifactParam);
                    ArtifactIcon componentInChildren = (ArtifactIcon)this.itemObj.GetComponentInChildren <ArtifactIcon>();
                    if (Object.op_Inequality((Object)componentInChildren, (Object)null))
                    {
                        ((Behaviour)componentInChildren).set_enabled(true);
                        componentInChildren.UpdateValue();
                        if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                        {
                            this.rewardName.set_text(string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_ARTIFACT"), (object)artifactParam.name));
                        }
                        if (Object.op_Inequality((Object)this.amountObj, (Object)null))
                        {
                            this.amountObj.SetActive(false);
                            break;
                        }
                        break;
                    }
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Award:
                if (Object.op_Inequality((Object)this.itemObj, (Object)null) && Object.op_Inequality((Object)this.amountObj, (Object)null))
                {
                    ArtifactIcon componentInChildren = (ArtifactIcon)this.itemObj.GetComponentInChildren <ArtifactIcon>();
                    if (Object.op_Inequality((Object)componentInChildren, (Object)null))
                    {
                        ((Behaviour)componentInChildren).set_enabled(false);
                    }
                    this.itemObj.SetActive(true);
                    AwardParam awardParam = instance.GetAwardParam(str);
                    Transform  child      = this.itemObj.get_transform().FindChild("icon");
                    if (Object.op_Inequality((Object)child, (Object)null))
                    {
                        IconLoader iconLoader = GameUtility.RequireComponent <IconLoader>(((Component)child).get_gameObject());
                        if (!string.IsNullOrEmpty(awardParam.icon))
                        {
                            iconLoader.ResourcePath = AssetPath.ItemIcon(awardParam.icon);
                        }
                        GameParameter component = (GameParameter)((Component)child).GetComponent <GameParameter>();
                        if (Object.op_Inequality((Object)component, (Object)null))
                        {
                            ((Behaviour)component).set_enabled(false);
                        }
                    }
                    if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.coinBase, (Object)null))
                    {
                        this.frameTex.set_sprite(this.coinBase);
                    }
                    if (Object.op_Inequality((Object)this.amountObj, (Object)null))
                    {
                        this.amountObj.SetActive(false);
                        break;
                    }
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Unit:
                if (Object.op_Inequality((Object)this.unitObj, (Object)null))
                {
                    if (Object.op_Inequality((Object)this.itemObj, (Object)null))
                    {
                        this.itemObj.SetActive(false);
                    }
                    this.unitObj.SetActive(true);
                    UnitParam unitParam = instance.GetUnitParam(str);
                    DebugUtility.Assert(unitParam != null, "Invalid unit:" + str);
                    UnitData data = new UnitData();
                    data.Setup(str, 0, 1, 0, (string)null, 1, EElement.None, 0);
                    DataSource.Bind <UnitData>(this.unitObj, data);
                    GameParameter.UpdateAll(this.unitObj);
                    if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                    {
                        this.rewardName.set_text(string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_UNIT"), (object)unitParam.name));
                        break;
                    }
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Gold:
                if (Object.op_Inequality((Object)this.itemTex, (Object)null))
                {
                    GameParameter component = (GameParameter)((Component)this.itemTex).GetComponent <GameParameter>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        ((Behaviour)component).set_enabled(false);
                    }
                    this.itemTex.set_texture(this.goldTex);
                }
                if (Object.op_Inequality((Object)this.frameTex, (Object)null) && Object.op_Inequality((Object)this.goldBase, (Object)null))
                {
                    this.frameTex.set_sprite(this.goldBase);
                }
                if (Object.op_Inequality((Object)this.rewardName, (Object)null))
                {
                    this.rewardName.set_text(num.ToString() + LocalizedText.Get("sys.GOLD"));
                }
                if (Object.op_Inequality((Object)this.amountObj, (Object)null))
                {
                    this.amountObj.SetActive(false);
                    break;
                }
                break;
            }
            this.mIdx = idx;
            if (Object.op_Inequality((Object)this.currentMark, (Object)null))
            {
                this.currentMark.SetActive((int)dataOfClass.floor == floor);
            }
            if (Object.op_Inequality((Object)this.current_fil, (Object)null))
            {
                this.current_fil.SetActive((int)dataOfClass.floor == floor);
            }
            if (Object.op_Inequality((Object)this.clearMark, (Object)null))
            {
                this.clearMark.SetActive((int)dataOfClass.floor - 1 < floor);
            }
            if (!Object.op_Inequality((Object)this.cleared_fil, (Object)null))
            {
                return;
            }
            this.cleared_fil.SetActive((int)dataOfClass.floor - 1 < floor);
        }
Пример #7
0
        private void SetRewards(TowerRewardParam rewardParam)
        {
            if (rewardParam == null || Object.op_Equality((Object)this.RewardText, (Object)null))
            {
                return;
            }
            GameUtility.SetGameObjectActive(this.ItemRoot, false);
            GameUtility.SetGameObjectActive(this.ArtifactRoot, false);
            GameUtility.SetGameObjectActive(this.CoinRoot, false);
            GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

            using (List <TowerRewardItem> .Enumerator enumerator = rewardParam.GetTowerRewardItem().GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    TowerRewardItem current = enumerator.Current;
                    if (current.visible && current.type != TowerRewardItem.RewardType.Gold)
                    {
                        string str = string.Empty;
                        switch (current.type)
                        {
                        case TowerRewardItem.RewardType.Item:
                            ItemParam itemParam = instanceDirect.GetItemParam(current.iname);
                            if (itemParam != null)
                            {
                                str = itemParam.name;
                            }
                            DataSource.Bind <ItemParam>(this.ItemRoot, itemParam);
                            GameUtility.SetGameObjectActive(this.ItemRoot, true);
                            GameParameter.UpdateAll(this.ItemRoot);
                            break;

                        case TowerRewardItem.RewardType.Coin:
                            str = LocalizedText.Get("sys.COIN");
                            this.CoinRoot.get_gameObject().SetActive(true);
                            break;

                        case TowerRewardItem.RewardType.ArenaCoin:
                            str = LocalizedText.Get("sys.ARENA_COIN");
                            break;

                        case TowerRewardItem.RewardType.MultiCoin:
                            str = LocalizedText.Get("sys.MULTI_COIN");
                            break;

                        case TowerRewardItem.RewardType.KakeraCoin:
                            str = LocalizedText.Get("sys.PIECE_POINT");
                            break;

                        case TowerRewardItem.RewardType.Artifact:
                            ArtifactParam artifactParam = instanceDirect.MasterParam.GetArtifactParam(current.iname);
                            if (artifactParam != null)
                            {
                                str = artifactParam.name;
                            }
                            DataSource.Bind <ArtifactParam>(this.ArtifactRoot, artifactParam);
                            GameUtility.SetGameObjectActive(this.ArtifactRoot, true);
                            GameParameter.UpdateAll(this.ArtifactRoot);
                            break;
                        }
                        this.RewardText.set_text(string.Format("{0} × {1}", (object)str, (object)current.num));
                        break;
                    }
                }
            }
        }
Пример #8
0
        private void UpdateOwnValue()
        {
            GameManager    instance       = MonoSingleton <GameManager> .Instance;
            TowerResuponse towerResuponse = instance.TowerResuponse;
            TowerParam     tower          = instance.FindTower(towerResuponse.TowerID);

            if (towerResuponse != null)
            {
                bool flag = towerResuponse.speedRank != 0 && towerResuponse.techRank != 0;
                if (Object.op_Inequality((Object)this.ClearPage, (Object)null))
                {
                    this.ClearPage.get_gameObject().SetActive(flag);
                }
                if (Object.op_Inequality((Object)this.NotClearPage, (Object)null))
                {
                    this.NotClearPage.get_gameObject().SetActive(!flag);
                }
            }
            int rank     = !this.IsSpeed ? towerResuponse.techRank : towerResuponse.speedRank;
            int sameRank = this.GetSameRank(!this.IsSpeed ? towerResuponse.tec_score : towerResuponse.spd_score, rank);

            if (Object.op_Inequality((Object)this.OwnIcon, (Object)null))
            {
                if (sameRank <= this.SHOW_VIP_RANK)
                {
                    this.OwnIcon.set_sprite(this.mSheet.GetSprite((sameRank - 1).ToString()));
                }
                else
                {
                    this.OwnIcon.set_sprite(this.mSheet.GetSprite("normal"));
                }
            }
            if (Object.op_Inequality((Object)this.Ranking, (Object)null))
            {
                ((Component)this.Ranking).get_gameObject().SetActive(sameRank > this.SHOW_VIP_RANK);
                this.Ranking.set_text(sameRank.ToString() + LocalizedText.Get("sys.TOWER_RANK_LABEL"));
            }
            if (Object.op_Inequality((Object)this.OwnObj, (Object)null))
            {
                PlayerData player       = instance.Player;
                long       unitUniqueId = player.Partys[6].GetUnitUniqueID(0);
                DataSource.Bind <UnitData>(this.OwnObj, player.FindUnitDataByUniqueID(unitUniqueId));
            }
            if (Object.op_Inequality((Object)this.OwnSpeedObj, (Object)null))
            {
                this.OwnSpeedObj.get_gameObject().SetActive(this.IsSpeed);
            }
            if (Object.op_Inequality((Object)this.OwnTechObj, (Object)null))
            {
                this.OwnTechObj.get_gameObject().SetActive(!this.IsSpeed);
            }
            if (this.IsSpeed)
            {
                if (Object.op_Inequality((Object)this.OwnSpeedScore, (Object)null))
                {
                    this.OwnSpeedScore.set_text(towerResuponse.spd_score.ToString());
                }
            }
            else if (Object.op_Inequality((Object)this.OwnSpeedScore, (Object)null))
            {
                this.OwnTechScore.set_text(towerResuponse.tec_score.ToString());
            }
            if (!Object.op_Inequality((Object)this.OwnTotalScore, (Object)null))
            {
                return;
            }
            string empty = string.Empty;

            this.OwnTotalScore.set_sprite(this.mSheet.GetSprite(!this.IsSpeed ? instance.ConvertTowerScoreToRank(tower, towerResuponse.tec_score, TOWER_SCORE_TYPE.DIED) : instance.ConvertTowerScoreToRank(tower, towerResuponse.spd_score, TOWER_SCORE_TYPE.TURN)));
        }
Пример #9
0
        private void OnItemSelect(GameObject go)
        {
            TrophyParam dataOfClass = DataSource.FindDataOfClass <TrophyParam>(go, (TrophyParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            TrophyState trophyCounter = MonoSingleton <GameManager> .Instance.Player.GetTrophyCounter(dataOfClass);

            if (!trophyCounter.IsEnded && trophyCounter.IsCompleted)
            {
                if (dataOfClass.IsInvisibleStamina() || !dataOfClass.IsAvailablePeriod(TimeManager.ServerTime, true))
                {
                    UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.TROPHY_OUTDATED"), (UIUtility.DialogResultEvent)null, (GameObject)null, false, -1);
                    this.Refresh();
                }
                else
                {
                    GlobalVars.SelectedTrophy.Set(dataOfClass.iname);
                    RewardData rewardData = new RewardData(dataOfClass);
                    GlobalVars.LastReward.Set(rewardData);
                    GlobalVars.UnitGetReward = new UnitGetParam(rewardData.Items.ToArray());
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 100);
                }
            }
            else
            {
                QuestParam questParam = new QuestParam();
                switch (dataOfClass.Objectives[0].type)
                {
                case TrophyConditionTypes.winquest:
                case TrophyConditionTypes.playerlv:
                case TrophyConditionTypes.winquestsoldier:
                case TrophyConditionTypes.losequest:
                    QuestTypes quest_type1 = QuestTypes.Story;
                    if (!questParam.TransSectionGotoQuest(dataOfClass.Objectives[0].sval, out quest_type1, new UIUtility.DialogResultEvent(this.MsgBoxJumpToQuest)))
                    {
                        this.g_quest_type = quest_type1;
                        break;
                    }
                    QuestTypes questTypes = quest_type1;
                    switch (questTypes)
                    {
                    case QuestTypes.Event:
                        FlowNode_GameObject.ActivateOutputLinks((Component)this, 1007);
                        return;

                    case QuestTypes.Tower:
                        FlowNode_GameObject.ActivateOutputLinks((Component)this, 1026);
                        return;

                    default:
                        if (questTypes == QuestTypes.Multi)
                        {
                            FlowNode_GameObject.ActivateOutputLinks((Component)this, 1005);
                            return;
                        }
                        FlowNode_GameObject.ActivateOutputLinks((Component)this, 1001);
                        return;
                    }

                case TrophyConditionTypes.winelite:
                case TrophyConditionTypes.loseelite:
                    if (!questParam.TransSectionGotoElite(new UIUtility.DialogResultEvent(this.MsgBoxJumpToQuest)))
                    {
                        this.g_quest_type = QuestTypes.Story;
                        break;
                    }
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1001);
                    break;

                case TrophyConditionTypes.winevent:
                case TrophyConditionTypes.loseevent:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1007);
                    break;

                case TrophyConditionTypes.gacha:
                case TrophyConditionTypes.collectunits:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1000);
                    break;

                case TrophyConditionTypes.multiplay:
                case TrophyConditionTypes.winmulti:
                case TrophyConditionTypes.winmultimore:
                case TrophyConditionTypes.winmultiless:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1005);
                    break;

                case TrophyConditionTypes.ability:
                case TrophyConditionTypes.changeability:
                case TrophyConditionTypes.makeabilitylevel:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1025);
                    break;

                case TrophyConditionTypes.soubi:
                    this.GotoEquip();
                    break;

                case TrophyConditionTypes.buygold:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1004);
                    break;

                case TrophyConditionTypes.arena:
                case TrophyConditionTypes.winarena:
                case TrophyConditionTypes.losearena:
                    this.GotoArena();
                    break;

                case TrophyConditionTypes.review:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1029);
                    break;

                case TrophyConditionTypes.fggid:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1009);
                    break;

                case TrophyConditionTypes.unitlevel:
                case TrophyConditionTypes.evolutionnum:
                case TrophyConditionTypes.joblevel:
                case TrophyConditionTypes.upunitlevel:
                case TrophyConditionTypes.makeunitlevel:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1025);
                    break;

                case TrophyConditionTypes.unitequip:
                case TrophyConditionTypes.upjoblevel:
                case TrophyConditionTypes.makejoblevel:
                case TrophyConditionTypes.totaljoblv11:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1025);
                    break;

                case TrophyConditionTypes.limitbreak:
                case TrophyConditionTypes.evoltiontimes:
                case TrophyConditionTypes.changejob:
                case TrophyConditionTypes.totalunitlvs:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1025);
                    break;

                case TrophyConditionTypes.buyatshop:
                    this.GotoShop(dataOfClass);
                    break;

                case TrophyConditionTypes.artifacttransmute:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1021);
                    break;

                case TrophyConditionTypes.artifactstrength:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1021);
                    break;

                case TrophyConditionTypes.artifactevolution:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1021);
                    break;

                case TrophyConditionTypes.wintower:
                case TrophyConditionTypes.losetower:
                    QuestTypes quest_type2 = QuestTypes.Tower;
                    if (!questParam.TransSectionGotoTower(dataOfClass.Objectives[0].sval, out quest_type2))
                    {
                        break;
                    }
                    if (quest_type2 == QuestTypes.Event)
                    {
                        FlowNode_GameObject.ActivateOutputLinks((Component)this, 1007);
                        break;
                    }
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1026);
                    break;

                case TrophyConditionTypes.vs:
                case TrophyConditionTypes.vswin:
                    this.GotoVersus();
                    break;

                case TrophyConditionTypes.fblogin:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1040);
                    break;
                }
            }
        }
Пример #10
0
 private void Start()
 {
     if (Object.op_Equality((Object)this.lineuplist, (Object)null) || Object.op_Equality((Object)this.title, (Object)null))
     {
         return;
     }
     this.title.set_text(LocalizedText.Get(MonoSingleton <GameManager> .Instance.Player.GetShopName(GlobalVars.ShopType)) + " " + LocalizedText.Get("sys.TITLE_SHOP_LINEUP"));
 }
Пример #11
0
        private void UpdateValue(ListItemEvents obj, int num, TowerResuponse.TowerRankParam param, bool isSpeed)
        {
            if (Object.op_Equality((Object)this.mSheet, (Object)null))
            {
                return;
            }
            GameManager    instance       = MonoSingleton <GameManager> .Instance;
            TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;
            TowerParam     tower          = instance.FindTower(towerResuponse.TowerID);

            DataSource.Bind <TowerResuponse.TowerRankParam>(((Component)obj).get_gameObject(), param);
            Transform child1 = ((Component)obj).get_transform().FindChild("body");

            if (!Object.op_Inequality((Object)child1, (Object)null))
            {
                return;
            }
            Transform child2 = ((Component)child1).get_transform().FindChild("ranking");

            if (Object.op_Inequality((Object)child2, (Object)null))
            {
                Image component = (Image)((Component)child2).GetComponent <Image>();
                if (Object.op_Inequality((Object)component, (Object)null))
                {
                    if (num < this.SHOW_VIP_RANK)
                    {
                        component.set_sprite(this.mSheet.GetSprite(num.ToString()));
                    }
                    else
                    {
                        component.set_sprite(this.mSheet.GetSprite("normal"));
                    }
                }
            }
            Transform child3 = ((Component)child1).get_transform().FindChild("rank");

            if (Object.op_Inequality((Object)child3, (Object)null))
            {
                Text component = (Text)((Component)child3).GetComponent <Text>();
                if (Object.op_Inequality((Object)component, (Object)null))
                {
                    if (num < this.SHOW_VIP_RANK)
                    {
                        component.set_text(string.Empty);
                    }
                    else
                    {
                        component.set_text((num + 1).ToString() + LocalizedText.Get("sys.TOWER_RANK_LABEL"));
                    }
                }
            }
            Transform child4 = ((Component)child1).get_transform().FindChild("Text_player");

            if (Object.op_Inequality((Object)child4, (Object)null))
            {
                Text component = (Text)((Component)child4).GetComponent <Text>();
                if (Object.op_Inequality((Object)component, (Object)null))
                {
                    component.set_text(param.name);
                }
            }
            Transform child5 = ((Component)child1).get_transform().FindChild("player_level");

            if (Object.op_Inequality((Object)child5, (Object)null))
            {
                Text component = (Text)((Component)child5).GetComponent <Text>();
                if (Object.op_Inequality((Object)component, (Object)null))
                {
                    component.set_text(LocalizedText.Get("sys.TOWER_RANK_LBL_LV") + param.lv.ToString());
                }
            }
            if (isSpeed)
            {
                Transform child6 = ((Component)child1).get_transform().FindChild("speed");
                if (Object.op_Inequality((Object)child6, (Object)null))
                {
                    Transform child7 = ((Component)child6).get_transform().FindChild("speed_cnt");
                    if (Object.op_Inequality((Object)child7, (Object)null))
                    {
                        Text component = (Text)((Component)child7).GetComponent <Text>();
                        if (Object.op_Inequality((Object)component, (Object)null))
                        {
                            component.set_text(param.score.ToString());
                        }
                    }
                    ((Component)child6).get_gameObject().SetActive(true);
                }
                string    rank   = instance.ConvertTowerScoreToRank(tower, param.score, TOWER_SCORE_TYPE.TURN);
                Transform child8 = ((Component)child1).get_transform().FindChild("score_img");
                if (!Object.op_Inequality((Object)child8, (Object)null))
                {
                    return;
                }
                Image component1 = (Image)((Component)child8).GetComponent <Image>();
                if (!Object.op_Inequality((Object)component1, (Object)null))
                {
                    return;
                }
                component1.set_sprite(this.mSheet.GetSprite(rank));
            }
            else
            {
                Transform child6 = ((Component)child1).get_transform().FindChild("tech");
                if (Object.op_Inequality((Object)child6, (Object)null))
                {
                    Transform child7 = ((Component)child6).get_transform().FindChild("tech_cnt");
                    if (Object.op_Inequality((Object)child7, (Object)null))
                    {
                        Text component = (Text)((Component)child7).GetComponent <Text>();
                        if (Object.op_Inequality((Object)component, (Object)null))
                        {
                            component.set_text(param.score.ToString());
                        }
                    }
                    ((Component)child6).get_gameObject().SetActive(true);
                }
                string    rank   = instance.ConvertTowerScoreToRank(tower, param.score, TOWER_SCORE_TYPE.DIED);
                Transform child8 = ((Component)child1).get_transform().FindChild("score_img");
                if (!Object.op_Inequality((Object)child8, (Object)null))
                {
                    return;
                }
                Image component1 = (Image)((Component)child8).GetComponent <Image>();
                if (!Object.op_Inequality((Object)component1, (Object)null))
                {
                    return;
                }
                component1.set_sprite(this.mSheet.GetSprite(rank));
            }
        }
Пример #12
0
        private void LateUpdate()
        {
            if (this.mTextID != null)
            {
                return;
            }
            Text component = (Text)((Component)this).GetComponent <Text>();

            if (Object.op_Equality((Object)component, (Object)null))
            {
                return;
            }
            switch (GlobalVars.ShopType)
            {
            case EShopType.Normal:
                this.mTextID = this.Normal;
                break;

            case EShopType.Tabi:
                this.mTextID = this.Tabi;
                break;

            case EShopType.Kimagure:
                this.mTextID = this.Kimagure;
                break;

            case EShopType.Monozuki:
                this.mTextID = this.Monozuki;
                break;

            case EShopType.Tour:
                this.mTextID = this.Tour;
                break;

            case EShopType.Arena:
                this.mTextID = this.Arena;
                break;

            case EShopType.Multi:
                this.mTextID = this.Multi;
                break;

            case EShopType.AwakePiece:
                this.mTextID = this.AwakePiece;
                break;

            case EShopType.Artifact:
                this.mTextID = this.Artifact;
                break;

            case EShopType.Limited:
                this.mTextID = this.Limited;
                break;
            }
            if (string.IsNullOrEmpty(this.mTextID))
            {
                this.mTextID = string.Empty;
            }
            else
            {
                component.set_text(LocalizedText.Get(this.mTextID));
            }
        }
Пример #13
0
        public override void OnActivate(int pinID)
        {
            switch (pinID)
            {
            case 0:
                GameManager instance = MonoSingleton <GameManager> .Instance;
                ((Behaviour)this).set_enabled(true);
                if ((long)GlobalVars.BtlID != 0L)
                {
                    if ((instance.Player.TutorialFlags & 1L) == 0L)
                    {
                        this.ActivateOutputLinks(3);
                        break;
                    }
                    QuestTypes questType = GlobalVars.QuestType;
                    switch (questType)
                    {
                    case QuestTypes.Tower:
                        UIUtility.ConfirmBox(LocalizedText.Get("sys.CONFIRM_RESUMEQUEST"), new UIUtility.DialogResultEvent(this.OnTowerResumeAccept), new UIUtility.DialogResultEvent(this.OnTowerResumeCancel), (GameObject)null, false, -1, (string)null, (string)null);
                        return;

                    case QuestTypes.VersusFree:
                    case QuestTypes.VersusRank:
                        UIUtility.ConfirmBox(LocalizedText.Get("sys.MULTI_VERSUS_CONFIRM_RESUMEQUEST"), new UIUtility.DialogResultEvent(this.OnVersusAccept), new UIUtility.DialogResultEvent(this.OnVersusResumeCancel), (GameObject)null, false, -1, (string)null, (string)null);
                        return;

                    case QuestTypes.MultiTower:
                        UIUtility.ConfirmBox(LocalizedText.Get("sys.MULTI_TOWER_CONFIRM_RESUMEQUEST"), new UIUtility.DialogResultEvent(this.OnMultiTowerAccept), new UIUtility.DialogResultEvent(this.OnMultiTowerResumeCancel), (GameObject)null, false, -1, (string)null, (string)null);
                        return;

                    default:
                        if (questType == QuestTypes.Multi)
                        {
                            UIUtility.ConfirmBox(LocalizedText.Get("sys.MULTI_CONFIRM_RESUMEQUEST"), new UIUtility.DialogResultEvent(this.OnMultiResumeAccept), new UIUtility.DialogResultEvent(this.OnMultiResumeCancel), (GameObject)null, false, -1, (string)null, (string)null);
                            return;
                        }
                        UIUtility.ConfirmBox(LocalizedText.Get("sys.CONFIRM_RESUMEQUEST"), new UIUtility.DialogResultEvent(this.OnResumeAccept), new UIUtility.DialogResultEvent(this.OnResumeCancel), (GameObject)null, false, -1, (string)null, (string)null);
                        return;
                    }
                }
                else
                {
                    BattleCore.RemoveSuspendData();
                    if ((instance.Player.TutorialFlags & 1L) != 0L)
                    {
                        GlobalVars.IsTutorialEnd = true;
                        if (MonoSingleton <GameManager> .Instance.AuthStatus == ReqFgGAuth.eAuthStatus.Synchronized)
                        {
                            this.LoadStartScene();
                            break;
                        }
                        this.ActivateOutputLinks(18);
                        break;
                    }
                    instance.UpdateTutorialStep();
                    if (instance.TutorialStep == 0 && GameUtility.IsDebugBuild)
                    {
                        if (GlobalVars.DebugIsPlayTutorial)
                        {
                            this.PlayTutorial();
                            break;
                        }
                        this.mSkipTutorial = true;
                        this.CompleteTutorial();
                        break;
                    }
                    this.PlayTutorial();
                    break;
                }

            case 1:
                MonoSingleton <GameManager> .Instance.CompleteTutorialStep();

                this.PlayTutorial();
                break;

            case 7:
                this.ClearMultiResumeData();
                break;

            case 8:
                this.ClearTowerResumeData();
                break;

            case 10:
                this.PlayTutorial();
                break;

            case 16:
                this.ClearVersusResumeData();
                break;

            case 17:
                this.LoadStartScene();
                break;

            case 20:
                this.ClearMultiTowerResumeData();
                break;
            }
        }
Пример #14
0
        public void Refresh()
        {
            ((Component)this).get_gameObject().SetActive(true);
            ((Component)this.ClearBadge).get_gameObject().SetActive(false);
            GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

            TrophyParam dataOfClass = DataSource.FindDataOfClass <TrophyParam>(((Component)this).get_gameObject(), (TrophyParam)null);

            if (UnityEngine.Object.op_Equality((UnityEngine.Object)instanceDirect, (UnityEngine.Object)null) || dataOfClass == null)
            {
                ((Component)this.ButtonHighlight.button).get_gameObject().SetActive(false);
                ((Component)this.ButtonNormal.button).get_gameObject().SetActive(false);
                ((Component)this.ButtonSecret.button).get_gameObject().SetActive(true);
            }
            else
            {
                TrophyState trophyCounter        = ChallengeMission.GetTrophyCounter(dataOfClass);
                ChallengeMissionItem.State state = ChallengeMissionItem.State.Challenge;
                if (trophyCounter.IsEnded)
                {
                    state = ChallengeMissionItem.State.Ended;
                }
                else if (trophyCounter.IsCompleted)
                {
                    state = ChallengeMissionItem.State.Clear;
                }
                ChallengeMissionItem.ButtonObject buttonObject;
                if (state == ChallengeMissionItem.State.Clear)
                {
                    ((Component)this.ButtonHighlight.button).get_gameObject().SetActive(true);
                    ((Component)this.ButtonNormal.button).get_gameObject().SetActive(false);
                    ((Component)this.ButtonSecret.button).get_gameObject().SetActive(false);
                    buttonObject = this.ButtonHighlight;
                }
                else
                {
                    ((Component)this.ButtonHighlight.button).get_gameObject().SetActive(false);
                    ((Component)this.ButtonNormal.button).get_gameObject().SetActive(true);
                    ((Component)this.ButtonSecret.button).get_gameObject().SetActive(false);
                    buttonObject = this.ButtonNormal;
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ClearBadge, (UnityEngine.Object)null))
                {
                    ((Component)this.ClearBadge).get_gameObject().SetActive(state == ChallengeMissionItem.State.Ended);
                }
                if (buttonObject != null && UnityEngine.Object.op_Inequality((UnityEngine.Object)buttonObject.title, (UnityEngine.Object)null))
                {
                    buttonObject.title.set_text(dataOfClass.Name);
                }
                if (buttonObject != null && UnityEngine.Object.op_Inequality((UnityEngine.Object)buttonObject.button, (UnityEngine.Object)null))
                {
                    ((UnityEventBase)buttonObject.button.get_onClick()).RemoveAllListeners();
                    ((UnityEvent)buttonObject.button.get_onClick()).AddListener(this.OnClick);
                    ((Selectable)buttonObject.button).set_interactable(state != ChallengeMissionItem.State.Ended);
                }
                if (buttonObject != null && UnityEngine.Object.op_Inequality((UnityEngine.Object)buttonObject.reward, (UnityEngine.Object)null))
                {
                    if (dataOfClass.Gold != 0)
                    {
                        buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_GOLD"), (object)dataOfClass.Gold));
                        GameUtility.SetGameObjectActive((Component)buttonObject.icon, true);
                        GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, false);
                    }
                    else if (dataOfClass.Exp != 0)
                    {
                        buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_EXP"), (object)dataOfClass.Exp));
                        GameUtility.SetGameObjectActive((Component)buttonObject.icon, true);
                        GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, false);
                    }
                    else if (dataOfClass.Coin != 0)
                    {
                        buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)dataOfClass.Coin));
                        GameUtility.SetGameObjectActive((Component)buttonObject.icon, true);
                        GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, false);
                    }
                    else if (dataOfClass.Stamina != 0)
                    {
                        buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_STAMINA"), (object)dataOfClass.Stamina));
                        GameUtility.SetGameObjectActive((Component)buttonObject.icon, true);
                        GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, false);
                    }
                    else if (dataOfClass.Items != null && dataOfClass.Items.Length > 0)
                    {
                        GameUtility.SetGameObjectActive((Component)buttonObject.icon, true);
                        GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, false);
                        ItemParam itemParam = instanceDirect.GetItemParam(dataOfClass.Items[0].iname);
                        if (itemParam != null)
                        {
                            buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_ITEM"), (object)itemParam.name, (object)dataOfClass.Items[0].Num));
                        }
                    }
                    else if (dataOfClass.ConceptCards != null && dataOfClass.ConceptCards.Length > 0)
                    {
                        GameUtility.SetGameObjectActive((Component)buttonObject.icon, false);
                        GameUtility.SetGameObjectActive((Component)buttonObject.conceptCardIcon, true);
                        ConceptCardParam conceptCardParam = instanceDirect.MasterParam.GetConceptCardParam(dataOfClass.ConceptCards[0].iname);
                        if (conceptCardParam != null)
                        {
                            buttonObject.reward.set_text(string.Format(LocalizedText.Get("sys.CHALLENGE_DETAIL_REWARD_CONCEPT_CARD"), (object)conceptCardParam.name, (object)dataOfClass.ConceptCards[0].Num));
                        }
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)buttonObject.conceptCardIcon, (UnityEngine.Object)null))
                        {
                            ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(conceptCardParam.iname);
                            buttonObject.conceptCardIcon.Setup(cardDataForDisplay);
                        }
                    }
                }
                if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)buttonObject.icon, (UnityEngine.Object)null))
                {
                    return;
                }
                buttonObject.icon.UpdateValue();
            }
        }
Пример #15
0
        public void OnDetailClick()
        {
            GameManager          instance    = MonoSingleton <GameManager> .Instance;
            MultiTowerFloorParam dataOfClass = DataSource.FindDataOfClass <MultiTowerFloorParam>(((Component)this).get_gameObject(), (MultiTowerFloorParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            int mtRound = MonoSingleton <GameManager> .Instance.GetMTRound(GlobalVars.SelectedMultiTowerFloor);

            List <MultiTowerRewardItem> mtFloorReward        = instance.GetMTFloorReward(dataOfClass.reward_id, mtRound);
            MultiTowerRewardItem        multiTowerRewardItem = mtFloorReward[this.mIdx];

            MultiTowerRewardItem.RewardType rewardType = MultiTowerRewardItem.RewardType.Item;
            string key = string.Empty;
            int    num = 0;

            if (this.mIdx >= 0 && this.mIdx < mtFloorReward.Count)
            {
                rewardType = multiTowerRewardItem.type;
                key        = multiTowerRewardItem.itemname;
                num        = multiTowerRewardItem.num;
            }
            string str1 = string.Empty;
            string str2 = string.Empty;

            switch (rewardType)
            {
            case MultiTowerRewardItem.RewardType.Item:
                ItemParam itemParam = instance.GetItemParam(key);
                if (itemParam != null)
                {
                    str1 = itemParam.name;
                    str2 = itemParam.Expr;
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Coin:
                str1 = LocalizedText.Get("sys.COIN");
                str2 = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)num);
                break;

            case MultiTowerRewardItem.RewardType.Artifact:
                ArtifactParam artifactParam = instance.MasterParam.GetArtifactParam(key);
                if (artifactParam != null)
                {
                    str1 = string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_ARTIFACT"), (object)artifactParam.name);
                    str2 = artifactParam.Expr;
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Award:
                AwardParam awardParam = instance.GetAwardParam(key);
                if (awardParam != null)
                {
                    str1 = awardParam.name;
                    str2 = awardParam.expr;
                    break;
                }
                break;

            case MultiTowerRewardItem.RewardType.Unit:
                str1 = string.Format(LocalizedText.Get("sys.MULTI_VERSUS_REWARD_UNIT"), (object)instance.GetUnitParam(key).name);
                break;

            case MultiTowerRewardItem.RewardType.Gold:
                str1 = LocalizedText.Get("sys.GOLD");
                str2 = num.ToString() + LocalizedText.Get("sys.GOLD");
                break;
            }
            if (Object.op_Inequality((Object)this.rewardDetailName, (Object)null))
            {
                this.rewardDetailName.set_text(str1);
            }
            if (Object.op_Inequality((Object)this.rewardDetailInfo, (Object)null))
            {
                this.rewardDetailInfo.set_text(str2);
            }
            if (Object.op_Inequality((Object)this.pos, (Object)null))
            {
                ((Transform)this.pos).set_position(((Component)this).get_gameObject().get_transform().get_position());
            }
            FlowNode_TriggerLocalEvent.TriggerLocalEvent((Component)this, "OPEN_DETAIL");
        }
Пример #16
0
        private void Refresh()
        {
            string unlockUnitId = GlobalVars.UnlockUnitID;

            this.UnlockUnit = MonoSingleton <GameManager> .Instance.GetUnitParam(unlockUnitId);

            DataSource.Bind <UnitParam>(((Component)this).get_gameObject(), this.UnlockUnit);
            UnitData unitDataByUnitId = MonoSingleton <GameManager> .GetInstanceDirect().Player.FindUnitDataByUnitID(unlockUnitId);

            if (unitDataByUnitId != null)
            {
                DataSource.Bind <UnitData>(((Component)this).get_gameObject(), unitDataByUnitId);
            }
            bool flag = false;

            if (MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueParam(this.UnlockUnit) == null)
            {
                flag = MonoSingleton <GameManager> .Instance.Player.GetItemAmount(this.UnlockUnit.piece) >= this.UnlockUnit.GetUnlockNeedPieces();
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.QuestList, (UnityEngine.Object)null))
            {
                this.QuestList.SetActive(!flag);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.BtnDecide, (UnityEngine.Object)null))
            {
                ((Component)this.BtnDecide).get_gameObject().SetActive(flag);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.BtnCancel, (UnityEngine.Object)null))
            {
                ((Component)this.BtnCancel).get_gameObject().SetActive(flag);
            }
            if (flag)
            {
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TxtTitle, (UnityEngine.Object)null))
                {
                    this.TxtTitle.set_text(LocalizedText.Get("sys.UNIT_UNLOCK_TITLE"));
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TxtComment, (UnityEngine.Object)null))
                {
                    this.TxtComment.set_text(LocalizedText.Get("sys.UNIT_UNLOCK_COMMENT"));
                    ((Component)this.TxtComment).get_gameObject().SetActive(true);
                }
            }
            else
            {
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TxtTitle, (UnityEngine.Object)null))
                {
                    this.TxtTitle.set_text(LocalizedText.Get("sys.UNIT_GAINED_QUEST_TITLE"));
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TxtComment, (UnityEngine.Object)null))
                {
                    this.TxtComment.set_text(LocalizedText.Get("sys.UNIT_GAINED_COMMENT"));
                    ((Component)this.TxtComment).get_gameObject().SetActive(this.mGainedQuests.Count == 0);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.GOUnlockLimit, (UnityEngine.Object)null) && MonoSingleton <GameManager> .Instance.MasterParam.GetUnitUnlockTimeParam(this.UnlockUnit.unlock_time) != null)
                {
                    this.GOUnlockLimit.SetActive(true);
                }
                this.RefreshGainedQuests(this.UnlockUnit);
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Пример #17
0
        public void Refresh(int idx = 0)
        {
            MultiTowerFloorParam dataOfClass = DataSource.FindDataOfClass <MultiTowerFloorParam>(((Component)this).get_gameObject(), (MultiTowerFloorParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            if (Object.op_Inequality((Object)this.rewardFloor, (Object)null))
            {
                this.rewardFloor.set_text(GameUtility.HalfNum2FullNum(dataOfClass.floor.ToString()) + LocalizedText.Get("sys.MULTI_VERSUS_FLOOR"));
            }
            this.SetData(idx);
        }
Пример #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 void UpdateReward(TrophyParam trophy)
        {
            if (trophy == null)
            {
                return;
            }
            bool      flag1 = false;
            bool      flag2 = false;
            bool      flag3 = false;
            bool      flag4 = false;
            string    str   = string.Empty;
            ItemParam data  = (ItemParam)null;

            if (trophy.Gold != 0)
            {
                flag3 = true;
                str   = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_GOLD"), (object)trophy.Gold);
            }
            else if (trophy.Exp != 0)
            {
                flag2 = true;
                str   = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_EXP"), (object)trophy.Exp);
            }
            else if (trophy.Coin != 0)
            {
                flag1 = true;
                str   = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_COIN"), (object)trophy.Coin);
                data  = MonoSingleton <GameManager> .Instance.GetItemParam("$COIN");
            }
            else if (trophy.Stamina != 0)
            {
                flag4 = true;
                str   = string.Format(LocalizedText.Get("sys.CHALLENGE_REWARD_STAMINA"), (object)trophy.Stamina);
            }
            else if (trophy.Items != null && trophy.Items.Length > 0)
            {
                flag1 = true;
                data  = MonoSingleton <GameManager> .Instance.GetItemParam(trophy.Items[0].iname);

                if (data != null)
                {
                    string empty = string.Empty;
                    if (data.type == EItemType.Unit)
                    {
                        UnitParam unitParam = MonoSingleton <GameManager> .Instance.GetUnitParam(data.iname);

                        if (unitParam != null)
                        {
                            str = string.Format(LocalizedText.Get("sys.CHALLENGE_DETAIL_REWARD_UNIT"), (object)((int)unitParam.rare + 1), (object)unitParam.name);
                        }
                    }
                    else
                    {
                        str = string.Format(LocalizedText.Get("sys.CHALLENGE_DETAIL_REWARD"), (object)data.name, (object)trophy.Items[0].Num);
                    }
                }
            }
            if (Object.op_Inequality((Object)this.ImageItem, (Object)null))
            {
                ((Component)this.ImageItem).get_gameObject().SetActive(flag1);
            }
            if (Object.op_Inequality((Object)this.ImageExp, (Object)null))
            {
                ((Component)this.ImageExp).get_gameObject().SetActive(flag2);
            }
            if (Object.op_Inequality((Object)this.ImageGold, (Object)null))
            {
                ((Component)this.ImageGold).get_gameObject().SetActive(flag3);
            }
            if (Object.op_Inequality((Object)this.ImageStamina, (Object)null))
            {
                ((Component)this.ImageStamina).get_gameObject().SetActive(flag4);
            }
            if (data != null)
            {
                DataSource.Bind <ItemParam>(((Component)this).get_gameObject(), data);
            }
            if (!Object.op_Inequality((Object)this.TextReward, (Object)null))
            {
                return;
            }
            this.TextReward.set_text(str);
        }
Пример #20
0
        public void Activated(int pinID)
        {
            switch (pinID)
            {
            case 1:
                if (this.Chapter != null && this.Chapter.keys.Count > 0)
                {
                    KeyItem  key = this.Chapter.keys[0];
                    ItemData itemDataByItemId = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(key.iname);

                    if (itemDataByItemId == null || itemDataByItemId.Num < key.num)
                    {
                        UIUtility.SystemMessage(LocalizedText.Get("sys.KEYQUEST_UNLOCK"), LocalizedText.Get("sys.KEYQUEST_OUTOFKEY"), (UIUtility.DialogResultEvent)(go => FlowNode_GameObject.ActivateOutputLinks((Component)this, 101)), (GameObject)null, false, -1);
                        break;
                    }
                    if (!this.Chapter.IsDateUnlock(Network.GetServerTime()))
                    {
                        UIUtility.SystemMessage(LocalizedText.Get("sys.KEYQUEST_UNLOCK"), LocalizedText.Get("sys.QUEST_OUT_OF_DATE"), (UIUtility.DialogResultEvent)(go => FlowNode_GameObject.ActivateOutputLinks((Component)this, 101)), (GameObject)null, false, -1);
                        break;
                    }
                }
                GlobalVars.KeyQuestTimeOver = false;
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 100);
                break;

            case 2:
                GlobalVars.KeyQuestTimeOver = false;
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 101);
                break;
            }
        }
Пример #21
0
        public void Refresh()
        {
            TowerFloorParam towerFloor = MonoSingleton <GameManager> .Instance.FindTowerFloor(GlobalVars.SelectedQuestID);

            if (towerFloor == null)
            {
                return;
            }
            QuestParam questParam = towerFloor.GetQuestParam();

            DataSource.Bind <QuestParam>(((Component)this).get_gameObject(), questParam);
            this.SetRecommendText((int)towerFloor.lv, (int)towerFloor.joblv);
            int             downloadAssetNum = ((FlowNode_DownloadTowerMapSets)((Component)this).GetComponentInParent <FlowNode_DownloadTowerMapSets>()).DownloadAssetNum;
            TowerFloorParam currentFloor     = MonoSingleton <GameManager> .Instance.TowerResuponse.GetCurrentFloor();

            if (currentFloor == null)
            {
                return;
            }
            if ((int)towerFloor.FloorIndex < (int)currentFloor.FloorIndex + downloadAssetNum)
            {
                if (questParam.state == QuestStates.Cleared)
                {
                    GameUtility.SetGameObjectActive(this.UnkownIcon, false);
                    GameUtility.SetGameObjectActive((Component)this.RewardText, true);
                    GameUtility.SetGameObjectActive(this.ClearIcon, true);
                    for (int index = 0; index < this.EnemyList.Count; ++index)
                    {
                        ((Component)this.EnemyList[index]).get_gameObject().SetActive(false);
                    }
                    for (int index = 0; index < this.UnknownEnemyList.Count; ++index)
                    {
                        ((Component)this.UnknownEnemyList[index]).get_gameObject().SetActive(false);
                    }
                    this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id));
                }
                else
                {
                    string path = AssetPath.LocalMap(towerFloor.map[0].mapSetName);
                    string src  = AssetManager.LoadTextData(path);
                    if (string.IsNullOrEmpty(src))
                    {
                        DebugUtility.LogError("配置ファイルがありません : QuestIname = " + towerFloor.iname + ",SetFilePath = " + path);
                        return;
                    }
                    JSON_MapUnit jsonObject = JSONParser.parseJSONObject <JSON_MapUnit>(src);
                    GameUtility.SetGameObjectActive(this.UnkownIcon, false);
                    GameUtility.SetGameObjectActive((Component)this.RewardText, true);
                    GameUtility.SetGameObjectActive(this.ClearIcon, false);
                    TowerResuponse towerResuponse = MonoSingleton <GameManager> .Instance.TowerResuponse;
                    if ((int)jsonObject.is_rand > 0)
                    {
                        if (towerResuponse.lot_enemies == null || (int)towerFloor.FloorIndex > (int)currentFloor.FloorIndex)
                        {
                            for (int index = 0; index < this.EnemyList.Count; ++index)
                            {
                                ((Component)this.EnemyList[index]).get_gameObject().SetActive(false);
                            }
                            this.EnemyTemplateUnKnown.SetActive(true);
                            int num = 0;
                            for (int index = 0; index < towerFloor.rand_tag.Length; ++index)
                            {
                                num += (int)towerFloor.rand_tag[index];
                            }
                            for (int index = 0; index < num; ++index)
                            {
                                if (index >= this.UnknownEnemyList.Count)
                                {
                                    TowerEnemyListItem component = (TowerEnemyListItem)((GameObject)Object.Instantiate <GameObject>((M0)this.EnemyTemplateUnKnown)).GetComponent <TowerEnemyListItem>();
                                    ((Component)component).get_transform().SetParent(this.EnemiesRoot.get_transform(), false);
                                    this.UnknownEnemyList.Add(component);
                                }
                                ((Component)this.UnknownEnemyList[index]).get_gameObject().SetActive(true);
                            }
                            for (int index = num; index < this.UnknownEnemyList.Count; ++index)
                            {
                                ((Component)this.UnknownEnemyList[index]).get_gameObject().SetActive(false);
                            }
                            this.EnemyTemplateUnKnown.SetActive(false);
                        }
                        else
                        {
                            List <JSON_MapEnemyUnit> randFixedUnit = jsonObject.GetRandFixedUnit();
                            jsonObject.enemy = new JSON_MapEnemyUnit[towerResuponse.lot_enemies.Length];
                            for (int index = 0; index < jsonObject.enemy.Length; ++index)
                            {
                                jsonObject.enemy[index] = jsonObject.deck[(int)towerResuponse.lot_enemies[index]];
                            }
                            List <JSON_MapEnemyUnit> jsonMapEnemyUnitList = new List <JSON_MapEnemyUnit>((IEnumerable <JSON_MapEnemyUnit>)jsonObject.enemy);
                            jsonMapEnemyUnitList.AddRange((IEnumerable <JSON_MapEnemyUnit>)randFixedUnit);
                            jsonObject.enemy = jsonMapEnemyUnitList.ToArray();
                            this.SetEnemies(jsonObject.enemy);
                        }
                    }
                    else if (jsonObject.enemy != null)
                    {
                        this.SetEnemies(jsonObject.enemy);
                    }
                    this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id));
                }
            }
            else
            {
                GameUtility.SetGameObjectActive(this.UnkownIcon, true);
                GameUtility.SetGameObjectActive((Component)this.RewardText, true);
                GameUtility.SetGameObjectActive(this.ClearIcon, false);
                if (Object.op_Inequality((Object)this.UnkownIcon, (Object)null))
                {
                    Text component = (Text)this.UnkownIcon.GetComponent <Text>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        component.set_text(LocalizedText.Get("sys.TOWER_UNKNOWN_TEXT", new object[1]
                        {
                            (object)((int)towerFloor.FloorIndex - downloadAssetNum + 1)
                        }));
                    }
                }
                for (int index = 0; index < this.EnemyList.Count; ++index)
                {
                    ((Component)this.EnemyList[index]).get_gameObject().SetActive(false);
                }
                for (int index = 0; index < this.UnknownEnemyList.Count; ++index)
                {
                    ((Component)this.UnknownEnemyList[index]).get_gameObject().SetActive(false);
                }
                this.SetRewards(MonoSingleton <GameManager> .Instance.FindTowerReward(towerFloor.reward_id));
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
            this.FloorID = GlobalVars.SelectedQuestID;
        }
Пример #22
0
        private void Start()
        {
            this.Chapter = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

            if (this.Chapter == null)
            {
                FlowNode_GameObject.ActivateOutputLinks((Component)this, 101);
            }
            else
            {
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.ItemTemplate, (UnityEngine.Object)null) && this.ItemTemplate.get_activeInHierarchy())
                {
                    this.ItemTemplate.SetActive(false);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Message, (UnityEngine.Object)null))
                {
                    string    str       = (string)null;
                    ItemParam itemParam = (ItemParam)null;
                    int       num1      = 0;
                    if (this.Chapter.keys.Count > 0)
                    {
                        KeyItem key = this.Chapter.keys[0];
                        itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(key.iname);

                        num1 = key.num;
                    }
                    KeyQuestTypes keyQuestType     = this.Chapter.GetKeyQuestType();
                    bool          keyQuestTimeOver = GlobalVars.KeyQuestTimeOver;
                    switch (keyQuestType)
                    {
                    case KeyQuestTypes.Timer:
                        if (this.Chapter.keytime != 0L && itemParam != null)
                        {
                            DateTime dateTime1 = TimeManager.FromUnixTime(0L);
                            DateTime dateTime2;
                            if (this.Chapter.end == 0L)
                            {
                                dateTime2 = TimeManager.FromUnixTime(this.Chapter.keytime);
                            }
                            else
                            {
                                long num2 = Math.Min(this.Chapter.end - TimeManager.FromDateTime(TimeManager.ServerTime), this.Chapter.keytime);
                                dateTime2 = TimeManager.FromUnixTime(num2 >= 0L ? num2 : 0L);
                            }
                            TimeSpan timeSpan = dateTime2 - dateTime1;
                            if (timeSpan.TotalDays >= 1.0)
                            {
                                str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_TIMER_D" : "sys.KEYQUEST_TIMEOVER_D", (object)itemParam.name, (object)num1, (object)timeSpan.Days);
                                break;
                            }
                            if (timeSpan.TotalHours >= 1.0)
                            {
                                str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_TIMER_H" : "sys.KEYQUEST_TIMEOVER_H", (object)itemParam.name, (object)num1, (object)timeSpan.Hours);
                                break;
                            }
                            str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_TIMER_M" : "sys.KEYQUEST_TIMEOVER_M", (object)itemParam.name, (object)num1, (object)Mathf.Max(timeSpan.Minutes, 0));
                            break;
                        }
                        break;

                    case KeyQuestTypes.Count:
                        str = LocalizedText.Get(!keyQuestTimeOver ? "sys.KEYQUEST_UNLCOK_COUNT" : "sys.KEYQUEST_TIMEOVER_COUNT", (object)itemParam.name, (object)num1);
                        break;
                    }
                    this.Message.set_text(str);
                }
                this.Refresh();
            }
        }
Пример #23
0
        private void Refresh()
        {
            if (this.mAwardItems == null || this.mAwardItems.Count <= 0 || (this.mAwards == null || this.mAwards.Length <= 0))
            {
                return;
            }
            using (List <GameObject> .Enumerator enumerator = this.mAwardItems.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    enumerator.Current.SetActive(false);
                }
            }
            int length = this.mAwards.Length;
            int num1   = this.mMaxViewItems * this.mCurrentPage;
            int num2   = num1 >= length ? 0 : num1;
            int num3   = this.mMaxViewItems * (this.mCurrentPage + 1);
            int num4   = num3 >= length ? length : num3;
            int index1 = num2;

            for (int index2 = 0; index2 < this.mAwardItems.Count; ++index2)
            {
                AwardParam awardParam = index1 >= this.mAwards.Length ? (AwardParam)null : this.mAwards[index1];
                if (awardParam != null)
                {
                    GameObject mAwardItem = this.mAwardItems[index2];
                    if (Object.op_Inequality((Object)mAwardItem, (Object)null))
                    {
                        AwardListItem component1 = (AwardListItem)mAwardItem.GetComponent <AwardListItem>();
                        if (Object.op_Inequality((Object)component1, (Object)null))
                        {
                            mAwardItem.SetActive(true);
                            mAwardItem.SetActive(true);
                            bool hasItem = this.mOpenAwards != null && this.mOpenAwards.Contains(awardParam.iname);
                            component1.SetUp(awardParam.iname, hasItem, awardParam.iname == this.gm.Player.SelectedAward, awardParam.grade <= 0);
                            Button component2 = (Button)mAwardItem.GetComponent <SRPG_Button>();
                            if (Object.op_Inequality((Object)component2, (Object)null))
                            {
                                ((UnityEventBase)component2.get_onClick()).RemoveAllListeners();
                                if (awardParam.grade <= 0)
                                {
                                    // ISSUE: object of a compiler-generated type is created
                                    // ISSUE: method pointer
                                    ((UnityEvent)component2.get_onClick()).AddListener(new UnityAction((object)new AwardList.\u003CRefresh\u003Ec__AnonStorey231()
                                    {
                                        \u003C\u003Ef__this = this,
                                        iname = awardParam.iname
                                    }, __methodptr(\u003C\u003Em__23F)));
                                    ((Selectable)component2).set_interactable(true);
                                }
                                else
                                {
                                    if (hasItem)
                                    {
                                        // ISSUE: object of a compiler-generated type is created
                                        // ISSUE: method pointer
                                        ((UnityEvent)component2.get_onClick()).AddListener(new UnityAction((object)new AwardList.\u003CRefresh\u003Ec__AnonStorey232()
                                        {
                                            \u003C\u003Ef__this = this,
                                            iname = awardParam.iname
                                        }, __methodptr(\u003C\u003Em__240)));
                                    }
                                    ((Selectable)component2).set_interactable(hasItem);
                                }
                            }
                        }
                    }
                    if (index1 <= num4)
                    {
                        ++index1;
                    }
                }
            }
            if (Object.op_Inequality((Object)this.Pager, (Object)null))
            {
                this.Pager.set_text(LocalizedText.Get("sys.TEXT_PAGER_TEMP", (object)(this.mCurrentPage + 1).ToString(), (object)this.mMaxPage.ToString()));
            }
            if (!Object.op_Inequality((Object)this.Prev, (Object)null) || !Object.op_Inequality((Object)this.Next, (Object)null))
            {
                return;
            }
            ((Selectable)this.Prev).set_interactable(this.mCurrentPage - 1 >= 0);
            ((Selectable)this.Next).set_interactable(this.mCurrentPage + 1 < this.mMaxPage);
        }
Пример #24
0
 private void Refresh()
 {
     this.SetUp();
     if (this.mAwardParam != null)
     {
         if (Object.op_Inequality((Object)this.mImageArray, (Object)null))
         {
             if (this.mImageArray.Images.Length <= this.mAwardParam.grade)
             {
                 this.SetExtraAwardImage();
                 this.AwardTxt.set_text(string.Empty);
             }
             else
             {
                 this.mImageArray.ImageIndex = this.mAwardParam.grade;
                 this.AwardTxt.set_text(string.IsNullOrEmpty(this.mAwardParam.name) ? LocalizedText.Get("sys.TEXT_NOT_SELECT") : this.mAwardParam.name);
             }
         }
     }
     else
     {
         this.mImageArray.ImageIndex = 0;
         this.AwardTxt.set_text(LocalizedText.Get("sys.TEXT_NOT_SELECT"));
     }
     if (Object.op_Inequality((Object)this.AwardBG, (Object)null))
     {
         this.AwardBG.SetActive(true);
     }
     if (!Object.op_Inequality((Object)this.AwardTxt, (Object)null))
     {
         return;
     }
     ((Component)this.AwardTxt).get_gameObject().SetActive(true);
 }
Пример #25
0
        private void OnItemSelect(GameObject go)
        {
            TrophyParam dataOfClass = DataSource.FindDataOfClass <TrophyParam>(go, (TrophyParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            TrophyState trophyCounter = MonoSingleton <GameManager> .Instance.Player.GetTrophyCounter(dataOfClass, true);

            if (!trophyCounter.IsEnded && trophyCounter.IsCompleted)
            {
                if (dataOfClass.IsInvisibleStamina() || !dataOfClass.IsAvailablePeriod(TimeManager.ServerTime, true))
                {
                    UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.TROPHY_OUTDATED"), (UIUtility.DialogResultEvent)null, (GameObject)null, false, -1);
                    this.Refresh();
                }
                else
                {
                    GlobalVars.SelectedTrophy.Set(dataOfClass.iname);
                    RewardData rewardData = new RewardData(dataOfClass);
                    GlobalVars.LastReward.Set(rewardData);
                    GlobalVars.UnitGetReward = new UnitGetParam(rewardData.Items.ToArray());
                    this.trophy_window.ActivateOutputLinks(2000);
                }
            }
            else
            {
                QuestParam questParam = new QuestParam();
                switch (dataOfClass.Objectives[0].type)
                {
                case TrophyConditionTypes.winquest:
                case TrophyConditionTypes.playerlv:
                case TrophyConditionTypes.winquestsoldier:
                case TrophyConditionTypes.losequest:
                case TrophyConditionTypes.damage_over:
                case TrophyConditionTypes.complete_all_quest_mission:
                case TrophyConditionTypes.has_gold_over:
                case TrophyConditionTypes.complete_all_quest_mission_total:
                case TrophyConditionTypes.complete_all_mission_count:
                case TrophyConditionTypes.complete_story_mission_count:
                    QuestTypes quest_type1 = QuestTypes.Story;
                    if (!questParam.TransSectionGotoQuest(dataOfClass.Objectives[0].sval_base, out quest_type1, new UIUtility.DialogResultEvent(this.MsgBoxJumpToQuest)))
                    {
                        break;
                    }
                    switch (quest_type1)
                    {
                    case QuestTypes.Multi:
                    case QuestTypes.MultiGps:
                        this.trophy_window.ActivateOutputLinks(2005);
                        return;

                    case QuestTypes.Event:
                    case QuestTypes.Gps:
                        this.trophy_window.ActivateOutputLinks(2006);
                        return;

                    case QuestTypes.Character:
                        this.trophy_window.ActivateOutputLinks(2032);
                        return;

                    case QuestTypes.Tower:
                        this.trophy_window.ActivateOutputLinks(2026);
                        return;

                    case QuestTypes.Beginner:
                        this.trophy_window.ActivateOutputLinks(2033);
                        return;

                    default:
                        this.trophy_window.ActivateOutputLinks(2002);
                        return;
                    }

                case TrophyConditionTypes.winelite:
                case TrophyConditionTypes.loseelite:
                    if (!questParam.TransSectionGotoElite(new UIUtility.DialogResultEvent(this.MsgBoxJumpToQuest)))
                    {
                        break;
                    }
                    this.trophy_window.ActivateOutputLinks(2002);
                    break;

                case TrophyConditionTypes.winevent:
                case TrophyConditionTypes.loseevent:
                case TrophyConditionTypes.exclear_fire:
                case TrophyConditionTypes.exclear_water:
                case TrophyConditionTypes.exclear_wind:
                case TrophyConditionTypes.exclear_thunder:
                case TrophyConditionTypes.exclear_light:
                case TrophyConditionTypes.exclear_dark:
                case TrophyConditionTypes.exclear_fire_nocon:
                case TrophyConditionTypes.exclear_water_nocon:
                case TrophyConditionTypes.exclear_wind_nocon:
                case TrophyConditionTypes.exclear_thunder_nocon:
                case TrophyConditionTypes.exclear_light_nocon:
                case TrophyConditionTypes.exclear_dark_nocon:
                case TrophyConditionTypes.complete_event_mission_count:
                    questParam.GotoEventListQuest((string)null, (string)null);
                    this.trophy_window.ActivateOutputLinks(2006);
                    break;

                case TrophyConditionTypes.gacha:
                case TrophyConditionTypes.collectunits:
                    this.trophy_window.ActivateOutputLinks(2001);
                    break;

                case TrophyConditionTypes.multiplay:
                case TrophyConditionTypes.winmulti:
                case TrophyConditionTypes.winmultimore:
                case TrophyConditionTypes.winmultiless:
                    this.trophy_window.ActivateOutputLinks(2005);
                    break;

                case TrophyConditionTypes.ability:
                case TrophyConditionTypes.changeability:
                case TrophyConditionTypes.makeabilitylevel:
                    this.trophy_window.ActivateOutputLinks(2025);
                    break;

                case TrophyConditionTypes.soubi:
                    this.GotoEquip();
                    break;

                case TrophyConditionTypes.buygold:
                    this.trophy_window.ActivateOutputLinks(2003);
                    break;

                case TrophyConditionTypes.arena:
                case TrophyConditionTypes.winarena:
                case TrophyConditionTypes.losearena:
                case TrophyConditionTypes.becomearenarank:
                case TrophyConditionTypes.overarenarank:
                    this.GotoArena();
                    break;

                case TrophyConditionTypes.review:
                    this.trophy_window.ActivateOutputLinks(2029);
                    break;

                case TrophyConditionTypes.fggid:
                    this.trophy_window.ActivateOutputLinks(2008);
                    break;

                case TrophyConditionTypes.unitlevel:
                case TrophyConditionTypes.evolutionnum:
                case TrophyConditionTypes.joblevel:
                case TrophyConditionTypes.upunitlevel:
                case TrophyConditionTypes.makeunitlevel:
                    this.trophy_window.ActivateOutputLinks(2025);
                    break;

                case TrophyConditionTypes.unitequip:
                case TrophyConditionTypes.upjoblevel:
                case TrophyConditionTypes.makejoblevel:
                case TrophyConditionTypes.totaljoblv11:
                    this.trophy_window.ActivateOutputLinks(2025);
                    break;

                case TrophyConditionTypes.limitbreak:
                case TrophyConditionTypes.evoltiontimes:
                case TrophyConditionTypes.changejob:
                case TrophyConditionTypes.totalunitlvs:
                    this.trophy_window.ActivateOutputLinks(2025);
                    break;

                case TrophyConditionTypes.buyatshop:
                    this.GotoShop(dataOfClass);
                    break;

                case TrophyConditionTypes.artifacttransmute:
                case TrophyConditionTypes.artifactstrength:
                case TrophyConditionTypes.artifactevolution:
                case TrophyConditionTypes.upartifactlevel:
                case TrophyConditionTypes.makeartifactlevel:
                    this.trophy_window.ActivateOutputLinks(2021);
                    break;

                case TrophyConditionTypes.wintower:
                case TrophyConditionTypes.losetower:
                case TrophyConditionTypes.tower:
                case TrophyConditionTypes.overtowerscore:
                    QuestTypes quest_type2 = QuestTypes.Tower;
                    if (!questParam.TransSectionGotoTower(dataOfClass.Objectives[0].sval_base, out quest_type2))
                    {
                        break;
                    }
                    QuestTypes questTypes = quest_type2;
                    switch (questTypes)
                    {
                    case QuestTypes.Gps:
                        this.trophy_window.ActivateOutputLinks(2006);
                        return;

                    case QuestTypes.Beginner:
                        this.trophy_window.ActivateOutputLinks(2033);
                        return;

                    default:
                        if (questTypes != QuestTypes.Event)
                        {
                            this.trophy_window.ActivateOutputLinks(2026);
                            return;
                        }
                        goto case QuestTypes.Gps;
                    }

                case TrophyConditionTypes.vs:
                case TrophyConditionTypes.vswin:
                case TrophyConditionTypes.overvsrankfloor:
                    this.GotoVersus();
                    break;

                case TrophyConditionTypes.winstory_extra:
                    if (!questParam.TransSectionGotoStoryExtra(new UIUtility.DialogResultEvent(this.MsgBoxJumpToQuest)))
                    {
                        break;
                    }
                    this.trophy_window.ActivateOutputLinks(2002);
                    break;

                case TrophyConditionTypes.multitower_help:
                case TrophyConditionTypes.multitower:
                    this.GotoMultiTower();
                    break;

                case TrophyConditionTypes.read_tips:
                case TrophyConditionTypes.read_tips_count:
                    this.GotoBeginnerTop();
                    break;

                case TrophyConditionTypes.up_conceptcard_level:
                case TrophyConditionTypes.up_conceptcard_level_target:
                case TrophyConditionTypes.limitbreak_conceptcard:
                case TrophyConditionTypes.limitbreak_conceptcard_target:
                case TrophyConditionTypes.up_conceptcard_trust:
                case TrophyConditionTypes.up_conceptcard_trust_target:
                case TrophyConditionTypes.max_conceptcard_trust:
                    this.trophy_window.ActivateOutputLinks(2035);
                    break;

                case TrophyConditionTypes.unlock_tobira_total:
                case TrophyConditionTypes.unlock_tobira_unit:
                case TrophyConditionTypes.envy_unlock_unit:
                case TrophyConditionTypes.sloth_unlock_unit:
                case TrophyConditionTypes.lust_unlock_unit:
                case TrophyConditionTypes.greed_unlock_unit:
                case TrophyConditionTypes.wrath_unlock_unit:
                case TrophyConditionTypes.gluttonny_unlock_unit:
                case TrophyConditionTypes.pride_unlock_unit:
                    this.trophy_window.ActivateOutputLinks(2025);
                    break;

                case TrophyConditionTypes.send_present:
                    this.trophy_window.ActivateOutputLinks(2039);
                    break;

                case TrophyConditionTypes.complete_ordeal_mission_count:
                case TrophyConditionTypes.clear_ordeal:
                    this.trophy_window.ActivateOutputLinks(2036);
                    break;

                case TrophyConditionTypes.view_news:
                    this.trophy_window.ActivateOutputLinks(2038);
                    break;
                }
            }
        }
Пример #26
0
        private void OutOfCoin()
        {
            FixParam fixParam = MonoSingleton <GameManager> .Instance.MasterParam.FixParam;

            UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.OUTOFFREECOIN", (object)fixParam.BuyGoldCost, (object)fixParam.BuyGoldAmount), (UIUtility.DialogResultEvent)(go => {}), (GameObject)null, false, -1);
        }
Пример #27
0
        public void Refresh(int idx, int max)
        {
            GameManager instance         = MonoSingleton <GameManager> .Instance;
            int         versusTowerFloor = instance.Player.VersusTowerFloor;
            int         floor            = idx + 1;

            if (idx >= 0 && idx < max)
            {
                this.mCurrentFloor = floor;
                if (Object.op_Inequality((Object)this.FloorInfoObj, (Object)null))
                {
                    this.FloorInfoObj.SetActive(true);
                }
                if (Object.op_Inequality((Object)this.FloorText, (Object)null))
                {
                    this.FloorText.set_text(floor.ToString() + LocalizedText.Get("sys.MULTI_VERSUS_FLOOR"));
                    if (floor == versusTowerFloor)
                    {
                        ((Graphic)this.FloorText).set_color(new Color(1f, 1f, 0.0f));
                    }
                    else
                    {
                        ((Graphic)this.FloorText).set_color(new Color(1f, 1f, 1f));
                    }
                }
                if (Object.op_Inequality((Object)this.FloorImage, (Object)null))
                {
                    if (floor == versusTowerFloor)
                    {
                        if (Object.op_Inequality((Object)this.CurrentSprite, (Object)null))
                        {
                            this.FloorImage.set_sprite(this.CurrentSprite);
                        }
                    }
                    else if (Object.op_Inequality((Object)this.DefaultSprite, (Object)null))
                    {
                        this.FloorImage.set_sprite(this.DefaultSprite);
                    }
                }
                if (Object.op_Inequality((Object)this.RingObj, (Object)null))
                {
                    this.RingObj.SetActive(versusTowerFloor == floor);
                }
                VersusFriendScore[] versusFriendScore = instance.GetVersusFriendScore(floor);
                if (versusFriendScore != null && versusFriendScore.Length > 0 && floor != versusTowerFloor)
                {
                    int    length = versusFriendScore.Length;
                    string empty  = string.Empty;
                    if (Object.op_Inequality((Object)this.UnitObj, (Object)null))
                    {
                        this.UnitObj.SetActive(true);
                        DataSource.Bind <UnitData>(this.UnitObj, versusFriendScore[0].unit);
                        GameParameter.UpdateAll(this.UnitObj);
                    }
                    int    num = length - 1;
                    string str = num <= 0 ? versusFriendScore[0].name : string.Format(LocalizedText.Get("sys.MULTI_VERSUS_FRIEND_NAME"), (object)versusFriendScore[0].name, (object)num);
                    if (!Object.op_Inequality((Object)this.FriendName, (Object)null))
                    {
                        return;
                    }
                    this.FriendName.set_text(str);
                }
                else
                {
                    if (!Object.op_Inequality((Object)this.UnitObj, (Object)null))
                    {
                        return;
                    }
                    this.UnitObj.SetActive(false);
                }
            }
            else
            {
                this.mCurrentFloor = -1;
                if (Object.op_Inequality((Object)this.FloorInfoObj, (Object)null))
                {
                    this.FloorInfoObj.SetActive(false);
                }
                if (Object.op_Inequality((Object)this.RingObj, (Object)null))
                {
                    this.RingObj.SetActive(false);
                }
                if (!Object.op_Inequality((Object)this.FloorImage, (Object)null) || !Object.op_Inequality((Object)this.DefaultSprite, (Object)null))
                {
                    return;
                }
                this.FloorImage.set_sprite(this.DefaultSprite);
            }
        }
Пример #28
0
 private void OutOfBuyCount()
 {
     UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.GOLD_BUY_LIMIT"), (UIUtility.DialogResultEvent)(go => {}), (GameObject)null, false, -1);
 }
Пример #29
0
 private void OnDetail(SRPG_Button button)
 {
     FlowNode_Variable.Set("SHARED_WEBWINDOW_TITLE", LocalizedText.Get("sys.TITLE_POPUP_GACHA_DETAIL"));
     FlowNode_Variable.Set("SHARED_WEBWINDOW_URL", this.mDetailURL);
     FlowNode_GameObject.ActivateOutputLinks((Component)this, 10);
 }
Пример #30
0
        private void Start()
        {
            if (Object.op_Inequality((Object)this.BackButton, (Object)null))
            {
                // ISSUE: method pointer
                ((UnityEvent)this.BackButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(OnCloseMain)));
                ((Text)((Component)((Component)this.BackButton).get_transform().FindChild("Text")).GetComponent <LText>()).set_text(LocalizedText.Get("help.BACK_BUTTON"));
            }
            if (Object.op_Inequality((Object)this.MiddleBackButton, (Object)null))
            {
                // ISSUE: method pointer
                ((UnityEvent)this.MiddleBackButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(OnBackList)));
                ((Text)((Component)((Component)this.MiddleBackButton).get_transform().FindChild("Text")).GetComponent <LText>()).set_text(LocalizedText.Get("help.BACK_BUTTON"));
            }
            string s1 = LocalizedText.Get("help.MENU_NUM");

            if (string.IsNullOrEmpty(s1))
            {
                return;
            }
            this.mHelpMenuButtons = new GameObject[int.Parse(s1)];
            if (!this.ReferenceFlowVariable)
            {
                return;
            }
            string s2 = FlowNode_Variable.Get(HelpWindow.VAR_NAME_MENU_ID);

            if (string.IsNullOrEmpty(s2))
            {
                return;
            }
            int result;

            if (int.TryParse(s2, out result))
            {
                this.CreateMainWindow(result - 1);
            }
            FlowNode_Variable.Set(HelpWindow.VAR_NAME_MENU_ID, string.Empty);
        }