Beispiel #1
0
    // Token: 0x060010DD RID: 4317 RVA: 0x001E17F0 File Offset: 0x001DF9F0
    public void OnButtonClick(UIButton sender)
    {
        GUIArena_Replay btnID = (GUIArena_Replay)sender.m_BtnID1;

        if (btnID != GUIArena_Replay.btn_EXIT)
        {
            if (btnID == GUIArena_Replay.btn_Replay)
            {
                Transform parent = sender.gameObject.transform.parent;
                int       btnID2 = parent.GetComponent <ScrollPanelItem>().m_BtnID1;
                if (this.AM.SetReportIDToPlayingData(btnID2))
                {
                    if (!WarManager.CheckVersion(this.AM.ArenaPlayingData.SimulatorVersion, this.AM.ArenaPlayingData.SimulatorPatchNo, true))
                    {
                        return;
                    }
                    int num = btnID2;
                    if (this.AM.m_ArenaReportData.Count > num)
                    {
                        num = this.AM.m_ArenaReportData.Count - 1 - num;
                    }
                    ushort[] array = new ushort[10];
                    for (int i = 0; i < 5; i++)
                    {
                        array[i] = this.AM.m_ArenaReportData[num].MyHeroData[i].ID;
                    }
                    for (int j = 0; j < 5; j++)
                    {
                        array[j + 5] = this.AM.m_ArenaReportData[num].EnemyHeroData[j].ID;
                    }
                    if (!this.DM.CheckHeroBattleResourceReady(HeroFightType.HeorArena, array))
                    {
                        GUIManager.Instance.AddHUDMessage(this.DM.mStringTable.GetStringByID(8350u), 255, true);
                        return;
                    }
                    GUIManager instance = GUIManager.Instance;
                    instance.bClearWindowStack  = false;
                    BattleController.BattleMode = EBattleMode.PVP_Replay;
                    instance.pDVMgr.NextTransitions(eTrans.BEGIN, eTransFunc.MonsterBattle);
                }
            }
        }
        else if (this.door != null)
        {
            this.door.CloseMenu(false);
        }
    }
Beispiel #2
0
    // Token: 0x06001B85 RID: 7045 RVA: 0x0030CD94 File Offset: 0x0030AF94
    public void OnButtonClick(UIButton sender)
    {
        switch (sender.m_BtnID1)
        {
        case 1:
        case 2:
        case 3:
        case 4:
        case 5:
        case 6:
            UIFormationSelect.NowArmyCoordIndex = (byte)(sender.m_BtnID1 - 1);
            this.RefreshButtonStatus();
            break;

        case 7:
            this.ExeConfirmButtonEvent((UIFormationSelect.ECoordConfirmBtnStatus)sender.m_BtnID2);
            break;

        case 8:
            this.door.CloseMenu(false);
            break;

        case 9:
            AudioManager.Instance.PlaySFX(40029, 0f, PitchKind.NoPitch, null, null);
            if (WarManager.CheckVersion(true))
            {
                this.SetupWarDefault();
                GUIManager.Instance.bClearWindowStack = false;
                GUIManager.Instance.pDVMgr.NextTransitions(eTrans.BEGIN, eTransFunc.MapToWar_CoordTest);
                FBAdvanceManager.Instance.TriggerFbUniqueEvent(EFBEvent.FIRST_LINEUP_DRILL);
            }
            break;

        case 10:
            GUIManager.Instance.OpenMessageBoxEX(DataManager.Instance.mStringTable.GetStringByID(9129u), DataManager.Instance.mStringTable.GetStringByID(9787u), null, null, 0, 0, true, true);
            break;
        }
    }
