From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- Client/Assets/Scripts/XMainClient/UI/BattleMain.cs | 2004 ++++++++++++++++++++ 1 file changed, 2004 insertions(+) create mode 100644 Client/Assets/Scripts/XMainClient/UI/BattleMain.cs (limited to 'Client/Assets/Scripts/XMainClient/UI/BattleMain.cs') diff --git a/Client/Assets/Scripts/XMainClient/UI/BattleMain.cs b/Client/Assets/Scripts/XMainClient/UI/BattleMain.cs new file mode 100644 index 00000000..41ccd0fc --- /dev/null +++ b/Client/Assets/Scripts/XMainClient/UI/BattleMain.cs @@ -0,0 +1,2004 @@ +using System; +using System.Collections.Generic; +using KKSG; +using UILib; +using UnityEngine; +using XMainClient.UI.UICommon; +using XUpdater; +using XUtliPoolLib; + +namespace XMainClient.UI +{ + internal class BattleMain : DlgBase + { + public BattleSkillHandler SkillHandler + { + get + { + return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_SkillHandler; + } + } + + public BattleIndicateHandler IndicateHandler + { + get + { + return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_IndicateHandler; + } + } + + public XTeamMonitorHandler TeamMonitor + { + get + { + return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_TeamMonitor; + } + } + + public XBattleEnemyInfoHandler EnemyInfoHandler + { + get + { + return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_EnemyInfoHandler; + } + } + + public BattleTargetHandler BattleTargetHandler + { + get + { + return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_BattleTargetHandler; + } + } + + public XBattleTeamTowerHandler TeamTowerHandler + { + get + { + return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_TeamTowerHandler; + } + } + + public IXUILabel WarTimeLabel + { + get + { + return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_WarTime; + } + } + + public IXUILabel LeftTimeLabel + { + get + { + return (base.uiBehaviour == null) ? null : base.uiBehaviour.m_LeftTime; + } + } + + public BattleDpsHandler DpsHandler + { + get + { + return this.m_DpsHandler; + } + } + + private float _strength_preseved_precent + { + get + { + bool flag = this._current_strength_preseved > this._total_strength_preseved; + if (flag) + { + this._total_strength_preseved = this._current_strength_preseved; + } + return this._current_strength_preseved / this._total_strength_preseved; + } + } + + public override string fileName + { + get + { + return "Battle/BattleDlg"; + } + } + + public override int layer + { + get + { + return 1; + } + } + + public override bool isMainUI + { + get + { + return true; + } + } + + public static uint _pool_size = 5u; + + private float NoticeTime = 0f; + + private static Color32 _hp_green = new Color32(110, 174, 0, byte.MaxValue); + + private static Color32 _hp_yellow = new Color32(196, 180, 32, byte.MaxValue); + + private static Color32 _hp_red = new Color32(196, 57, 18, byte.MaxValue); + + private static float _fYellow = 0f; + + private static float _fRed = 0f; + + private bool _can_auto_play = false; + + private Vector2 m_DragDistance = Vector2.zero; + + private bool m_CancelRecord = false; + + private bool m_IsRecording = false; + + private uint m_ChatLabelCd = 0u; + + public ProfressionTrialsHandler ProfTrialsHandler; + + public BattleShowInfoHandler m_BattleShowInfoHandler = null; + + private BattleCaptainPVPHandler m_BattleCaptainPVPHandler = null; + + private GuildMinePVPBattleHandler m_GuildMinePVPBattleHandler = null; + + private GuildMinePVPInfoHandler m_GuildMinePVPInfoHandler = null; + + private SkyArenaBattleHandler m_SkyArenaBattleHandler = null; + + private SkyArenaInfoHandler m_SkyArenaInfoHandler = null; + + private AbyssPartyBattleHandler m_AbyssPartyBattleHandler = null; + + public BigMeleeBattleHandler m_BigMeleeBattleHandler = null; + + public BattleFieldBattleHandler m_BattleFieldBattleHandler = null; + + private XOptionsBattleHandler m_XOptionBattleHandler = null; + + private RaceBattleHandler m_RaceBattleHandler = null; + + public GuildMiniReportHandler m_miniReportHandler = null; + + public BattleRiftHandler m_riftHandler = null; + + public GuildBattleMiniRankHandler m_miniRankHandler = null; + + public HeroBattleSkillHandler m_HeroBattleSkillHandler = null; + + public HeroBattleHandler m_HeroBattleHandler = null; + + public MobaBattleHandler m_MobaBattleHandler = null; + + public WeekendPartyHandler m_WeekendPartyHandler = null; + + public BattleStatisticsHandler m_BattleStatisticsHandler = null; + + private BattleDpsHandler m_DpsHandler = null; + + private SceneType sceneType; + + private XLeftTimeCounter leftTimeCounter; + + public XLeftTimeCounter timeConnter; + + private List _notice_collection = new List(); + + private float _notice_duration = 0f; + + private float _notice_pertime = 1f; + + private List _combo_buff_list = new List(); + + private int _combo_buff_to_add = -1; + + private int _combo_buff_added = -1; + + private XBattleDocument _doc; + + private XApolloDocument apolloDoc; + + private uint time_token = 0u; + + public bool SpectateInfoIsShow; + + private XEntity _strength_preseved_entity = null; + + private float _total_strength_preseved = 1f; + + private float _current_strength_preseved = 0f; + + private float _last_check_time = 0f; + + private XTimerMgr.ElapsedEventHandler _showSingleNoticeCb = null; + + private XTimerMgr.ElapsedEventHandler _endBigNoticeCb = null; + + private XTimerMgr.ElapsedEventHandler _endBigNoticeCmdCb = null; + + private XTimerMgr.ElapsedEventHandler _onSwitchToTeamChatCb = null; + + private XTimerMgr.ElapsedEventHandler _hideBattleChatUICb = null; + + private XSwitchSight m_SwitchSight; + + private int _maxHP = 0; + + private int _currentHP = 0; + + private int _maxMP = 0; + + private int _currentMP = 0; + + public XYuyinView _yuyinHandler; + + private int type; + + private float lastPingTime = -60f; + + private float lastDebugUITrigger = -1f; + + private GameObject _big_notice = null; + + private uint _big_notice_timer_token = 0u; + + public BattleMain() + { + this._showSingleNoticeCb = new XTimerMgr.ElapsedEventHandler(this.ShowSingleNotice); + this._endBigNoticeCb = new XTimerMgr.ElapsedEventHandler(this.EndBigNotice); + this._endBigNoticeCmdCb = new XTimerMgr.ElapsedEventHandler(this.EndBigNoticeCmd); + this._onSwitchToTeamChatCb = new XTimerMgr.ElapsedEventHandler(this.OnSwitchToTeamChat); + this._hideBattleChatUICb = new XTimerMgr.ElapsedEventHandler(this.HideBattleChatUI); + BattleMain._fYellow = float.Parse(XSingleton.singleton.GetValue("HP_Yellow")); + BattleMain._fRed = float.Parse(XSingleton.singleton.GetValue("HP_Red")); + } + + protected override void Init() + { + this._doc = XDocuments.GetSpecificDocument(XBattleDocument.uuID); + this.apolloDoc = XDocuments.GetSpecificDocument(XApolloDocument.uuID); + this._doc.BattleMainView = this; + bool flag = XSingleton.singleton.Player != null && XSingleton.singleton.Player.Attributes != null; + if (flag) + { + this._doc.FakeTeamAdd(XSingleton.singleton.Player); + } + this.leftTimeCounter = new XLeftTimeCounter(base.uiBehaviour.m_LeftTime, true); + this.timeConnter = new XLeftTimeCounter(base.uiBehaviour.m_WarTime, false); + bool flag2 = XSingleton.singleton.SceneType == SceneType.SCENE_MOBA || XSingleton.singleton.SceneType == SceneType.SCENE_HORSE_RACE || XSingleton.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_HORSERACING; + if (flag2) + { + (base.uiBehaviour.m_PingFrame.GetComponent("PositionGroup") as IXPositionGroup).SetGroup(1); + base.uiBehaviour.m_RoleInfo.gameObject.SetActive(false); + } + string value = XSingleton.singleton.GetValue("ComboBuff"); + string[] array = value.Split(XGlobalConfig.AllSeparators); + for (int i = 0; i < array.Length; i += 3) + { + ComboBuff comboBuff = new ComboBuff(); + comboBuff.combo = int.Parse(array[i]); + comboBuff.buffID = int.Parse(array[i + 1]); + comboBuff.buffLevel = int.Parse(array[i + 2]); + BuffTable.RowData buffData = XSingleton.singleton.GetBuffData(comboBuff.buffID, comboBuff.buffLevel); + bool flag3 = buffData != null; + if (flag3) + { + comboBuff.buffName = buffData.BuffName; + } + else + { + XSingleton.singleton.AddErrorLog(string.Format("ComboBuff: Buff data not found: [{0} {1}]", comboBuff.buffID, comboBuff.buffLevel), null, null, null, null, null); + } + this._combo_buff_list.Add(comboBuff); + } + this.SetupHandler(); + } + + private void SetupHandler() + { + SceneType sceneType = XSingleton.singleton.SceneType; + if (sceneType <= SceneType.SCENE_WEEKEND4V4_DUCK) + { + if (sceneType != SceneType.SCENE_PVP) + { + switch (sceneType) + { + case SceneType.SKYCITY_FIGHTING: + DlgHandlerBase.EnsureCreate(ref this.m_SkyArenaBattleHandler, base.uiBehaviour.m_canvas, true, this); + DlgHandlerBase.EnsureCreate(ref this.m_SkyArenaInfoHandler, base.uiBehaviour.m_canvas, true, null); + break; + case SceneType.SCENE_PROF_TRIALS: + DlgHandlerBase.EnsureCreate(ref this.ProfTrialsHandler, base.uiBehaviour.m_canvas, true, this); + break; + case SceneType.SCENE_GPR: + break; + case SceneType.SCENE_RESWAR_PVP: + DlgHandlerBase.EnsureCreate(ref this.m_GuildMinePVPBattleHandler, base.uiBehaviour.m_canvas, true, null); + DlgHandlerBase.EnsureCreate(ref this.m_GuildMinePVPInfoHandler, base.uiBehaviour.m_canvas, true, null); + break; + default: + switch (sceneType) + { + case SceneType.SCENE_HORSE_RACE: + case SceneType.SCENE_WEEKEND4V4_HORSERACING: + DlgHandlerBase.EnsureCreate(ref this.m_RaceBattleHandler, base.uiBehaviour.m_canvas, true, this); + DlgHandlerBase.EnsureCreate(ref this.m_BattleShowInfoHandler, base.uiBehaviour.m_canvas, true, this); + break; + case SceneType.SCENE_HEROBATTLE: + DlgHandlerBase.EnsureCreate(ref this.m_HeroBattleSkillHandler, base.uiBehaviour.m_canvas, true, this); + DlgHandlerBase.EnsureCreate(ref this.m_HeroBattleHandler, base.uiBehaviour.m_canvas, true, this); + this.m_HeroBattleSkillHandler.HandlerType = 0; + break; + case SceneType.SCENE_CASTLE_WAIT: + case SceneType.SCENE_CASTLE_FIGHT: + DlgHandlerBase.EnsureCreate(ref this.m_miniRankHandler, base.uiBehaviour.m_canvas, true, this); + DlgHandlerBase.EnsureCreate(ref this.m_miniReportHandler, base.uiBehaviour.m_canvas, true, this); + break; + case SceneType.SCENE_ABYSS_PARTY: + DlgHandlerBase.EnsureCreate(ref this.m_AbyssPartyBattleHandler, base.uiBehaviour.m_canvas, true, null); + break; + case SceneType.SCENE_MOBA: + DlgHandlerBase.EnsureCreate(ref this.m_HeroBattleSkillHandler, base.uiBehaviour.m_canvas, true, this); + DlgHandlerBase.EnsureCreate(ref this.m_MobaBattleHandler, base.uiBehaviour.m_canvas, true, this); + this.m_HeroBattleSkillHandler.HandlerType = 2; + break; + case SceneType.SCENE_WEEKEND4V4_MONSTERFIGHT: + case SceneType.SCENE_WEEKEND4V4_GHOSTACTION: + case SceneType.SCENE_WEEKEND4V4_LIVECHALLENGE: + case SceneType.SCENE_WEEKEND4V4_CRAZYBOMB: + case SceneType.SCENE_WEEKEND4V4_DUCK: + DlgHandlerBase.EnsureCreate(ref this.m_WeekendPartyHandler, base.uiBehaviour.m_canvas, true, this); + break; + } + break; + } + } + else + { + DlgHandlerBase.EnsureCreate(ref this.m_BattleCaptainPVPHandler, base.uiBehaviour.m_canvas, true, this); + } + } + else if (sceneType != SceneType.SCENE_BIGMELEE_FIGHT) + { + if (sceneType != SceneType.SCENE_BATTLEFIELD_FIGHT) + { + if (sceneType == SceneType.SCENE_RIFT) + { + DlgHandlerBase.EnsureCreate(ref this.m_riftHandler, base.uiBehaviour.m_canvas, true, this); + } + } + else + { + DlgHandlerBase.EnsureCreate(ref this.m_BattleFieldBattleHandler, base.uiBehaviour.m_canvas, true, this); + } + } + else + { + DlgHandlerBase.EnsureCreate(ref this.m_BigMeleeBattleHandler, base.uiBehaviour.m_canvas, true, this); + } + bool loadSkillHandler = XHeroBattleDocument.LoadSkillHandler; + if (loadSkillHandler) + { + DlgHandlerBase.EnsureCreate(ref this.m_HeroBattleSkillHandler, base.uiBehaviour.m_canvas, true, this); + this.m_HeroBattleSkillHandler.HandlerType = 1; + } + } + + public override void RegisterEvent() + { + base.uiBehaviour.m_avatar.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnAvatarClick)); + base.uiBehaviour.m_pause.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnPauseClick)); + base.uiBehaviour.m_AutoPlay.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnAutoPlay)); + base.uiBehaviour.m_CancelAuto.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnAutoPlay)); + base.uiBehaviour.m_AutoPlayTip.RegisterSpriteClickEventHandler(new SpriteClickEventHandler(this.OnAutoPlayTip)); + base.uiBehaviour.m_HorseRide.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnHorseRideClicked)); + this.m_SwitchSight = new XSwitchSight(new ButtonClickEventHandler(this.OnSightSelectClick), base.uiBehaviour.m_25D, base.uiBehaviour.m_3D, base.uiBehaviour.m_3DFree); + base.uiBehaviour.m_BtnDamageStatistics.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnBattleStatisticsClick)); + base.uiBehaviour.m_Sight.RegisterClickEventHandler(new ButtonClickEventHandler(this.OnSightClick)); + } + + protected override void OnShow() + { + base.OnShow(); + XPlayerAttributes xplayerAttributes = XSingleton.singleton.Player.Attributes as XPlayerAttributes; + base.uiBehaviour.m_SightSelect.gameObject.SetActive(false); + DlgBase.singleton.Show(true); + DlgBase.singleton.Show(true); + base.uiBehaviour.m_objBossRush.SetActive(XSingleton.singleton.SceneType == SceneType.SCENE_BOSSRUSH); + this.lastPingTime = -60f; + this._combo_buff_to_add = -1; + this._combo_buff_added = -1; + int profID = XFastEnumIntEqualityComparer.ToInt(XSingleton.singleton.Player.PlayerAttributes.Profession); + base.uiBehaviour.m_avatar.spriteName = XSingleton.singleton.GetProfHeadIcon(profID); + this.SetTencentImage(); + base.uiBehaviour.m_Level.SetText(string.Format("{0}", XSingleton.singleton.XPlayerData.Level)); + base.uiBehaviour.m_Name.SetText(XSingleton.singleton.Player.Name); + XTeamDocument specificDocument = XDocuments.GetSpecificDocument(XTeamDocument.uuID); + this.SpectateInfoIsShow = false; + XSpectateSceneDocument specificDocument2 = XDocuments.GetSpecificDocument(XSpectateSceneDocument.uuID); + base.uiBehaviour.m_SpectateInfo.transform.localPosition = Vector3.one * (float)XGameUI._far_far_away; + specificDocument2.GetTargetNum(true); + this.OnSpectateMessageChange(0, 0); + base.uiBehaviour.m_TeamLeader.SetActive(specificDocument.bIsLeader); + base.uiBehaviour.m_AutoPlayBorad.SetVisible(false); + base.uiBehaviour.m_AutoPlayCancelBoard.SetVisible(false); + base.uiBehaviour.m_SkillHandler.SetVisible(true); + base.uiBehaviour.m_IndicateHandler.SetVisible(true); + base.uiBehaviour.m_lblKill.SetVisible(false); + base.uiBehaviour.m_SceneName.SetText(XSingleton.singleton.SceneData.Comment); + SceneTable.RowData sceneData = XSingleton.singleton.GetSceneData(XSingleton.singleton.SceneID); + bool flag = sceneData.TimeCounter == null || sceneData.TimeCounter.Length < 1; + if (flag) + { + this.SetTimeRecord(); + } + else + { + bool flag2 = sceneData.TimeCounter[0] == 1; + if (flag2) + { + bool flag3 = sceneData.TimeCounter.Length > 2; + if (flag3) + { + this.SetLeftTime((uint)sceneData.TimeCounter[1], (int)sceneData.TimeCounter[2]); + } + else + { + this.SetLeftTime((uint)sceneData.TimeCounter[1], -1); + } + } + } + XCombatStatisticsDocument specificDocument3 = XDocuments.GetSpecificDocument(XCombatStatisticsDocument.uuID); + DlgHandlerBase.EnsureCreate(ref this.m_DpsHandler, base.uiBehaviour.m_DpsPanel, this, specificDocument3.bShowDps); + bool visible = false; + SeqListRef winCondition = sceneData.WinCondition; + for (int i = 0; i < winCondition.Count; i++) + { + bool flag4 = winCondition[i, 0] == 8; + if (flag4) + { + visible = true; + } + } + base.uiBehaviour.m_lblKill.SetVisible(visible); + this.UpdateKill(0); + this.sceneType = (SceneType)sceneData.type; + SceneType sceneType = this.sceneType; + if (sceneType <= SceneType.SCENE_TOWER) + { + if (sceneType != SceneType.SCENE_BATTLE) + { + switch (sceneType) + { + case SceneType.SCENE_WORLDBOSS: + case SceneType.SCENE_GUILD_BOSS: + base.uiBehaviour.m_WorldBossHandler.SetVisible(true); + break; + case (SceneType)8: + case SceneType.SCENE_BOSSRUSH: + case SceneType.SCENE_GUILD_HALL: + break; + case SceneType.SCENE_PK: + { + XQualifyingDocument specificDocument4 = XDocuments.GetSpecificDocument(XQualifyingDocument.uuID); + bool flag5 = specificDocument4.PkInfoList.Count > 0; + if (flag5) + { + this.SetEnemyRoleInfo(specificDocument4.PkInfoList[0].brief.roleName, specificDocument4.PkInfoList[0].brief.roleLevel); + } + break; + } + case SceneType.SCENE_ABYSSS: + break; + default: + if (sceneType == SceneType.SCENE_TOWER) + { + base.uiBehaviour.m_TeamTowerHandler.SetVisible(true); + } + break; + } + } + } + else if (sceneType <= SceneType.SCENE_GUILD_CAMP) + { + switch (sceneType) + { + case SceneType.SCENE_GODDESS: + case SceneType.SCENE_ENDLESSABYSS: + this.GetTeamLeftTimes(); + break; + case SceneType.SCENE_DRAGON_EXP: + break; + case SceneType.SCENE_RISK: + break; + default: + if (sceneType != SceneType.SCENE_GUILD_CAMP) + { + } + break; + } + } + else if (sceneType != SceneType.SCENE_INVFIGHT) + { + if (sceneType == SceneType.SCENE_CASTLE_WAIT) + { + base.uiBehaviour.m_SkillHandler.SetVisible(false); + } + } + else + { + XPKInvitationDocument specificDocument5 = XDocuments.GetSpecificDocument(XPKInvitationDocument.uuID); + bool flag6 = specificDocument5.PKInfoList.Count > 0; + if (flag6) + { + this.SetEnemyRoleInfo(specificDocument5.PKInfoList[0].roleName, specificDocument5.PKInfoList[0].roleLevel); + } + } + this.SetWinConditionTips(); + this.SetBattleExplainTips(); + XPlayerAttributes xplayerAttributes2 = XSingleton.singleton.Player.Attributes as XPlayerAttributes; + bool flag7 = XSingleton.singleton.CanAutoPlay(XSingleton.singleton.SceneID); + bool flag8 = XSingleton.singleton.XPlayerData.Level < uint.Parse(XSingleton.singleton.GetValue("AutoPlayUnlockLevel")); + base.uiBehaviour.m_AutoPlayContent.SetActive(flag7); + bool flag9 = flag7; + if (flag9) + { + this._can_auto_play = true; + bool flag10 = flag8; + if (flag10) + { + base.uiBehaviour.m_AutoPlayBorad.SetVisible(true); + base.uiBehaviour.m_AutoPlay.SetEnable(false, false); + base.uiBehaviour.m_AutoPlayLock.SetVisible(true); + } + else + { + bool flag11 = this.sceneType == SceneType.SCENE_GODDESS; + if (flag11) + { + base.uiBehaviour.m_AutoPlayCancelBoard.SetVisible(true); + } + else + { + bool autoPlayOn = xplayerAttributes2.AutoPlayOn; + if (autoPlayOn) + { + base.uiBehaviour.m_AutoPlayCancelBoard.SetVisible(true); + } + else + { + base.uiBehaviour.m_AutoPlayBorad.SetVisible(true); + } + } + base.uiBehaviour.m_AutoPlayLock.SetVisible(false); + base.uiBehaviour.m_AutoPlay.SetEnable(true, false); + } + } + else + { + this._can_auto_play = false; + xplayerAttributes2.AutoPlayOn = false; + } + SceneType sceneType2 = this.sceneType; + if (sceneType2 != SceneType.SCENE_ARENA && sceneType2 != SceneType.SCENE_PK && sceneType2 != SceneType.SCENE_INVFIGHT) + { + this.EnemyInfoHandler.InitBoss(); + } + else + { + this.EnemyInfoHandler.InitRole(); + } + XTeamDocument specificDocument6 = XDocuments.GetSpecificDocument(XTeamDocument.uuID); + bool flag12 = XSingleton.singleton.SceneType == SceneType.SCENE_PVP; + if (flag12) + { + XBattleCaptainPVPDocument specificDocument7 = XDocuments.GetSpecificDocument(XBattleCaptainPVPDocument.uuID); + this.TeamMonitor.InitWhenShowMainUIByBloodList(specificDocument7.TeamBlood); + } + else + { + bool flag13 = XSingleton.singleton.SceneType == SceneType.SCENE_HEROBATTLE; + if (flag13) + { + XHeroBattleDocument specificDocument8 = XDocuments.GetSpecificDocument(XHeroBattleDocument.uuID); + this.TeamMonitor.InitWhenShowMainUIByBloodList(specificDocument8.TeamBlood); + } + else + { + bool flag14 = XSingleton.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_CRAZYBOMB || XSingleton.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_GHOSTACTION || XSingleton.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_HORSERACING || XSingleton.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_LIVECHALLENGE || XSingleton.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_MONSTERFIGHT || XSingleton.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_DUCK; + if (flag14) + { + XWeekendPartyDocument specificDocument9 = XDocuments.GetSpecificDocument(XWeekendPartyDocument.uuID); + this.TeamMonitor.InitWhenShowMainUIByBloodList(specificDocument9.TeamBlood); + } + else + { + this.TeamMonitor.InitWhenShowMainUIByTeam(specificDocument6.MyTeam); + } + } + } + bool flag15 = XSingleton.singleton.SceneID != 100u && XSingleton.singleton.SceneType != SceneType.SCENE_CALLBACK && (ulong)XSingleton.singleton.XPlayerData.Level >= (ulong)((long)int.Parse(XSingleton.singleton.GetValue("ShowChatLevelBattle"))); + if (flag15) + { + ShowSettingArgs showSettingArgs = new ShowSettingArgs(); + showSettingArgs.position = 2; + showSettingArgs.showsettings = false; + showSettingArgs.enablebackclick = true; + showSettingArgs.enabledrag = false; + DlgBase.singleton.ShowChatMiniUI(showSettingArgs); + } + base.uiBehaviour.m_StrengthPresevedBar.SetVisible(this._doc.ShowStrengthPresevedBar); + this.RefreshYuyin(); + this.InitView(); + bool flag16 = this.apolloDoc != null; + if (flag16) + { + this.apolloDoc.RequestJoinRoom(); + } + bool flag17 = XSingleton.singleton.SceneType == SceneType.SKYCITY_FIGHTING || XSingleton.singleton.SceneType == SceneType.SCENE_BIGMELEE_FIGHT; + if (flag17) + { + base.uiBehaviour.m_SkyAreanStage.gameObject.SetActive(true); + } + else + { + base.uiBehaviour.m_SkyAreanStage.gameObject.SetActive(false); + } + bool flag18 = (ulong)XSingleton.singleton.SceneID == (ulong)((long)int.Parse(XSingleton.singleton.GetValue("GuildCampHorseSceneID"))); + if (flag18) + { + base.uiBehaviour.m_HorseRide.gameObject.SetActive(true); + } + else + { + base.uiBehaviour.m_HorseRide.gameObject.SetActive(false); + } + base.uiBehaviour.m_GuildMineBuff.gameObject.SetActive(false); + base.uiBehaviour.m_pauseGroup.SetGroup((XSingleton.singleton.SceneType == SceneType.SCENE_MOBA) ? 1 : 0); + base.uiBehaviour.m_3D25D.gameObject.SetActive(XSingleton.singleton.SceneType != SceneType.SCENE_MOBA); + base.uiBehaviour.m_BtnDamageStatistics.SetVisible(sceneData.ShowBattleStatistics); + base.uiBehaviour.m_Menu.Refresh(); + } + + private void InitView() + { + this.SetView(XSingleton.singleton.OperationMode); + } + + public void SetView(XOperationMode mode) + { + bool flag = base.uiBehaviour == null || base.uiBehaviour.m_SightPic == null || base.uiBehaviour.m_SelectPic == null || base.uiBehaviour.m_SightSelect == null; + if (!flag) + { + switch (mode) + { + case XOperationMode.X25D: + base.uiBehaviour.m_SightPic.SetSprite("l_zdicon_1_1"); + base.uiBehaviour.m_SelectPic.SetSprite("l_zdicon_1_1"); + break; + case XOperationMode.X3D: + base.uiBehaviour.m_SightPic.SetSprite("l_zdicon_1_0"); + base.uiBehaviour.m_SelectPic.SetSprite("l_zdicon_1_0"); + break; + case XOperationMode.X3D_Free: + base.uiBehaviour.m_SightPic.SetSprite("l_zdicon_1_2"); + base.uiBehaviour.m_SelectPic.SetSprite("l_zdicon_1_2"); + break; + } + base.uiBehaviour.m_SightPic.MakePixelPerfect(); + base.uiBehaviour.m_SelectPic.MakePixelPerfect(); + base.uiBehaviour.m_SightSelect.gameObject.SetActive(false); + } + } + + private void SetStartAutoPlay() + { + this.SetAutoPlay(true); + } + + private void GetTeamLeftTimes() + { + XTeamDocument specificDocument = XDocuments.GetSpecificDocument(XTeamDocument.uuID); + specificDocument.ReqTeamOp(TeamOperate.TEAM_QUERYCOUNT, 0UL, null, TeamMemberType.TMT_NORMAL, null); + } + + private void SetWinConditionTips() + { + SceneTable.RowData sceneData = XSingleton.singleton.GetSceneData(XSingleton.singleton.SceneID); + bool flag = sceneData == null || string.IsNullOrEmpty(sceneData.WinConditionTips); + if (flag) + { + base.uiBehaviour.m_winConditionTips.SetVisible(false); + } + else + { + base.uiBehaviour.m_winConditionTips.SetVisible(true); + string text = sceneData.WinConditionTips.Replace("/n", "\n"); + base.uiBehaviour.m_winConditionTips.SetText(text); + } + } + + private void SetBattleExplainTips() + { + SceneTable.RowData sceneData = XSingleton.singleton.GetSceneData(XSingleton.singleton.SceneID); + bool flag = sceneData == null || string.IsNullOrEmpty(sceneData.BattleExplainTips); + if (flag) + { + base.uiBehaviour.m_BattleExplainTips.SetVisible(false); + } + else + { + base.uiBehaviour.m_BattleExplainTips.SetVisible(true); + string text = XSingleton.singleton.ReplaceReturn(sceneData.BattleExplainTips); + base.uiBehaviour.m_BattleExplainTips.SetText(text); + } + } + + public void SetTeamLeftTimes() + { + base.uiBehaviour.m_leftTimes.SetVisible(true); + XExpeditionDocument specificDocument = XDocuments.GetSpecificDocument(XExpeditionDocument.uuID); + SceneTable.RowData sceneData = XSingleton.singleton.GetSceneData(XSingleton.singleton.SceneID); + bool flag = sceneData.type == 20; + if (flag) + { + int dayCount = specificDocument.GetDayCount(TeamLevelType.TeamLevelGoddessTrial, null); + int dayMaxCount = specificDocument.GetDayMaxCount(TeamLevelType.TeamLevelGoddessTrial, null); + base.uiBehaviour.m_leftTimes.SetText(string.Format("{0}({1}/{2})", XStringDefineProxy.GetString("GODDESS_NAME"), dayMaxCount - dayCount, dayMaxCount)); + } + else + { + bool flag2 = sceneData.type == 23; + if (flag2) + { + int dayCount = specificDocument.GetDayCount(TeamLevelType.TeamLevelEndlessAbyss, null); + int dayMaxCount = specificDocument.GetDayMaxCount(TeamLevelType.TeamLevelEndlessAbyss, null); + base.uiBehaviour.m_leftTimes.SetText(string.Format("{0}({1}/{2})", XStringDefineProxy.GetString("EndlessAbyss"), dayMaxCount - dayCount, dayMaxCount)); + } + else + { + base.uiBehaviour.m_leftTimes.SetVisible(false); + } + } + } + + protected override void OnLoad() + { + this._maxHP = 0; + this._currentHP = 0; + this._maxMP = 0; + this._currentMP = 0; + base.OnLoad(); + DlgHandlerBase.EnsureCreate(ref this._yuyinHandler, base.uiBehaviour.transform, true, this); + } + + protected override void OnHide() + { + base.uiBehaviour.m_SkillHandler.SetVisible(false); + bool flag = DlgBase.singleton.IsLoaded(); + if (flag) + { + DlgBase.singleton.SetVisible(false, true); + } + bool flag2 = DlgBase.singleton.IsLoaded(); + if (flag2) + { + DlgBase.singleton.Show(false); + } + bool flag3 = DlgBase.singleton.IsLoaded(); + if (flag3) + { + DlgBase.singleton.Show(false); + } + bool flag4 = DlgBase.singleton.IsLoaded(); + if (flag4) + { + DlgBase.singleton.SetVisible(false, true); + } + this._maxHP = 0; + this._currentHP = 0; + this._maxMP = 0; + this._currentMP = 0; + base.OnHide(); + } + + protected override void OnUnload() + { + this.m_uiBehaviour.m_txtHead.SetTexturePath(""); + DlgHandlerBase.EnsureUnload(ref this.m_BattleShowInfoHandler); + DlgHandlerBase.EnsureUnload(ref this.m_BattleCaptainPVPHandler); + DlgHandlerBase.EnsureUnload(ref this.m_GuildMinePVPBattleHandler); + DlgHandlerBase.EnsureUnload(ref this.m_GuildMinePVPInfoHandler); + DlgHandlerBase.EnsureUnload(ref this.m_SkyArenaBattleHandler); + DlgHandlerBase.EnsureUnload(ref this.m_SkyArenaInfoHandler); + DlgHandlerBase.EnsureUnload(ref this.m_AbyssPartyBattleHandler); + DlgHandlerBase.EnsureUnload(ref this.m_BigMeleeBattleHandler); + DlgHandlerBase.EnsureUnload(ref this.m_BattleFieldBattleHandler); + DlgHandlerBase.EnsureUnload(ref this.m_XOptionBattleHandler); + DlgHandlerBase.EnsureUnload(ref this.m_RaceBattleHandler); + DlgHandlerBase.EnsureUnload(ref base.uiBehaviour.m_WorldBossHandler); + DlgHandlerBase.EnsureUnload(ref base.uiBehaviour.m_SkillHandler); + DlgHandlerBase.EnsureUnload(ref base.uiBehaviour.m_IndicateHandler); + DlgHandlerBase.EnsureUnload(ref base.uiBehaviour.m_TeamMonitor); + DlgHandlerBase.EnsureUnload(ref base.uiBehaviour.m_EnemyInfoHandler); + DlgHandlerBase.EnsureUnload(ref base.uiBehaviour.m_PlayerBuffMonitorHandler); + DlgHandlerBase.EnsureUnload(ref this.ProfTrialsHandler); + DlgHandlerBase.EnsureUnload(ref this.m_DpsHandler); + DlgHandlerBase.EnsureUnload(ref this._yuyinHandler); + DlgHandlerBase.EnsureUnload(ref this.m_HeroBattleSkillHandler); + DlgHandlerBase.EnsureUnload(ref this.m_HeroBattleHandler); + DlgHandlerBase.EnsureUnload(ref this.m_MobaBattleHandler); + DlgHandlerBase.EnsureUnload(ref this.m_miniReportHandler); + DlgHandlerBase.EnsureUnload(ref this.m_miniRankHandler); + DlgHandlerBase.EnsureUnload(ref this.m_riftHandler); + DlgHandlerBase.EnsureUnload(ref this.m_WeekendPartyHandler); + DlgHandlerBase.EnsureUnload(ref this.m_BattleStatisticsHandler); + this._doc.BattleMainView = null; + bool flag = this.apolloDoc != null; + if (flag) + { + this.apolloDoc.QuitRoom(); + } + this.ClearBigNotice(); + base.OnUnload(); + } + + private void RefreshYuyin() + { + this.type = XFastEnumIntEqualityComparer.ToInt(XSingleton.singleton.SceneType); + bool flag = this._yuyinHandler != null; + if (flag) + { + this._yuyinHandler.Refresh(this.type); + } + } + + public void RefreshYuyin(ulong uid) + { + bool flag = this._yuyinHandler != null; + if (flag) + { + this._yuyinHandler.Refresh(this.type); + } + } + + private void SetEnemyRoleInfo(string name, uint level) + { + } + + private bool OnTailToBackClick(IXUIButton go) + { + XSingleton.singleton.GameCamera.Tail.TailToBack(); + return true; + } + + private bool OnPauseClick(IXUIButton go) + { + bool flag = !base.IsLoaded(); + bool result; + if (flag) + { + result = true; + } + else + { + SceneTable.RowData sceneData = XSingleton.singleton.GetSceneData(XSingleton.singleton.SceneID); + bool flag2 = sceneData != null; + if (flag2) + { + bool canPause = sceneData.CanPause; + if (canPause) + { + XSingleton.singleton.Pause = true; + } + } + bool flag3 = this.m_XOptionBattleHandler == null; + if (flag3) + { + bool flag4 = base.uiBehaviour != null; + if (flag4) + { + DlgHandlerBase.EnsureCreate(ref this.m_XOptionBattleHandler, base.uiBehaviour.m_canvas, true, this); + } + } + bool flag5 = this.m_XOptionBattleHandler != null && !this.m_XOptionBattleHandler.IsVisible(); + if (flag5) + { + this.m_XOptionBattleHandler.ShowUI(); + } + this.sceneType = XSingleton.singleton.SceneType; + result = true; + } + return result; + } + + private void OnAvatarClick(IXUISprite go) + { + bool flag = !base.IsLoaded(); + if (!flag) + { + bool flag2 = DlgBase.singleton.IsVisible(); + DlgBase.singleton.SetVisible(!flag2, true); + } + } + + public void SetTencentImage() + { + bool flag = XSingleton.singleton.playerInfo != null; + if (flag) + { + string pictureLarge = XSingleton.singleton.playerInfo.data.pictureLarge; + XSingleton.singleton.Load(pictureLarge, this.m_uiBehaviour.m_txtHead, this.m_uiBehaviour); + } + else + { + XSingleton.singleton.Load(string.Empty, this.m_uiBehaviour.m_txtHead, this.m_uiBehaviour); + } + XPrerogativeDocument specificDocument = XDocuments.GetSpecificDocument(XPrerogativeDocument.uuID); + XSingleton.singleton.ParseHeadIcon(specificDocument.PlayerSetid, base.uiBehaviour.m_sprFrame); + } + + private bool OnBussrushPauseClick(IXUIButton btn) + { + XSingleton.singleton.ReqLeaveScene(); + DlgBase.singleton.SetVisible(false, true); + return true; + } + + public void ShowBossrushQuit() + { + DlgBase.singleton.SetVisible(true, true); + DlgBase.singleton.SetSingleButtonMode(false); + string @string = XStringDefineProxy.GetString("BOSSRUSH_QUIT"); + string string2 = XStringDefineProxy.GetString("COMMON_OK"); + string string3 = XStringDefineProxy.GetString("COMMON_CANCEL"); + DlgBase.singleton.SetLabelsWithSymbols(@string, string2, string3); + DlgBase.singleton.SetModalCallback(new ButtonClickEventHandler(this.OnBussrushPauseClick), null); + } + + private void UpdatePlayerInfo() + { + XPlayerAttributes xplayerData = XSingleton.singleton.XPlayerData; + bool flag = xplayerData != null; + if (flag) + { + int num = (int)xplayerData.GetAttr(XAttributeDefine.XAttr_MaxHP_Total); + int num2 = (int)xplayerData.GetAttr(XAttributeDefine.XAttr_CurrentHP_Basic); + int num3 = (int)xplayerData.GetAttr(XAttributeDefine.XAttr_MaxMP_Total); + int num4 = (int)xplayerData.GetAttr(XAttributeDefine.XAttr_CurrentMP_Basic); + bool flag2 = num2 < 0; + if (flag2) + { + num2 = 0; + } + float num5 = (float)num2 / (float)num; + base.uiBehaviour.m_Hpbar.SetFillAmount(num5); + float fillAmount = (float)num4 / (float)num3; + base.uiBehaviour.m_Mpbar.SetFillAmount(fillAmount); + bool flag3 = this._currentHP != num2 || this._maxHP != num; + if (flag3) + { + base.uiBehaviour.m_HpText.SetText(string.Format("{0}/{1}", num2, num)); + this._currentHP = num2; + this._maxHP = num; + } + bool flag4 = this._currentMP != num4 || this._maxMP != num3; + if (flag4) + { + base.uiBehaviour.m_MpText.SetText(string.Format("{0}/{1}", num4, num3)); + this._currentMP = num4; + this._maxMP = num3; + } + Color color; + bool active; + BattleMain.GetHPColor(num5, out color, out active); + base.uiBehaviour.m_LowHP.SetActive(active); + } + } + + public static void GetHPColor(float hpPercent, out Color color, out bool bLowHP) + { + bool flag = hpPercent > BattleMain._fYellow; + if (flag) + { + color = BattleMain._hp_green; + bLowHP = false; + } + else + { + bool flag2 = hpPercent <= BattleMain._fYellow && hpPercent > BattleMain._fRed; + if (flag2) + { + color = BattleMain._hp_yellow; + bLowHP = false; + } + else + { + color = BattleMain._hp_red; + bLowHP = true; + } + } + } + + public void OnPlayerBuffChange() + { + base.uiBehaviour.m_PlayerBuffMonitorHandler.OnBuffChanged(XSingleton.singleton.Player.Buffs.GetUIBuffList()); + } + + public override void OnUpdate() + { + base.uiBehaviour.m_SkillHandler.OnUpdate(); + bool flag = !XSingleton.singleton.NeedFixedUpdate; + if (!flag) + { + base.OnUpdate(); + bool flag2 = this.lastDebugUITrigger > 0f; + if (flag2) + { + this.lastDebugUITrigger -= Time.deltaTime; + } + bool flag3 = this.lastDebugUITrigger <= 0f && Input.GetKey((KeyCode)285); + if (flag3) + { + DlgBase.singleton.Toggle(); + this.lastDebugUITrigger = 0.05f; + } + bool key = Input.GetKey((KeyCode)96); + if (key) + { + bool flag4 = Input.GetKey((KeyCode)256) || Input.GetKey((KeyCode)48); + if (flag4) + { + XSingleton.singleton.CustomCommand(0); + } + bool flag5 = Input.GetKey((KeyCode)257) || Input.GetKey((KeyCode)49); + if (flag5) + { + XSingleton.singleton.CustomCommand(1); + } + bool flag6 = Input.GetKey((KeyCode)258) || Input.GetKey((KeyCode)50); + if (flag6) + { + XSingleton.singleton.CustomCommand(2); + } + bool flag7 = Input.GetKey((KeyCode)259) || Input.GetKey((KeyCode)51); + if (flag7) + { + XSingleton.singleton.CustomCommand(3); + } + bool flag8 = Input.GetKey((KeyCode)260) || Input.GetKey((KeyCode)52); + if (flag8) + { + XSingleton.singleton.CustomCommand(4); + } + bool flag9 = Input.GetKey((KeyCode)261) || Input.GetKey((KeyCode)53); + if (flag9) + { + XSingleton.singleton.CustomCommand(5); + } + bool flag10 = Input.GetKey((KeyCode)262) || Input.GetKey((KeyCode)54); + if (flag10) + { + XSingleton.singleton.CustomCommand(6); + } + bool flag11 = Input.GetKey((KeyCode)263) || Input.GetKey((KeyCode)55); + if (flag11) + { + XSingleton.singleton.CustomCommand(7); + } + bool flag12 = Input.GetKey((KeyCode)264) || Input.GetKey((KeyCode)56); + if (flag12) + { + XSingleton.singleton.CustomCommand(8); + } + bool flag13 = Input.GetKey((KeyCode)265) || Input.GetKey((KeyCode)57); + if (flag13) + { + XSingleton.singleton.CustomCommand(9); + } + } + this.UpdatePlayerInfo(); + this.UpdateWifi(); + bool flag14 = Time.unscaledTime - this.lastPingTime > 60f || this.lastPingTime < 0f; + if (flag14) + { + this.RefreshPing(); + this.lastPingTime = Time.unscaledTime; + } + base.uiBehaviour.m_IndicateHandler.OnUpdate(); + bool flag15 = Time.time - this._last_check_time > 5f; + if (flag15) + { + this._last_check_time = Time.time; + this._doc.SendCheckTime(); + } + this.UpdateTime(); + this.UpdateLeftTime(); + bool flag16 = this.NoticeTime > 0f; + if (flag16) + { + bool flag17 = Time.time - this.NoticeTime > this._notice_duration; + if (flag17) + { + base.uiBehaviour.m_NoticeFrame.transform.localPosition = XGameUI.Far_Far_Away; + this.NoticeTime = 0f; + } + } + bool active = base.uiBehaviour.m_WorldBossHandler.active; + if (active) + { + base.uiBehaviour.m_WorldBossHandler.OnUpdate(); + } + IXGameSirControl gameSirControl = XSingleton.singleton.GameSirControl; + bool flag18 = gameSirControl != null && gameSirControl.IsConnected() && gameSirControl.GetButton(XGameSirKeyCode.BTN_THUMBR); + if (flag18) + { + XOptionsDocument specificDocument = XDocuments.GetSpecificDocument(XOptionsDocument.uuID); + int num = specificDocument.GetValue(XOptionsDefine.OD_VIEW) + 1; + int num2 = XFastEnumIntEqualityComparer.ToInt(XOperationMode.X3D_Free); + bool flag19 = num > num2; + if (flag19) + { + num = XFastEnumIntEqualityComparer.ToInt(XOperationMode.X25D); + } + specificDocument.SetValue(XOptionsDefine.OD_VIEW, num, false); + specificDocument.SetBattleOptionValue(); + this.SetView((XOperationMode)num); + } + this.TeamMonitor.OnUpdate(); + this.EnemyInfoHandler.OnUpdate(); + base.uiBehaviour.m_PlayerBuffMonitorHandler.OnUpdate(); + bool flag20 = this._combo_buff_to_add > this._combo_buff_added; + if (flag20) + { + ComboBuff comboBuff = this._combo_buff_list[this._combo_buff_to_add]; + XBuff buffByID = XSingleton.singleton.Player.Buffs.GetBuffByID(comboBuff.buffID); + bool flag21 = buffByID != null; + if (flag21) + { + this._combo_buff_added = this._combo_buff_to_add; + this._combo_buff_to_add = -1; + } + } + bool flag22 = this._combo_buff_added >= 0; + if (flag22) + { + ComboBuff comboBuff2 = this._combo_buff_list[this._combo_buff_added]; + XBuff buffByID2 = XSingleton.singleton.Player.Buffs.GetBuffByID(comboBuff2.buffID); + bool flag23 = buffByID2 != null; + if (flag23) + { + float leftTime = buffByID2.GetLeftTime(); + Color comboQuality = this.GetComboQuality(this._combo_buff_added + 1); + base.uiBehaviour.m_ComboBuffName.SetText(comboBuff2.buffName); + base.uiBehaviour.m_ComboBuffName.SetColor(comboQuality); + base.uiBehaviour.m_ComboBuffTime.gameObject.SetActive(true); + bool flag24 = leftTime != -1f; + if (flag24) + { + base.uiBehaviour.m_ComboBuffTime.value = leftTime / buffByID2.Duration; + } + else + { + base.uiBehaviour.m_ComboBuffTime.value = 1f; + } + } + else + { + this._combo_buff_added = -1; + base.uiBehaviour.m_ComboBuffTime.gameObject.SetActive(false); + } + } + else + { + base.uiBehaviour.m_ComboBuffTime.gameObject.SetActive(false); + } + bool flag25 = base.uiBehaviour.m_StrengthPresevedBar.IsVisible(); + if (flag25) + { + this.RefreshStrengthPresevedBar(); + } + } + } + + protected Color GetComboQuality(int quality) + { + Color result; + switch (quality) + { + case 1: + result = new Color32(0, byte.MaxValue, 18, byte.MaxValue); + break; + case 2: + result = new Color32(0, 228, byte.MaxValue, byte.MaxValue); + break; + case 3: + result = new Color32(byte.MaxValue, 180, 0, byte.MaxValue); + break; + case 4: + result = new Color32(252, 0, byte.MaxValue, byte.MaxValue); + break; + default: + result = new Color32(252, 0, byte.MaxValue, byte.MaxValue); + break; + } + return result; + } + + private void UpdateWifi() + { + XSingleton.singleton.UpdateWifi(null, this.m_uiBehaviour.m_sprwifi); + } + + private void RefreshPing() + { + XSingleton.singleton.RefreshPing(base.uiBehaviour.m_lblTime, base.uiBehaviour.m_sliderBattery, base.uiBehaviour.m_lblfree); + } + + public void RefreshBossRush() + { + XBossBushDocument xbossBushDocument = XSingleton.singleton.Doc.GetXComponent(XBossBushDocument.uuID) as XBossBushDocument; + bool flag = xbossBushDocument != null && XSingleton.singleton.SceneType == SceneType.SCENE_BOSSRUSH; + if (flag) + { + this.m_uiBehaviour.m_sprBuff1.SetSprite(xbossBushDocument.bossBuff1Row.icon); + this.m_uiBehaviour.m_sprBuff2.SetSprite(xbossBushDocument.bossBuff2Row.icon); + this.m_uiBehaviour.m_lblBuff1.SetText(xbossBushDocument.bossBuff1Row.Comment); + this.m_uiBehaviour.m_lblBuff2.SetText(xbossBushDocument.bossBuff2Row.Comment); + int quality = xbossBushDocument.bossBuff1Row.Quality; + int quality2 = xbossBushDocument.bossBuff2Row.Quality; + string value = XSingleton.singleton.GetValue("Quality" + quality + "Color"); + string value2 = XSingleton.singleton.GetValue("Quality" + quality2 + "Color"); + this.m_uiBehaviour.m_sprBuff1.SetColor(XSingleton.singleton.ParseColor(value, 0)); + this.m_uiBehaviour.m_sprBuff2.SetColor(XSingleton.singleton.ParseColor(value2, 0)); + this.m_uiBehaviour.m_lblBuff1.SetColor(XSingleton.singleton.ParseColor(value, 0)); + this.m_uiBehaviour.m_lblBuff2.SetColor(XSingleton.singleton.ParseColor(value2, 0)); + base.uiBehaviour.m_lblTitle.SetText(XStringDefineProxy.GetString("BOSSRUSH_FIGHT", new object[] + { + xbossBushDocument.respData.currank + }) + " " + DlgBase.singleton.bossName); + base.uiBehaviour.m_rwdpool.ReturnAll(false); + for (int i = 0; i < xbossBushDocument.bossRushRow.reward.Count; i++) + { + uint itemid = xbossBushDocument.bossRushRow.reward[i, 0]; + uint num = xbossBushDocument.bossRushRow.reward[i, 1]; + GameObject gameObject = base.uiBehaviour.m_rwdpool.FetchGameObject(false); + XSingleton.singleton.normalItemDrawer.DrawItem(gameObject, (int)itemid, (int)(num * xbossBushDocument.rwdRate), false); + bool flag2 = i < 2; + if (flag2) + { + gameObject.transform.localPosition = new Vector3((float)(10 + 100 * i), 0f, 0f); + } + else + { + gameObject.transform.localPosition = new Vector3((float)(10 + 100 * (i - 2)), -100f, 0f); + } + } + base.uiBehaviour.m_sprBossbg.spriteHeight = ((xbossBushDocument.bossRushRow.reward.Count > 2) ? 207 : 137); + } + } + + public void UpdateKill(int cnt) + { + bool flag = base.IsVisible(); + if (flag) + { + string @string = XStringDefineProxy.GetString("SMALLMONSTER_KILL"); + base.uiBehaviour.m_lblKill.SetText(string.Format(XStringDefineProxy.GetString("SMALLMONSTER_KILL"), cnt)); + } + } + + public void OnComboChange(uint combo) + { + bool flag = combo > 0u; + if (flag) + { + this.m_uiBehaviour.m_ComboFrame.transform.localPosition = Vector3.zero; + this.m_uiBehaviour.m_ComboText.SetText(combo.ToString()); + IXUITweenTool comboBgTween = this.m_uiBehaviour.m_ComboBgTween; + comboBgTween.PlayTween(true, -1f); + bool hasComboBuff = XSingleton.singleton.SceneData.HasComboBuff; + if (hasComboBuff) + { + int num = -1; + bool flag2 = (ulong)combo < (ulong)((long)this._combo_buff_list[0].combo); + if (flag2) + { + num = -1; + } + else + { + bool flag3 = (ulong)combo > (ulong)((long)this._combo_buff_list[this._combo_buff_list.Count - 1].combo); + if (flag3) + { + num = -1; + } + else + { + for (int i = 0; i < this._combo_buff_list.Count - 1; i++) + { + bool flag4 = (ulong)combo == (ulong)((long)this._combo_buff_list[i].combo); + if (flag4) + { + num = i; + break; + } + } + } + } + bool flag5 = num >= 0 && num <= this._combo_buff_list.Count - 1; + if (flag5) + { + XBuffAddEventArgs @event = XEventPool.GetEvent(); + @event.xBuffDesc.BuffID = this._combo_buff_list[num].buffID; + @event.xBuffDesc.BuffLevel = this._combo_buff_list[num].buffLevel; + @event.Firer = XSingleton.singleton.Player; + @event.xBuffDesc.CasterID = XSingleton.singleton.Player.ID; + XSingleton.singleton.FireEvent(@event); + this._combo_buff_to_add = num; + } + else + { + base.uiBehaviour.m_ComboBuffTime.gameObject.SetActive(false); + } + } + else + { + base.uiBehaviour.m_ComboBuffTime.gameObject.SetActive(false); + } + } + else + { + this.m_uiBehaviour.m_ComboFrame.transform.localPosition = Vector3.one * (float)XGameUI._far_far_away; + } + } + + public void ShowNotice(string text, float duration, float pertime = 1f) + { + this._notice_collection.Clear(); + string[] array = text.Split(XGlobalConfig.ListSeparator); + for (int i = 0; i < array.Length; i++) + { + this._notice_collection.Add(array[i]); + } + this._notice_duration = duration; + this._notice_pertime = pertime; + bool flag = this.time_token > 0u; + if (flag) + { + XSingleton.singleton.KillTimer(this.time_token); + this.time_token = 0u; + } + bool flag2 = this._notice_collection.Count > 0; + if (flag2) + { + this.ShowSingleNotice(0); + } + } + + protected void ShowSingleNotice(object o) + { + int num = (int)o; + bool flag = num < this._notice_collection.Count; + if (flag) + { + string text = this._notice_collection[num]; + base.uiBehaviour.m_Notice.SetText(text); + base.uiBehaviour.m_NoticeFrame.transform.localPosition = base.uiBehaviour.m_NoticePos; + this.NoticeTime = Time.time; + this.time_token = XSingleton.singleton.SetTimer(this._notice_pertime, this._showSingleNoticeCb, num + 1); + bool flag2 = num == this._notice_collection.Count - 1; + if (flag2) + { + this._notice_collection.Clear(); + } + } + } + + public void StopNotice() + { + bool flag = this.time_token > 0u; + if (flag) + { + XSingleton.singleton.KillTimer(this.time_token); + this.time_token = 0u; + } + base.uiBehaviour.m_NoticeFrame.transform.localPosition = XGameUI.Far_Far_Away; + } + + public void ShowSkillRemainingCD(string skillName, float time) + { + this.ShowBigNotice(XStringDefineProxy.GetString("SkillRemainingCD", new object[] + { + skillName, + time.ToString() + }), false); + } + + public void ShowBigNotice(string text, bool bCmd) + { + bool flag = !base.IsVisible(); + if (!flag) + { + XSingleton.singleton.KillTimer(this._big_notice_timer_token); + bool flag2 = this._big_notice == null; + if (flag2) + { + this._big_notice = (XSingleton.singleton.CreateFromPrefab("UI/Common/TutorialButtomText", true, false) as GameObject); + this._big_notice.transform.parent = base.uiBehaviour.transform; + this._big_notice.transform.localPosition = Vector3.zero; + this._big_notice.transform.localScale = Vector3.one; + } + IXUILabel ixuilabel = this._big_notice.transform.Find("TutorialText").GetComponent("XUILabel") as IXUILabel; + ixuilabel.SetText(text); + IXUITweenTool ixuitweenTool = this._big_notice.GetComponent("XUIPlayTween") as IXUITweenTool; + ixuitweenTool.PlayTween(true, -1f); + if (bCmd) + { + this._big_notice_timer_token = XSingleton.singleton.SetTimer(5f, this._endBigNoticeCmdCb, null); + } + else + { + this._big_notice_timer_token = XSingleton.singleton.SetTimer(3f, this._endBigNoticeCb, null); + } + } + } + + protected void EndBigNotice(object o) + { + bool flag = this._big_notice != null; + if (flag) + { + XResourceLoaderMgr.SafeDestroy(ref this._big_notice, true); + } + this._big_notice_timer_token = 0u; + } + + protected void EndBigNoticeCmd(object o) + { + bool flag = this._big_notice != null; + if (flag) + { + XResourceLoaderMgr.SafeDestroy(ref this._big_notice, true); + XSingleton.singleton.ExecuteNextCmd(); + } + this._big_notice_timer_token = 0u; + } + + protected void ClearBigNotice() + { + bool flag = this._big_notice != null; + if (flag) + { + XResourceLoaderMgr.SafeDestroy(ref this._big_notice, true); + } + XSingleton.singleton.KillTimer(this._big_notice_timer_token); + this._big_notice_timer_token = 0u; + } + + public void ShowAutoReviveFrame(int time, uint cost, uint costType) + { + bool flag = base.uiBehaviour.m_WorldBossHandler != null && base.uiBehaviour.m_WorldBossHandler.active; + if (flag) + { + base.uiBehaviour.m_WorldBossHandler.SetAutoRevive(time, cost, costType); + } + } + + public void OnPlayerRevive() + { + bool flag = base.uiBehaviour.m_WorldBossHandler != null && base.uiBehaviour.m_WorldBossHandler.active; + if (flag) + { + base.uiBehaviour.m_WorldBossHandler.HideAutoRevive(); + } + base.uiBehaviour.m_LowHP.SetActive(false); + } + + public float GetLeftTime() + { + return this.leftTimeCounter.GetFloatLeftTime(); + } + + public void HideLeftTime() + { + this.timeConnter.SetLeftTime(0f, -1); + this.leftTimeCounter.SetLeftTime(0f, -1); + base.uiBehaviour.m_LeftTime.SetVisible(false); + base.uiBehaviour.m_WarTime.SetVisible(false); + } + + public void SetLeftTime(uint seconds, int noticeTime = -1) + { + base.uiBehaviour.m_LeftTime.SetVisible(true); + this.leftTimeCounter.SetLeftTime(seconds, noticeTime); + base.uiBehaviour.m_WarTime.SetVisible(false); + } + + public void SetTimeRecord() + { + base.uiBehaviour.m_WarTime.SetVisible(true); + this.timeConnter.SetForward(1); + this.timeConnter.SetLeftTime(0.01f, -1); + base.uiBehaviour.m_LeftTime.SetVisible(false); + } + + public void ResetLeftTime(int seconds) + { + SceneTable.RowData sceneData = XSingleton.singleton.GetSceneData(XSingleton.singleton.SceneID); + bool flag = sceneData.TimeCounter == null || sceneData.TimeCounter.Length < 1; + if (flag) + { + this.timeConnter.SetLeftTime((float)seconds, -1); + } + else + { + bool flag2 = sceneData.TimeCounter[0] == 1; + if (flag2) + { + this.leftTimeCounter.SetLeftTime((float)((int)sceneData.TimeCounter[1] - seconds), -1); + } + } + } + + private void UpdateLeftTime() + { + bool sceneStarted = XSingleton.singleton.SceneStarted; + if (sceneStarted) + { + this.leftTimeCounter.Update(); + } + } + + private void UpdateTime() + { + bool sceneStarted = XSingleton.singleton.SceneStarted; + if (sceneStarted) + { + this.timeConnter.Update(); + } + } + + public void OnSwitchToTeamChat(object obj) + { + DlgBase.singleton.SelectChatTeam(); + } + + public void OnVoiceButtonDrag(IXUIButton sp, Vector2 delta) + { + this.m_DragDistance += delta; + bool flag = this.m_DragDistance.magnitude >= 100f; + if (flag) + { + this.m_CancelRecord = true; + } + else + { + this.m_CancelRecord = false; + } + } + + public void OnVoiceButton(IXUIButton sp, bool state) + { + if (state) + { + XSingleton.singleton.AddLog("Press down", null, null, null, null, null, XDebugColor.XDebug_None); + this.m_DragDistance = Vector2.zero; + this.m_IsRecording = true; + bool useApollo = XChatDocument.UseApollo; + if (useApollo) + { + XSingleton.singleton.StartRecord(VoiceUsage.CHAT, null); + } + else + { + XSingleton.singleton.StartRecord(VoiceUsage.CHAT, null); + } + } + else + { + XSingleton.singleton.AddLog("Press up", null, null, null, null, null, XDebugColor.XDebug_None); + this.m_IsRecording = false; + DlgBase.singleton.SetActiveChannel(ChatChannelType.Team); + bool useApollo2 = XChatDocument.UseApollo; + if (useApollo2) + { + XSingleton.singleton.StopRecord(this.m_CancelRecord); + } + else + { + XSingleton.singleton.StopRecord(this.m_CancelRecord); + } + } + } + + public void OnStopVoiceRecord() + { + bool isRecording = this.m_IsRecording; + if (isRecording) + { + DlgBase.singleton.SetActiveChannel(ChatChannelType.Team); + bool useApollo = XChatDocument.UseApollo; + if (useApollo) + { + XSingleton.singleton.StopRecord(this.m_CancelRecord); + } + else + { + XSingleton.singleton.StopRecord(this.m_CancelRecord); + } + this.m_IsRecording = false; + } + } + + public bool OnCommandBtnClick(IXUIButton btn) + { + return true; + } + + public bool OnAutoPlay(IXUIButton sp) + { + bool flag = !base.IsLoaded(); + return flag || this.SetAutoPlay(sp.ID == 1UL); + } + + private bool OnHorseRideClicked(IXUIButton btn) + { + bool flag = !base.IsLoaded(); + bool result; + if (flag) + { + result = true; + } + else + { + XPetDocument specificDocument = XDocuments.GetSpecificDocument(XPetDocument.uuID); + specificDocument.ReqRecentMount(); + result = true; + } + return result; + } + + private bool SetAutoPlay(bool isAuto) + { + XPlayerAttributes xplayerAttributes = XSingleton.singleton.Player.Attributes as XPlayerAttributes; + xplayerAttributes.AutoPlayOn = isAuto; + XAIComponent ai = XSingleton.singleton.Player.AI; + bool flag = ai != null && !XSingleton.singleton.bSpectator; + if (flag) + { + XAIEnableAI @event = XEventPool.GetEvent(); + @event.Firer = XSingleton.singleton.Player; + @event.Enable = isAuto; + @event.Puppet = false; + XSingleton.singleton.FireEvent(@event); + } + bool autoPlayOn = xplayerAttributes.AutoPlayOn; + if (autoPlayOn) + { + base.uiBehaviour.m_AutoPlayBorad.SetVisible(false); + base.uiBehaviour.m_AutoPlayCancelBoard.SetVisible(true); + XSingleton.singleton.ShowSystemNoticeTip(XStringDefineProxy.GetString("AutoPlayNotice")); + } + else + { + base.uiBehaviour.m_AutoPlayBorad.SetVisible(true); + base.uiBehaviour.m_AutoPlayCancelBoard.SetVisible(false); + } + return true; + } + + private void OnAutoPlayTip(IXUISprite go) + { + bool flag = !base.IsLoaded(); + if (!flag) + { + bool flag2 = XSingleton.singleton.SceneType == SceneType.SCENE_ARENA; + if (flag2) + { + XSingleton.singleton.ShowSystemNoticeTip(XStringDefineProxy.GetString("ArenaAutoFight")); + } + else + { + XSingleton.singleton.ShowSystemNoticeTip(string.Format(XStringDefineProxy.GetString("AutoFightOpenLevel"), XSingleton.singleton.GetValue("AutoPlayUnlockLevel"))); + } + } + } + + private bool OnBattleStatisticsClick(IXUIButton btn) + { + bool flag = base.uiBehaviour == null; + bool result; + if (flag) + { + result = true; + } + else + { + DlgHandlerBase.EnsureCreate(ref this.m_BattleStatisticsHandler, base.uiBehaviour.m_canvas.transform, this.m_BattleStatisticsHandler == null || !this.m_BattleStatisticsHandler.IsVisible(), this); + result = true; + } + return result; + } + + public void ShowBattleVoice(ChatVoiceInfo info) + { + bool flag = !base.IsVisible(); + if (!flag) + { + this.m_ChatLabelCd = XSingleton.singleton.SetTimer((float)info.voiceTime + 2f, this._hideBattleChatUICb, info); + } + } + + public void HideBattleChatUI(object info) + { + this.m_ChatLabelCd = 0u; + } + + public void ShowCountDownFrame(bool status) + { + bool flag = !base.IsVisible(); + if (!flag) + { + base.uiBehaviour.m_CountDownFrame.gameObject.SetActive(true); + base.uiBehaviour.m_CountDownTimeFrame.gameObject.SetActive(status); + base.uiBehaviour.m_CountDownBeginFrame.gameObject.SetActive(!status); + (base.uiBehaviour.m_CountDownTimeFrame.gameObject.GetComponent("XUIPlayTween") as IXUITweenTool).PlayTween(status, -1f); + (base.uiBehaviour.m_CountDownBeginFrame.gameObject.GetComponent("XUIPlayTween") as IXUITweenTool).PlayTween(!status, -1f); + } + } + + public void SetAutoPlayUI(bool isInAutoPlay) + { + bool flag = !this._can_auto_play; + if (!flag) + { + this.SetAutoPlay(isInAutoPlay); + } + } + + public void OnPlaySuperarmorFx(XEntity enemy, bool bBroken) + { + for (int i = 0; i < this.EnemyInfoHandler.EnemyList.Count; i++) + { + bool flag = this.EnemyInfoHandler.EnemyList[i].Entity == enemy; + if (flag) + { + this.EnemyInfoHandler.EnemyList[i].SetSuperArmorState(bBroken); + break; + } + } + } + + public void OnStopSuperarmorFx(XEntity enemy) + { + for (int i = 0; i < this.EnemyInfoHandler.EnemyList.Count; i++) + { + bool flag = this.EnemyInfoHandler.EnemyList[i].Entity == enemy; + if (flag) + { + this.EnemyInfoHandler.EnemyList[i].StopSuperArmorFx(); + break; + } + } + } + + public void OnProjectDamage(ProjectDamageResult damage, XEntity entity) + { + for (int i = 0; i < this.EnemyInfoHandler.EnemyList.Count; i++) + { + bool flag = this.EnemyInfoHandler.EnemyList[i].Entity == entity; + if (flag) + { + bool flag2 = damage.Caster == XSingleton.singleton.XPlayerData.RoleID; + if (flag2) + { + this.EnemyInfoHandler.EnemyList[i].OnBeHit(damage); + } + break; + } + } + } + + public void SetupSpeedFx(XEntity enemy, bool enable, Color c) + { + for (int i = 0; i < this.EnemyInfoHandler.EnemyList.Count; i++) + { + bool flag = this.EnemyInfoHandler.EnemyList[i].Entity == enemy; + if (flag) + { + IXUISprite uiSuperArmorSpeedFx = this.EnemyInfoHandler.EnemyList[i].m_uiSuperArmorSpeedFx; + uiSuperArmorSpeedFx.gameObject.SetActive(enable); + uiSuperArmorSpeedFx.SetColor(c); + break; + } + } + } + + public void ShowStrengthPresevedBar(XEntity entity) + { + base.uiBehaviour.m_StrengthPresevedBar.SetVisible(true); + this._strength_preseved_entity = entity; + this._total_strength_preseved = (float)this._strength_preseved_entity.Attributes.GetAttr(XAttributeDefine.XAttr_CurrentXULI_Basic); + this._current_strength_preseved = this._total_strength_preseved; + this.RefreshStrengthPresevedBar(); + } + + public void HideStrengthPresevedBar() + { + base.uiBehaviour.m_StrengthPresevedBar.SetVisible(false); + this._strength_preseved_entity = null; + this._total_strength_preseved = 1f; + this._current_strength_preseved = 0f; + } + + public void RefreshStrengthPresevedBar() + { + bool flag = this._strength_preseved_entity != null && this._strength_preseved_entity.Attributes != null; + if (flag) + { + this._current_strength_preseved = (float)this._strength_preseved_entity.Attributes.GetAttr(XAttributeDefine.XAttr_CurrentXULI_Basic); + } + bool flag2 = base.uiBehaviour != null && base.uiBehaviour.m_StrengthPresevedBar != null; + if (flag2) + { + base.uiBehaviour.m_StrengthPresevedBar.value = this._strength_preseved_precent; + } + } + + public void SetTargetTabVisable(bool status) + { + } + + public void OnTargetTabClick(IXUISprite sp) + { + } + + public bool OnSightSelectClick(IXUIButton sp) + { + bool flag = !base.IsLoaded(); + bool result; + if (flag) + { + result = true; + } + else + { + this.SetView((XOperationMode)sp.ID); + result = true; + } + return result; + } + + public bool OnSightClick(IXUIButton sp) + { + bool flag = !base.IsLoaded(); + bool result; + if (flag) + { + result = true; + } + else + { + bool flag2 = base.uiBehaviour == null || base.uiBehaviour.m_SightSelect == null; + if (flag2) + { + result = false; + } + else + { + bool activeSelf = base.uiBehaviour.m_SightSelect.gameObject.activeSelf; + if (activeSelf) + { + base.uiBehaviour.m_SightSelect.gameObject.SetActive(false); + } + else + { + base.uiBehaviour.m_SightSelect.gameObject.SetActive(true); + } + result = true; + } + } + return result; + } + + public void OnSpectateMessageChange(int watchNum, int commendNum) + { + XSpectateSceneDocument specificDocument = XDocuments.GetSpecificDocument(XSpectateSceneDocument.uuID); + bool spectateInfoIsShow = this.SpectateInfoIsShow; + if (spectateInfoIsShow) + { + base.uiBehaviour.m_WatchNum.SetText(watchNum.ToString()); + base.uiBehaviour.m_CommendNum.SetText(commendNum.ToString()); + } + else + { + bool flag = watchNum >= specificDocument.WatchTarget || commendNum >= specificDocument.CommendTarget; + if (flag) + { + XSingleton.singleton.AddLog("watchNum and commendNum are enough now.", null, null, null, null, null, XDebugColor.XDebug_None); + this.SpectateInfoIsShow = true; + base.uiBehaviour.m_SpectateInfo.transform.localPosition = Vector3.zero; + base.uiBehaviour.m_WatchNum.SetText(watchNum.ToString()); + base.uiBehaviour.m_CommendNum.SetText(commendNum.ToString()); + } + } + } + + public void ShowGuildMineBuff(ResWarBuffRes data) + { + bool flag = data == null || !base.IsLoaded(); + if (!flag) + { + bool flag2 = XSingleton.singleton.SceneType == SceneType.SCENE_RESWAR_PVE; + if (flag2) + { + GuildMineralBufflist.RowData mineBuffData = XGuildMineMainDocument.GetMineBuffData(data.buffid); + bool flag3 = mineBuffData == null; + if (flag3) + { + XSingleton.singleton.AddErrorLog("buffid:" + data.buffid, null, null, null, null, null); + } + else + { + uint num = mineBuffData.Quality - 1u; + base.uiBehaviour.m_GuildMineBuff.gameObject.SetActive(true); + base.uiBehaviour.m_GuildMineBuff.SetSprite(mineBuffData.icon); + base.uiBehaviour.m_GuildMineBuffText.SetText(mineBuffData.ratestring); + bool flag4 = (ulong)num >= (ulong)((long)DlgBase.singleton.BossColor.Length); + if (flag4) + { + XSingleton.singleton.AddErrorLog(string.Concat(new object[] + { + "bossMineBuffIndex:", + num, + "\nBossColor:", + DlgBase.singleton.BossColor.Length + }), null, null, null, null, null); + num = 0u; + } + bool flag5 = (ulong)num < (ulong)((long)DlgBase.singleton.BossColor.Length); + if (flag5) + { + base.uiBehaviour.m_GuildMineBuff.SetColor(XSingleton.singleton.ParseColor(DlgBase.singleton.BossColor[(int)num], 0)); + base.uiBehaviour.m_GuildMineBuffText.SetColor(XSingleton.singleton.ParseColor(DlgBase.singleton.BossColor[(int)num], 0)); + } + } + } + } + } + + public void SetLoadingPrompt(List otherPalyerName, bool canAutoClose = false) + { + bool flag = !base.IsLoaded() || XSingleton.singleton.CurrentStage.Stage != EXStage.World || !XSingleton.singleton.SyncMode; + if (!flag) + { + bool flag2 = otherPalyerName == null || otherPalyerName.Count == 0; + if (flag2) + { + this.m_uiBehaviour.m_PromptLabel.SetText(XStringDefineProxy.GetString("WAIT_FOR_OTHERS")); + bool flag3 = canAutoClose && this.m_uiBehaviour.m_PromptFrame.gameObject.activeSelf; + if (flag3) + { + this.m_uiBehaviour.m_PromptFrame.gameObject.SetActive(false); + } + } + else + { + string text = string.Format(XSingleton.singleton.ReplaceReturn(XSingleton.singleton.GetString("WAIT_OTHER_PLAYER_PVP")), otherPalyerName.Count, otherPalyerName[0]); + this.m_uiBehaviour.m_PromptLabel.SetText(text); + } + } + } + } +} -- cgit v1.1-26-g67d0