Beispiel #3
0
    // Token: 0x0600109E RID: 4254 RVA: 0x001D80F0 File Offset: 0x001D62F0
    public void RecvArena_Challenge(MessagePacket MP)
    {
        GUIManager.Instance.HideUILock(EUILock.Arena);
        byte b = MP.ReadByte(-1);

        if (b == 0)
        {
            this.BattleResult             = MP.ReadByte(-1);
            this.m_ArenaPlace             = MP.ReadUInt(-1);
            this.m_ArenaTodayChallenge    = MP.ReadByte(-1);
            this.m_ArenaLastChallengeTime = MP.ReadLong(-1);
            DataManager dataManager = DataManager.Instance;
            dataManager.KingOldLv  = dataManager.RoleAttr.Level;
            dataManager.KingOldExp = dataManager.RoleAttr.Exp;
            DataManager.StageDataController.UpdateRoleAttrLevel(MP.ReadByte(-1));
            DataManager.StageDataController.UpdateRoleAttrExp(MP.ReadUInt(-1));
            MP.ReadUInt(-1);
            for (int i = 0; i < 5; i++)
            {
                ushort num = MP.ReadUShort(-1);
                if (num != 0 && dataManager.curHeroData.ContainsKey((uint)num))
                {
                    CurHeroData curHeroData = dataManager.curHeroData[(uint)num];
                    dataManager.heroLv[i]  = curHeroData.Level;
                    dataManager.heroExp[i] = curHeroData.Exp;
                    dataManager.UpdateHeroAttr(num, MP);
                }
                else
                {
                    MP.ReadByte(-1);
                    MP.ReadUInt(-1);
                    MP.ReadUInt(-1);
                }
            }
            ArenaReportDataType arenaReportDataType = default(ArenaReportDataType);
            arenaReportDataType.MyHeroData            = new ArenaHeroDataType[5];
            arenaReportDataType.EnemyHeroData         = new ArenaHeroDataType[5];
            arenaReportDataType.TopicID               = new byte[2];
            arenaReportDataType.TopicEffect           = new ArenaTopicEffectDataType[2];
            arenaReportDataType.SimulatorVersion      = MP.ReadUInt(-1);
            arenaReportDataType.SimulatorPatchNo      = MP.ReadUInt(-1);
            arenaReportDataType.Flag                  = MP.ReadByte(-1);
            arenaReportDataType.TopicID[0]            = MP.ReadByte(-1);
            arenaReportDataType.TopicID[1]            = MP.ReadByte(-1);
            arenaReportDataType.TopicEffect[0].Effect = MP.ReadUShort(-1);
            arenaReportDataType.TopicEffect[0].Value  = MP.ReadUShort(-1);
            arenaReportDataType.TopicEffect[1].Effect = MP.ReadUShort(-1);
            arenaReportDataType.TopicEffect[1].Value  = MP.ReadUShort(-1);
            arenaReportDataType.ChangePlace           = MP.ReadUInt(-1);
            for (int j = 0; j < 5; j++)
            {
                arenaReportDataType.MyHeroData[j].SkillLV = new byte[4];
                arenaReportDataType.MyHeroData[j].ID      = MP.ReadUShort(-1);
                arenaReportDataType.MyHeroData[j].Level   = MP.ReadByte(-1);
                arenaReportDataType.MyHeroData[j].Rank    = MP.ReadByte(-1);
                arenaReportDataType.MyHeroData[j].Star    = MP.ReadByte(-1);
                arenaReportDataType.MyHeroData[j].Equip   = MP.ReadByte(-1);
                for (int k = 0; k < 4; k++)
                {
                    arenaReportDataType.MyHeroData[j].SkillLV[k] = MP.ReadByte(-1);
                }
            }
            arenaReportDataType.EnemyHead        = MP.ReadUShort(-1);
            arenaReportDataType.EnemyName        = MP.ReadString(13, -1);
            arenaReportDataType.EnemyAllianceTag = MP.ReadString(3, -1);
            for (int l = 0; l < 5; l++)
            {
                arenaReportDataType.EnemyHeroData[l].SkillLV = new byte[4];
                arenaReportDataType.EnemyHeroData[l].ID      = MP.ReadUShort(-1);
                arenaReportDataType.EnemyHeroData[l].Level   = MP.ReadByte(-1);
                arenaReportDataType.EnemyHeroData[l].Rank    = MP.ReadByte(-1);
                arenaReportDataType.EnemyHeroData[l].Star    = MP.ReadByte(-1);
                arenaReportDataType.EnemyHeroData[l].Equip   = MP.ReadByte(-1);
                for (int m = 0; m < 4; m++)
                {
                    arenaReportDataType.EnemyHeroData[l].SkillLV[m] = MP.ReadByte(-1);
                }
            }
            arenaReportDataType.RandomSeed  = MP.ReadUShort(-1);
            arenaReportDataType.RandomGap   = MP.ReadByte(-1);
            arenaReportDataType.PrimarySide = MP.ReadByte(-1);
            arenaReportDataType.Time        = MP.ReadLong(-1);
            if (!this.bArenaOpenGet)
            {
                if (this.m_ArenaReportData.Count == 20)
                {
                    this.m_ArenaReportData.RemoveAt(0);
                }
                bool flag = false;
                if (this.RepoetUnReadCount > 0 && this.RepoetUnRead[0] == 0)
                {
                    flag = true;
                    this.RepoetUnReadCount -= 1;
                }
                if (flag)
                {
                    int num2 = 0;
                    while (num2 < (int)this.RepoetUnReadCount && this.RepoetUnReadCount < 19)
                    {
                        byte[] repoetUnRead  = this.RepoetUnRead;
                        int    num3          = num2;
                        byte[] repoetUnRead2 = this.RepoetUnRead;
                        int    num4          = num2 + 1;
                        repoetUnRead[num3] = (repoetUnRead2[num4] -= 1);
                        num2++;
                    }
                }
                else
                {
                    int num5 = 0;
                    while (num5 < (int)this.RepoetUnReadCount && num5 < this.RepoetUnRead.Length)
                    {
                        byte[] repoetUnRead3 = this.RepoetUnRead;
                        int    num6          = num5;
                        byte[] repoetUnRead4 = this.RepoetUnRead;
                        int    num7          = num5;
                        repoetUnRead3[num6] = (repoetUnRead4[num7] -= 1);
                        num5++;
                    }
                }
                this.m_ArenaReportData.Add(arenaReportDataType);
            }
            this.m_ArenaHistoryPlace = MP.ReadUInt(-1);
            GUIManager.Instance.BuildingData.UpdateBuildState(5, 255);
            GUIManager.Instance.UpdateUI(EGUIWindow.UI_Arena, 2, 0);
            GUIManager.Instance.UpdateUI(EGUIWindow.UI_TreasureBox, 5, 0);
            if (this.m_ArenaHistoryPlace > 0u && this.m_ArenaHistoryPlace < 65535u)
            {
                DataManager.MissionDataManager.CheckChanged(eMissionKind.Record, 29, (ushort)(65535u - this.m_ArenaHistoryPlace));
            }
            if ((arenaReportDataType.Flag & 2) != 0 && GUIManager.Instance.FindMenu(EGUIWindow.UI_BattleHeroSelect) != null)
            {
                if (WarManager.CheckVersion(arenaReportDataType.SimulatorVersion, arenaReportDataType.SimulatorPatchNo, true))
                {
                    this.ArenaPlayingData                 = arenaReportDataType;
                    BattleController.BattleMode           = EBattleMode.PVP;
                    GUIManager.Instance.bClearWindowStack = false;
                    if (GUIManager.Instance.m_WindowStack.Count > 0)
                    {
                        GUIManager.Instance.m_WindowStack.RemoveAt(GUIManager.Instance.m_WindowStack.Count - 1);
                    }
                    GUIManager.Instance.UpdateUI(EGUIWindow.UI_BattleHeroSelect, 0, 0);
                    DataManager.Instance.SetArenaHeroBattleDataSave();
                }
                else
                {
                    GUIManager.Instance.UpdateUI(EGUIWindow.UI_BattleHeroSelect, 6, 0);
                }
            }
            FBAdvanceManager.Instance.TriggerFbUniqueEvent(EFBEvent.FIRST_COLOSSEUM_BATTLE);
        }
        else
        {
            if (b == 6)
            {
                GUIManager.Instance.AddHUDMessage(DataManager.Instance.mStringTable.GetStringByID(9157u), 255, true);
            }
            GUIManager.Instance.UpdateUI(EGUIWindow.UI_BattleHeroSelect, 6, 0);
        }
    }