local HomeMain_Controller = {} local private = {} local EventSystem = require('Event/EventSystem') local LuaFuncEntry = require("Main/LuaFuncEntry") local firstNotices = {} local secondNotices = {} HomeMain_Controller.NoticeType = { FriendApply = 1, -- 好友申请 GuildInvitedIn = 2, -- 势力邀请 TeamApply = 3, -- 入队申请 TeamInvite = 4, -- 组队邀请 ClimbTower = 5, -- 爬塔 百战雄关 FullEnergy = 6, -- 体力满 Mail = 7, -- 邮件 PresonChat = 8, -- 私聊 GuildEscortReport = 9, -- 势力押运战报 OpenRedPacket = 10, -- 打开红包 DragonArteryRankResult = 11, -- 龙脉国家排名结算 GVGFight = 12, -- 攻城略地 GuildMineFinish = 13, -- 势力挖矿——自己的矿收获 GuildMineHelp = 14, -- 势力挖矿——求助 SpecialTeamApply = 15, -- 战团申请 SpecialTeamInvite = 16, -- 战团邀请 PetBreeding = 17, --宠物繁殖中 PetBreedApply = 18, --宠物繁殖邀请 PetBreedFinish = 19, --宠物繁殖完成 SlgGvE = 20, --汉中风云势力SlgGvE SoloFight = 21, --演武对决降品推送 ThreeTeamFight = 22, --巅峰演武降级推送 } HomeMain_Controller.ViewType = { MainCity = 1, Battle = 2, SoloFight = 3, TeamBattle = 4, GuildBossTown = 5, GuildBoss = 6, LoginFree = 7, SyncSolo = 8, GuildParty = 9, WorldBoss = 10, WarZoneWorldBoss = 11, DemonGod = 12, GuildEscort = 13, GuildEscortBattle = 14, HeroMatch1v1Lobby = 15, SyncCountryPVP = 16, SyncTeamPVP = 17, -- 不知何时没的,现在加回来 CountryNightBoss = 18, CrossTournamentTown = 19, -- 天下会武等待区 HeroMatch3v3Lobby = 20, --天地群雄3v3等待区 ThreeTeamFight = 21, --群雄演武(9v9) ExpelMonster = 22, --元旦活动恶兽驱役 TeamFairChampionshipLobby = 23,--天下会武3V3,大厅 RogueLike = 24, -- 肉鸽战斗内 HeroAwakePlayer = 25, --英雄觉醒最终试炼(打其他玩家) HeroAwakeBoss = 26, --英雄觉醒试炼活动,打左慈 } local dontDestroyView = { Const_UI_Lua.UIEnum.UISceneControllerPanel, Const_UI_Lua.UIEnum.UIVirtualController, Const_UI_Lua.UIEnum.UIBatteryPanel, } local dontDestroyView_Replay = { Const_UI_Lua.UIEnum.UISceneControllerPanel, Const_UI_Lua.UIEnum.UIBatteryPanel, } local mainCityView = { Const_UI_Lua.UIEnum.UITownHome, Const_UI_Lua.UIEnum.UIChannelChatGlobalChatDlg, Const_UI_Lua.UIEnum.UIActivityNotice, } local battleView = { Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, -- Const_UI_Lua.UIEnum.UIChannelChatGlobalChatDlg, } local heroAwakeBossView = { Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UIAwakenActivityBattle, } local heroAwakePlayerView = { Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, Const_UI_Lua.UIEnum.UIHeroAwakenBattleInfo, } local battleView_Replay = { Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, Const_UI_Lua.UIEnum.UIReplayControlPanel, } local loginFreeView = { Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, Const_UI_Lua.UIEnum.UISkillJoystick, } local SyncTeamPVPView = { Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, Const_UI_Lua.UIEnum.UISkillJoystick, -- Const_UI_Lua.UIEnum.UIChannelChatGlobalChatDlg, Const_UI_Lua.UIEnum.UIBattleChatDlg, Const_UI_Lua.UIEnum.UIBattleTeamPVPBattlePanel, } local SyncTeamPVPView_Replay = { Const_UI_Lua.UIEnum.UIReplayTeamPVPBattlePanel, Const_UI_Lua.UIEnum.UIReplayControlPanel, Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, } local worldBossView = { Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, Const_UI_Lua.UIEnum.UIWorldBossBattle } local WarZoneWorldBossView = { Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, Const_UI_Lua.UIEnum.UIWorldBossBattle } local demonGodView = { Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, Const_UI_Lua.UIEnum.UIDemonGodBattle, } local teamBattleView = { Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, } local soloFightView = { Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, } local threeTeamFightView = { Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, Const_UI_Lua.UIEnum.UIBattleChatDlg, } local guildBossTownView = { Const_UI_Lua.UIEnum.UIGuildBossBattle, Const_UI_Lua.UIEnum.UIBattleChatDlg, } local guildBossView = { Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIGuildBossBattle, Const_UI_Lua.UIEnum.UIBattleChatDlg, } local syncSoloBattleView = { Const_UI_Lua.UIEnum.UISyncSoloBattlePanel, Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, } local syncSoloBattleView_Replay = { Const_UI_Lua.UIEnum.UISyncSoloBattlePanel, Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIReplayControlPanel, Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, } local guildPartyView = { Const_UI_Lua.UIEnum.UITownHome, Const_UI_Lua.UIEnum.UIChannelChatGlobalChatDlg, Const_UI_Lua.UIEnum.UIActivityNotice, } local guildWarView = { Const_UI_Lua.UIEnum.UIGuildWarCampTopView, Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, } local guildWarReadyView = { Const_UI_Lua.UIEnum.UIChannelChatGlobalChatDlg, Const_UI_Lua.UIEnum.UIGuildWarCampTopView, } local syncDigTeamPVEView = { Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, Const_UI_Lua.UIEnum.UIDigTreasureInBattleTeam, } local fightThroneTownView = { Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIChannelChatGlobalChatDlg, Const_UI_Lua.UIEnum.UIFightThroneBattleInfo, } local fightThroneBattleView = { Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, Const_UI_Lua.UIEnum.UIFightThroneBattleInfo, } local dragonArteryRegistAreaView = { Const_UI_Lua.UIEnum.UITownHome, Const_UI_Lua.UIEnum.UIChannelChatGlobalChatDlg, } local dragonArteryWaitingAreaView = { Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIChannelChatGlobalChatDlg, Const_UI_Lua.UIEnum.UIDragonArteryBattleInfo, } local dragonArteryBattleView = { Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, Const_UI_Lua.UIEnum.UIDragonArteryBattleInfo, Const_UI_Lua.UIEnum.UIBattleMultiBossPanel, } local dragonArteryBattleView_Replay = { Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIDragonArteryBattleInfo, Const_UI_Lua.UIEnum.UIBattleMultiBossPanel, Const_UI_Lua.UIEnum.UIReplayControlPanel, } local dontMergeView = { Const_UI_Lua.UIEnum.UIEntityNamePanel, Const_UI_Lua.UIEnum.UIEntityGeneralPanel, Const_UI_Lua.UIEnum.UIEntityHeroPanel, Const_UI_Lua.UIEnum.UIEntityHurtNumber3DPanel, "Broadcast/UIGMBroadcast", } local guildEscortView = { Const_UI_Lua.UIEnum.UITownHome, Const_UI_Lua.UIEnum.UIGuildEscortTownPanel, Const_UI_Lua.UIEnum.UIChannelChatGlobalChatDlg, Const_UI_Lua.UIEnum.UIActivityNotice, } local guildEscortPVPView = { Const_UI_Lua.UIEnum.UIBattleGuildEscortPanel, Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, } local countryPVPView = { Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIBattleEnemyPanel, Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, Const_UI_Lua.UIEnum.UIBattleChatDlg, } local countryNightBossView = { Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, } local heroMatch1v1LobbyView = { Const_UI_Lua.UIEnum.UITownHome, Const_UI_Lua.UIEnum.UIHeroMatch1v1LobbyInfo, Const_UI_Lua.UIEnum.UIChannelChatGlobalChatDlg, } local heroMatch3v3LobbyView = { Const_UI_Lua.UIEnum.UITownHome, Const_UI_Lua.UIEnum.UIHeroMatch3v3LobbyInfo, Const_UI_Lua.UIEnum.UIChannelChatGlobalChatDlg, } local teamFairChampionshipLobbyView = { Const_UI_Lua.UIEnum.UITownHome, Const_UI_Lua.UIEnum.UITeamFairChampionshipLobbyInfo, Const_UI_Lua.UIEnum.UIChannelChatGlobalChatDlg, } local heroMatch1v1PVPView = { Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, Const_UI_Lua.UIEnum.UIHeroMatch1v1InBattleInfo, } local heroMatch3v3PVPView = { Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, Const_UI_Lua.UIEnum.UIHeroMatch3v3InBattleInfo, } local heroMatch1v1WatchBattleView = { Const_UI_Lua.UIEnum.UIInBattleWatchView, Const_UI_Lua.UIEnum.UIHeroMatch1v1InBattleInfo, } local heroMatch3v3WatchBattleView = { Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, Const_UI_Lua.UIEnum.UIInBattleWatchView, Const_UI_Lua.UIEnum.UIHeroMatch3v3InBattleInfo, } local fairSoloTournamentWatchBattleView = { Const_UI_Lua.UIEnum.UISyncSoloBattlePanel, Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, Const_UI_Lua.UIEnum.UIInBattleWatchView, } local teamFairChampionshipWatchBattleView = { Const_UI_Lua.UIEnum.UIBattleExtraInfoPanel, Const_UI_Lua.UIEnum.UIBattleTeamPVPBattlePanel, Const_UI_Lua.UIEnum.UIInBattleWatchView, } local SyncFourCountryChaosBattleView = { Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, Const_UI_Lua.UIEnum.UISyncFourCountryWarBattlePanel, } -- 天下会武的等待区 local crossTournamentTownView = { Const_UI_Lua.UIEnum.UITownHome, Const_UI_Lua.UIEnum.UIChannelChatGlobalChatDlg, Const_UI_Lua.UIEnum.UIFairSoloTournamentLobbyInfo, } -- RogueLike 战斗 local rogueLikeBattleView = { Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, Const_UI_Lua.UIEnum.UIRogueBattleAttackPanel, } local changAnSiegeBattleView = { Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, Const_UI_Lua.UIEnum.UIChangAnSiegeBattle, } local changAnSiegeWaitView = { Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIBattleChatDlg, Const_UI_Lua.UIEnum.UIChangAnSiegeBattle, } local expelMonsterView = { Const_UI_Lua.UIEnum.UIInBattleView, Const_UI_Lua.UIEnum.UIBattleAttackPanel, Const_UI_Lua.UIEnum.UISkillJoystick, Const_UI_Lua.UIEnum.UIBattleChatDlg, Const_UI_Lua.UIEnum.UIExpelMonsterBattle, Const_UI_Lua.UIEnum.UIExpelMonsterCountDown, } local preLevelType = nil local preIsReplayBattle = nil local preLevelId = nil local wasLeader = false private.IsChatDlgSmall = true function HomeMain_Controller.OnStartup() private.SetupEntryFunc(true) EventSystem.Regist(EventID.UI_MainShowDialogue, private.ShowDialogue) EventSystem.Regist(EventID.UI_MainShowTips, private.ShowBlueDialogue) EventSystem.Regist(EventID.UI_MainShowYellowTips, private.ShowYellowDialogue) EventSystem.Regist(EventID.UI_MainShowBattleReport, private.ShowBattleReport) EventSystem.Regist(EventID.UI_MainShowLightDialogue, private.ShowLightDialogue) EventSystem.Regist(EventID.UI_MainShowDragonArteryDialogue, private.ShowDragonArteryDialogue) EventSystem.Regist(EventID.UI_Delay_FocusOnTownHome , private.PopTownHomeDelayView) EventSystem.Regist(EventID.UI_SyncSolo_OpenCountDownPanel , private.OpenCountDownPanel) private.delayTownHomeViewList = {} private.enterTownRestoreView = nil private.focusTarget = nil private.switchSceneKeepChatting = DataSheetManager.ConstData:GetDataByID("SwitchSceneKeepChatting").IntListValue end function private.SetupEntryFunc(isRegist) LuaFuncEntry.SetupMainEntryFunc(isRegist, LuaFuncEntry.FuncType.TimeLineActive, private.TimeLineActive) end function HomeMain_Controller.OnShutdown() private.SetupEntryFunc(false) end function HomeMain_Controller.GetDontDestroyView() local returnList = {} local viewList = dontDestroyView if LevelManager.IsReplayBattle() then viewList = dontDestroyView_Replay end local index = #viewList for i=1, index do returnList[i] = viewList[i]; end if CTL.MiniMap.IsShowMiniMap() then returnList[index+1] = Const_UI_Lua.UIEnum.UIMiniMapMain end return returnList end function HomeMain_Controller.OpenMainSceneUI() EventSystem.UnRegist(EventID.UI_Delay_FocusOnTownHome, private.PopTownHomeDelayView) private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.MainCity)) private.OpenMapInfoView() private.OpenBackView() EventSystem.Regist(EventID.UI_Delay_FocusOnTownHome , private.PopTownHomeDelayView) EventSystem.Dispatch(EventID.UI_HomeMain_ChangeDontMergeView, Const_UI_Lua.UIEnum.UIVirtualController, true) EventSystem.Dispatch(EventID.UI_HomeMain_ChangeDontMergeView, Const_UI_Lua.UIEnum.UIBatteryPanel, true) if UIManager.IsFocus(Const_UI_Lua.UIEnum.UITownHome) then private.PopTownHomeDelayView() end if MDL.CustomRoom.GetFirstSceneInitFlag() then CTL.CustomRoom.TryOpenRoomPanel() end CTL.SyncTeamPVP.ReOpenSelectHeroPanel() CTL. SyncFourCountryWar.ReOpenSelectHeroPanel() CTL.Tips.OpenOrRecover() end function HomeMain_Controller.OpenPreBattleSceneUI() private.OpenDontMergeView() end function HomeMain_Controller.OpenBattleSceneUI() if BattleDataGetter.IsTeamLevel() then private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.TeamBattle)) UIManager.OpenView(Const_UI_Lua.UIEnum.UIBattleLevelPanel) elseif BattleDataGetter.CheckCurLevelType(LuaConst.LevelType.LoginFree) then private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.LoginFree)) UIManager.OpenView(Const_UI_Lua.UIEnum.UIBattleLevelPanel) else private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.Battle)) UIManager.OpenView(Const_UI_Lua.UIEnum.UIBattleLevelPanel) end private.OpenMapInfoView() end function HomeMain_Controller.OpenSoloFightUI() private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.SoloFight)) UIManager.OpenView(Const_UI_Lua.UIEnum.UISoloFightBattle) end function HomeMain_Controller.OpenTeamFightUI() private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.ThreeTeamFight)) --不显示摇杆 EventSystem.Dispatch(EventID.UI_HomeMain_ChangeDontMergeView, Const_UI_Lua.UIEnum.UIVirtualController, false) UIManager.OpenView(Const_UI_Lua.UIEnum.UIThreeTeamFightBattle) end function HomeMain_Controller.OpenSyncTeamPVPUI() private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.SyncTeamPVP)) end function HomeMain_Controller.OpenSyncTeamFairChampionshipUI() MDL.SyncTeamPVP.ClearCacheChannel() if BattleDataGetter.IsInLevelWatchBattle() then private.CallHomeMainViewFunction("UpdateView", teamFairChampionshipWatchBattleView) EventSystem.Dispatch(EventID.UI_BatteryShow, false) EventSystem.Dispatch(EventID.UI_HomeMain_ChangeDontMergeView, Const_UI_Lua.UIEnum.UIVirtualController, false) MDL.WatchBattle.OnEnterWatchWar() CTL.WatchBattle.InitBullet() else private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.SyncTeamPVP)) end end function HomeMain_Controller.OpenWorldBossUI() private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.WorldBoss)) end function HomeMain_Controller.OpenWarZoneWorldBossUI() private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.WarZoneWorldBoss)) end function HomeMain_Controller.OpenDemonGodUI() private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.DemonGod)) end function HomeMain_Controller.OpenGuildBossTownUI() private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.GuildBossTown)) end function HomeMain_Controller.OpenGuildBossUI() private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.GuildBoss)) end function HomeMain_Controller.OpenSyncSoloUI() private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.SyncSolo)) end function HomeMain_Controller.TryProcessWatcher(levelType) if levelType == LuaConst.LevelType.SyncTeamPVPPractice or levelType == LuaConst.LevelType.SyncSoloPractice then if BattleDataGetter.IsInLevelWatchBattle() then EventSystem.Dispatch(EventID.UI_BatteryShow, false) EventSystem.Dispatch(EventID.UI_HomeMain_ChangeDontMergeView, Const_UI_Lua.UIEnum.UIVirtualController, false) CTL.WatchBattle.InitBullet() end end end function HomeMain_Controller.OpenSyncFairSoloTournamentUI() if BattleDataGetter.IsInLevelWatchBattle() then private.CallHomeMainViewFunction("UpdateView", fairSoloTournamentWatchBattleView) EventSystem.Dispatch(EventID.UI_BatteryShow, false) EventSystem.Dispatch(EventID.UI_HomeMain_ChangeDontMergeView, Const_UI_Lua.UIEnum.UIVirtualController, false) --天下会武虽然没有观战奖励,但是有观战任务,不能去掉观战计时器,否则观战任务完成不了 MDL.WatchBattle.OnEnterWatchWar() --只有观战玩家打开弹幕界面 CTL.WatchBattle.InitBullet() else private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.SyncSolo)) end end function HomeMain_Controller.OpenGuildWarWaitingAreaUI() private.CallHomeMainViewFunction("UpdateView", guildWarReadyView) end function HomeMain_Controller.OpenGuildPartyUI() --先显示主界面的UI private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.GuildParty)) --根据条件判断显示对应的UI CTL.GuildParty.OpenGuildPartyActivityUI(); end function HomeMain_Controller.OpenSyncDigTeamPVEUI() private.CallHomeMainViewFunction("UpdateView", syncDigTeamPVEView) UIManager.OpenView(Const_UI_Lua.UIEnum.UIBattleLevelPanel) end function HomeMain_Controller.OpenGuildWarUI() private.CallHomeMainViewFunction("UpdateView", guildWarView) end function HomeMain_Controller.OpenFightThroneTown() private.CallHomeMainViewFunction("UpdateView", fightThroneTownView) if MDL.FightThrone.GetSelectHeroId() == nil then UIManager.OpenView(Const_UI_Lua.UIEnum.UIFightThroneSelectHero) end end function HomeMain_Controller.OpenHeroAwakePlayerUI() private.CallHomeMainViewFunction("UpdateView", heroAwakePlayerView) end function HomeMain_Controller.OpenSceneQuiz() if not UIManager.IsViewOpened(Const_UI_Lua.UIEnum.UIHomeMain) then UIManager.OpenView(Const_UI_Lua.UIEnum.UIHomeMain) if not UIManager.IsViewOpened(Const_UI_Lua.UIEnum.UIBroadcast) then UIManager.OpenView(Const_UI_Lua.UIEnum.UIBroadcast) end if not UIManager.IsViewOpened(Const_UI_Lua.UIEnum.UIBroadcastUp) then UIManager.OpenView(Const_UI_Lua.UIEnum.UIBroadcastUp) end end if not BattleDataGetter.GetIsSceneQuizWatch() then UIManager.OpenView(Const_UI_Lua.UIEnum.UIChannelChatGlobalChatDlg) end -- 断线重连 MDL.SceneQuiz.CurActivityID 可能依然为 0,直接打开界面会导致报错卡死 -- 等待 EventSystem.Dispatch(EventID.UI_DelayToTownPlay) 拿到完整数据后监听打开 UISceneQuizBattleInfo 页面 if MDL.SceneQuiz.CurActivityID ~= 0 then CTL.SceneQuiz.OpenBattleInfoView(MDL.SceneQuiz.CurActivityID) end if BattleDataGetter.GetIsSceneQuizWatch() then --观战不显示摇杆和对话 EventSystem.Dispatch(EventID.UI_HomeMain_ChangeDontMergeView, Const_UI_Lua.UIEnum.UIVirtualController, false) EventSystem.Dispatch(EventID.UI_HomeMain_ChangeDontMergeView, Const_UI_Lua.UIEnum.UIBatteryPanel, false) end end function HomeMain_Controller.OpenFightThroneBattle() private.CallHomeMainViewFunction("UpdateView", fightThroneBattleView) if BattleDataGetter.GetCurLevelType() == LuaConst.LevelType.FightThroneThirdFloor then UIManager.OpenView(Const_UI_Lua.UIEnum.UIFightThroneBattleRank) end end --龙脉报名 function HomeMain_Controller.OpenDragonArteryRegistArea() private.CallHomeMainViewFunction("UpdateView", dragonArteryRegistAreaView) UIManager.OpenView(Const_UI_Lua.UIEnum.UICommonTopTime, { titleIDS = Const_IDS.IDS_DragonArtey_TimeToGo, time = CTL.DragonArtery.GetRegisterAreaLeftTime(), timeFormat = "{0}:{1}", timeCustomType = 5 }) end --龙脉备战 function HomeMain_Controller.OpenDragonArteryWaitingArea() private.CallHomeMainViewFunction("UpdateView", dragonArteryWaitingAreaView) end --龙脉战斗 function HomeMain_Controller.OpenDragonArteryBattle() local view = LevelManager.IsReplayBattle() and dragonArteryBattleView_Replay or dragonArteryBattleView private.CallHomeMainViewFunction("UpdateView", view) end function HomeMain_Controller.OpenDynamicHintUI() CTL.WorldBoss.ShowHelpRemind() MDL.Rival.AutoShowRivalRemind() end function HomeMain_Controller.OpenGuildEscortUI() private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.GuildEscort)) CTL.GuildEscort.ShowCutEscortReward() end function HomeMain_Controller.OpenGuildEscortBattleUI() private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.GuildEscortBattle)) end function HomeMain_Controller.OpenCountryPVPBattleUI() private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.SyncCountryPVP)) end -- 国战晚间boss function HomeMain_Controller.OpenCountryNightBossUI() private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.CountryNightBoss)) UIManager.OpenView(Const_UI_Lua.UIEnum.UICountryNightBossBattleBase) end function HomeMain_Controller.OpenHeroMatch1v1BattleUI() if BattleDataGetter.IsInLevelWatchBattle() then private.CallHomeMainViewFunction("UpdateView", heroMatch1v1WatchBattleView) EventSystem.Dispatch(EventID.UI_BatteryShow, false) EventSystem.Dispatch(EventID.UI_HomeMain_ChangeDontMergeView, Const_UI_Lua.UIEnum.UIVirtualController, false) MDL.WatchBattle.OnEnterWatchWar() else private.CallHomeMainViewFunction("UpdateView", heroMatch1v1PVPView) EventSystem.Dispatch(EventID.UI_HomeMain_ChangeDontMergeView, Const_UI_Lua.UIEnum.UIVirtualController, true) end -- 观战或比赛玩家均打开弹幕界面 CTL.WatchBattle.InitBullet() end function HomeMain_Controller.OpenHeroMatch3v3BattleUI() MDL.SyncTeamPVP.ClearCacheChannel() if BattleDataGetter.IsInLevelWatchBattle() then private.CallHomeMainViewFunction("UpdateView", heroMatch3v3WatchBattleView) EventSystem.Dispatch(EventID.UI_BatteryShow, false) EventSystem.Dispatch(EventID.UI_HomeMain_ChangeDontMergeView, Const_UI_Lua.UIEnum.UIVirtualController, false) MDL.WatchBattle.OnEnterWatchWar() CTL.WatchBattle.InitBullet() else private.CallHomeMainViewFunction("UpdateView", heroMatch3v3PVPView) EventSystem.Dispatch(EventID.UI_HomeMain_ChangeDontMergeView, Const_UI_Lua.UIEnum.UIVirtualController, true) end end function HomeMain_Controller.OpenHeroMatch1v1LobbyUI() private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.HeroMatch1v1Lobby)) EventSystem.Dispatch(EventID.UI_HomeMain_ChangeDontMergeView, Const_UI_Lua.UIEnum.UIVirtualController, true) -- 进入大厅关闭弹幕相关 CTL.WatchBattle.ShutBullet() end function HomeMain_Controller.OpenHeroMatch3v3LobbyUI() --左侧要默认在战团页签 MDL.HomeMain.TownGuideToggle = 1 private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.HeroMatch3v3Lobby)) EventSystem.Dispatch(EventID.UI_HomeMain_ChangeDontMergeView, Const_UI_Lua.UIEnum.UIVirtualController, true) -- 进入大厅关闭弹幕相关 CTL.WatchBattle.ShutBullet() end function HomeMain_Controller.OpenTeamFairChampionshipLobbyUI() --左侧要默认在战团页签 MDL.HomeMain.TownGuideToggle = 1 private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.TeamFairChampionshipLobby)) EventSystem.Dispatch(EventID.UI_HomeMain_ChangeDontMergeView, Const_UI_Lua.UIEnum.UIVirtualController, true) -- 进入大厅关闭弹幕相关 CTL.WatchBattle.ShutBullet() end function HomeMain_Controller.OpenCrossTournamentTownUI() private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.CrossTournamentTown)) EventSystem.Dispatch(EventID.UI_HomeMain_ChangeDontMergeView, Const_UI_Lua.UIEnum.UIVirtualController, true) -- 进入大厅关闭弹幕相关 CTL.WatchBattle.ShutBullet() end function HomeMain_Controller.OpenStormBattleUI() private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.Battle)) UIManager.OpenView(Const_UI_Lua.UIEnum.UIBattleLevelPanel) UIManager.OpenView(Const_UI_Lua.UIEnum.UIStormBattle) private.OpenMapInfoView() end function HomeMain_Controller.OpenRogueLikeBattleUI() private.CallHomeMainViewFunction("UpdateView", private.GetChangeViewByType(HomeMain_Controller.ViewType.RogueLike)) --todo : 经验条界面 --UIManager.OpenView(Const_UI_Lua.UIEnum.UIStormBattle) end function HomeMain_Controller.OpenSyncFourCountryView() private.CallHomeMainViewFunction("UpdateView", SyncFourCountryChaosBattleView) UIManager.OpenView(Const_UI_Lua.UIEnum.UIBattleLevelPanel) end function HomeMain_Controller.OpenUIByLevelType(levelType, levelId) -- 进入某些界面需要恢复聊天(需要优先恢复,防止其他UI逻辑的混乱) if private.enterTownRestoreView ~= nil then for _, v in ipairs(private.switchSceneKeepChatting) do if v == preLevelType then if private.enterTownRestoreView == Const_UI_Lua.UIEnum.UIChannelChatMain then if not UIManager.IsViewOpened(Const_UI_Lua.UIEnum.UIChannelChatMain) then UIManager.OpenView(Const_UI_Lua.UIEnum.UIChannelChatMain, {LastMsgChannelId = nil}) end elseif private.enterTownRestoreView == Const_UI_Lua.UIEnum.UIFriendMain then if MDL.Friend.GetLastPrivateChatAcid() then CTL.Friend.PrivateTalkToAcid(MDL.Friend.GetLastPrivateChatAcid()) end end private.enterTownRestoreView = nil break end end if private.enterTownRestoreView == Const_UI_Lua.UIEnum.UIPlotReview then if not UIManager.IsViewOpened(Const_UI_Lua.UIEnum.UIPlotReview) then CTL.PlotReviewLibrary.OpenMainPanel() end end private.enterTownRestoreView = nil end --满足条件时,展示国战战斗模式 EventSystem.Dispatch(EventID.Country_OpenCountryTargetList) if levelType == LuaConst.LevelType.TOWN or levelType == LuaConst.LevelType.CrossServerTown or levelType == LuaConst.LevelType.SatelliteTown then CTL.HomeMain.OpenMainSceneUI() elseif levelType == LuaConst.LevelType.SoloFight then CTL.HomeMain.OpenSoloFightUI() elseif levelType == LuaConst.LevelType.NineVsNineFight then CTL.HomeMain.OpenTeamFightUI() elseif levelType == LuaConst.LevelType.SyncTeamPVP or levelType == LuaConst.LevelType.SyncTeamPVPPractice then CTL.HomeMain.OpenSyncTeamPVPUI() HomeMain_Controller.TryProcessWatcher(levelType) elseif levelType == LuaConst.LevelType.SyncTeamFairChampionship then HomeMain_Controller.OpenSyncTeamFairChampionshipUI() elseif levelType == LuaConst.LevelType.GuildBossTown then HomeMain_Controller.OpenGuildBossTownUI() elseif levelType == LuaConst.LevelType.SyncGuildBoss then HomeMain_Controller.OpenGuildBossUI() elseif levelType == LuaConst.LevelType.SyncSolo or levelType == LuaConst.LevelType.SyncSoloPractice then HomeMain_Controller.OpenSyncSoloUI() HomeMain_Controller.TryProcessWatcher(levelType) elseif levelType == LuaConst.LevelType.SyncFairSoloTournament then HomeMain_Controller.OpenSyncFairSoloTournamentUI() elseif levelType == LuaConst.LevelType.GuildPartyMap then HomeMain_Controller.OpenGuildPartyUI() elseif BattleDataGetter.IsGuildWarLevel() then HomeMain_Controller.OpenGuildWarUI() elseif BattleDataGetter.IsGuildWarWaitingArea() then HomeMain_Controller.OpenGuildWarWaitingAreaUI() elseif levelType == LuaConst.LevelType.SyncDigTeamPVE then HomeMain_Controller.OpenSyncDigTeamPVEUI() elseif levelType == LuaConst.LevelType.SyncWorldBoss then -- 世界boss HomeMain_Controller.OpenWorldBossUI() elseif levelType == LuaConst.LevelType.SyncWarZoneWorldBoss then -- 战区世界Boss HomeMain_Controller.OpenWarZoneWorldBossUI() elseif levelType == LuaConst.LevelType.ClimbTower then CTL.ClimbTower.ShowClimbTowerBattleUI() elseif levelType == LuaConst.LevelType.NationClimbTower then CTL.NationClimbTower.ShowClimbTowerBattleUI() elseif levelType == LuaConst.LevelType.FightThroneTown or levelType == LuaConst.LevelType.CrossFightThroneTown then -- 大乱斗待战区 HomeMain_Controller.OpenFightThroneTown() elseif BattleDataGetter.IsFightThroneLevel() then -- 大乱斗战斗 HomeMain_Controller.OpenFightThroneBattle() elseif levelType == LuaConst.LevelType.DragonArtery then HomeMain_Controller.OpenDragonArteryBattle() elseif levelType == LuaConst.LevelType.DragonArteryRegistArea then HomeMain_Controller.OpenDragonArteryRegistArea() elseif levelType == LuaConst.LevelType.DragonArteryWaitingArea then HomeMain_Controller.OpenDragonArteryWaitingArea() elseif levelType == LuaConst.LevelType.DemonGod then HomeMain_Controller.OpenDemonGodUI() elseif levelType == LuaConst.LevelType.SceneQuizTown or levelType == LuaConst.LevelType.SingleSceneQuizTown then HomeMain_Controller.OpenSceneQuiz() elseif levelType == LuaConst.LevelType.CrossEscortTown or levelType == LuaConst.LevelType.SingleEscortTown then -- 押镖地图 HomeMain_Controller.OpenGuildEscortUI() private.OpenBackPkRoomView() elseif levelType == LuaConst.LevelType.SyncPlanesEscort then -- 劫镖战斗 HomeMain_Controller.OpenGuildEscortBattleUI() elseif levelType == LuaConst.LevelType.SyncUnfairSolo then HomeMain_Controller.OpenHeroMatch1v1BattleUI() elseif levelType == LuaConst.LevelType.SyncUnfairTeamPVP then HomeMain_Controller.OpenHeroMatch3v3BattleUI() elseif levelType == LuaConst.LevelType.CrossHeroMatchTown then HomeMain_Controller.OpenHeroMatch1v1LobbyUI() elseif levelType == LuaConst.LevelType.CrossHeroMatchTown3V3 then HomeMain_Controller.OpenHeroMatch3v3LobbyUI() elseif levelType == LuaConst.LevelType.SyncCountryPVP then HomeMain_Controller.OpenCountryPVPBattleUI() elseif levelType == LuaConst.LevelType.SyncCountryEveningBoss then HomeMain_Controller.OpenCountryNightBossUI() elseif levelType == LuaConst.LevelType.CrossFairSoloTournamentTown or levelType == LuaConst.LevelType.SingleFairSoloTournamentTown then HomeMain_Controller.OpenCrossTournamentTownUI() elseif levelType == LuaConst.LevelType.TeamFairChampionshipTown then HomeMain_Controller.OpenTeamFairChampionshipLobbyUI() elseif levelType == LuaConst.LevelType.StormChallenge then HomeMain_Controller.OpenStormBattleUI() elseif levelType == LuaConst.LevelType.RogueLike then HomeMain_Controller.OpenRogueLikeBattleUI() elseif levelType == LuaConst.LevelType.NONE or levelType == LuaConst.LevelType.SpecialLevelType then elseif levelType == LuaConst.LevelType.AttackCity or levelType == LuaConst.LevelType.LootMine then private.CallHomeMainViewFunction("UpdateView", {Const_UI_Lua.UIEnum.UIGVGFightInBattleInfo}) elseif levelType == LuaConst.LevelType.SyncFourCountryChaos then HomeMain_Controller.OpenSyncFourCountryView() elseif levelType == LuaConst.LevelType.SyncCityWarMainFirstStage or levelType == LuaConst.LevelType.SyncCityWarMainSecondStage or levelType == LuaConst.LevelType.SyncCityWarSide then private.CallHomeMainViewFunction("UpdateView", changAnSiegeBattleView) UIManager.OpenView(Const_UI_Lua.UIEnum.UIBattleLevelPanel) elseif levelType == LuaConst.LevelType.SyncCityWarMainWaitingArea or levelType == LuaConst.LevelType.SyncCityWarSideWaitingArea then private.CallHomeMainViewFunction("UpdateView", changAnSiegeWaitView) UIManager.OpenView(Const_UI_Lua.UIEnum.UIBattleLevelPanel) elseif levelType == LuaConst.LevelType.ExpelMonster then private.CallHomeMainViewFunction("UpdateView", expelMonsterView) elseif levelType == LuaConst.LevelType.SlgGvE then CTL.SlgGvE.ShowBattleUI() elseif levelType == LuaConst.LevelType.HeroAwakePlayer then HomeMain_Controller.OpenHeroAwakePlayerUI() elseif levelType == LuaConst.LevelType.HeroAwakeBoss then private.CallHomeMainViewFunction("UpdateView", heroAwakeBossView) else CTL.HomeMain.OpenBattleSceneUI() end HomeMain_Controller.OpenDynamicHintUI() preLevelType = levelType preIsReplayBattle = LevelManager.IsReplayBattle() preLevelId = levelId wasLeader = CTL.Team.IsSelfLeader() end function HomeMain_Controller.CloseOpenView() UIManager.CloseViewByLayer(Const_UI_Lua.UILayers.UIDefault) UIManager.CloseViewByLayer(Const_UI_Lua.UILayers.UIPopup) --需要检测是否需要打开国战战斗列表界面 EventSystem.Dispatch(EventID.Country_OpenCountryTargetList) end function HomeMain_Controller.CloseBasicView() -- 关闭界面之前先关闭一下聊天界面(聊天界面有特殊逻辑) EventSystem.Dispatch(EventID.UI_ChannelChat_OnCloseWindow) UIManager.CloseViewByLayer(Const_UI_Lua.UILayers.UIBackground) UIManager.CloseViewByLayer(Const_UI_Lua.UILayers.UIDefault) UIManager.CloseViewByLayer(Const_UI_Lua.UILayers.UIPopup) end -- 关闭push的界面 function HomeMain_Controller.ClosePushedView(viewClassPath) EventSystem.Dispatch(EventID.UI_CloseAndRecoverView, viewClassPath) end -- 关闭界面(返回主城) function HomeMain_Controller.CloseViewBackHomeMain() UIManager.RecoverTopView() HomeMain_Controller.CloseOpenView() end function private.TimeLineActive(value, allOpen) EventSystem.Dispatch(EventID.HomeMain_TimeLineActive, value, allOpen) if MDL.Cheat.IsPCCheatModel() then return end if allOpen then UIManager.SetAllLayerActive(value) else UIManager.SetLayerActive(Const_UI_Lua.UILayers.UIBackground, value) UIManager.SetLayerActive(Const_UI_Lua.UILayers.UIDefault, value) UIManager.SetLayerActive(Const_UI_Lua.UILayers.UIPopup, value) UIManager.SetLayerActive(Const_UI_Lua.UILayers.UIForeground, value) end AuxUtil.SetActiveLayerCameraLockUI(value) EventSystem.Dispatch(EventID.TimeLine_Update,value) end function private.CallHomeMainViewFunction(funcName, ...) if not UIManager.IsViewOpened(Const_UI_Lua.UIEnum.UIHomeMain) then UIManager.OpenView(Const_UI_Lua.UIEnum.UIHomeMain) if not UIManager.IsViewOpened(Const_UI_Lua.UIEnum.UIBroadcast) then UIManager.OpenView(Const_UI_Lua.UIEnum.UIBroadcast) end if not UIManager.IsViewOpened(Const_UI_Lua.UIEnum.UIBroadcastUp) then UIManager.OpenView(Const_UI_Lua.UIEnum.UIBroadcastUp) end end UIManager.CallViewFunction(Const_UI_Lua.UIEnum.UIHomeMain, funcName, ...) end function private.GetChangeViewByType(viewType) if viewType == HomeMain_Controller.ViewType.MainCity then return mainCityView elseif viewType == HomeMain_Controller.ViewType.Battle then if LevelManager.IsReplayBattle() then return battleView_Replay end return battleView elseif viewType == HomeMain_Controller.ViewType.LoginFree then return loginFreeView elseif viewType == HomeMain_Controller.ViewType.SoloFight then return soloFightView elseif viewType == HomeMain_Controller.ViewType.ThreeTeamFight then return threeTeamFightView elseif viewType == HomeMain_Controller.ViewType.SyncTeamPVP then if LevelManager.IsReplayBattle() then return SyncTeamPVPView_Replay elseif BattleDataGetter.IsInLevelWatchBattle() then return teamFairChampionshipWatchBattleView end return SyncTeamPVPView elseif viewType == HomeMain_Controller.ViewType.TeamBattle then return teamBattleView elseif viewType == HomeMain_Controller.ViewType.GuildBossTown then return guildBossTownView elseif viewType == HomeMain_Controller.ViewType.GuildBoss then return guildBossView elseif viewType == HomeMain_Controller.ViewType.SyncSolo then if LevelManager.IsReplayBattle() then return syncSoloBattleView_Replay elseif BattleDataGetter.IsInLevelWatchBattle() then return fairSoloTournamentWatchBattleView end return syncSoloBattleView elseif viewType == HomeMain_Controller.ViewType.GuildParty then return guildPartyView elseif viewType == HomeMain_Controller.ViewType.WorldBoss then return worldBossView elseif viewType == HomeMain_Controller.ViewType.WarZoneWorldBoss then return WarZoneWorldBossView elseif viewType == HomeMain_Controller.ViewType.DemonGod then return demonGodView elseif viewType == HomeMain_Controller.ViewType.GuildEscort then return guildEscortView elseif viewType == HomeMain_Controller.ViewType.GuildEscortBattle then return guildEscortPVPView elseif viewType == HomeMain_Controller.ViewType.HeroMatch1v1Lobby then return heroMatch1v1LobbyView elseif viewType == HomeMain_Controller.ViewType.HeroMatch3v3Lobby then return heroMatch3v3LobbyView elseif viewType == HomeMain_Controller.ViewType.TeamFairChampionshipLobby then return teamFairChampionshipLobbyView elseif viewType == HomeMain_Controller.ViewType.SyncCountryPVP then return countryPVPView elseif viewType == HomeMain_Controller.ViewType.CountryNightBoss then return countryNightBossView elseif viewType == HomeMain_Controller.ViewType.CrossTournamentTown then return crossTournamentTownView elseif viewType == HomeMain_Controller.ViewType.RogueLike then return rogueLikeBattleView elseif viewType == HomeMain_Controller.ViewType.HeroAwakePlayer then return heroAwakePlayerView elseif viewType == HomeMain_Controller.ViewType.HeroAwakeBoss then return heroAwakeBossView end end function private.ShowDialogue(dialogueID, callback, context, entity) if string.isNilOrEmpty(dialogueID) then if callback then callback() end return end local type = MDL.Dialogue.GetDialogueTypeByID(dialogueID) local name = CTL.Dialogue.GetDialogueUIName(type) if not name then if callback then logging.error(LTAG.ERROR, "【策划注意】播放对话错误 ,没有找到对话界面。dialogueID = ", dialogueID); callback() end return end if not UIManager.IsViewOpened(name) then if type == MDL.Dialogue.DialogueType.Normal then UIManager.OpenAndPushAll(name, {dialogueID = dialogueID, callback = callback, context = context, entity = entity}) else UIManager.OpenView(name, {dialogueID = dialogueID, callback = callback, context = context, entity = entity}) end else UIManager.CallViewFunction(name, "Start", dialogueID, callback, context, entity) end end function private.ShowBlueDialogue(str, duration) UIManager.CloseView(Const_UI_Lua.UIEnum.UIDialogueTopBlueView) UIManager.OpenView(Const_UI_Lua.UIEnum.UIDialogueTopBlueView,{str = str, duration = duration}) end function private.ShowDragonArteryDialogue(str, duration) UIManager.CloseView(Const_UI_Lua.UIEnum.UIDragonArteryBottomReportView) UIManager.OpenView(Const_UI_Lua.UIEnum.UIDragonArteryBottomReportView, { str = str, duration = duration }) end function private.ShowYellowDialogue(str, duration) UIManager.CloseView(Const_UI_Lua.UIEnum.UIDialogueTopYellowView) UIManager.OpenView(Const_UI_Lua.UIEnum.UIDialogueTopYellowView,{str = str, duration = duration}) end --自定义对话框 function private.ShowLightDialogue(title,str,icon,duration) UIManager.CloseView(Const_UI_Lua.UIEnum.UIDialogueLightView) UIManager.OpenView(Const_UI_Lua.UIEnum.UIDialogueLightView,{title=title,str = str,icon=icon,duration=duration}) end function private.ShowBattleReport(str) UIManager.CloseView(Const_UI_Lua.UIEnum.UIDialogueTopReportView) UIManager.OpenView(Const_UI_Lua.UIEnum.UIDialogueTopReportView,{str = str}) end function HomeMain_Controller.ShowTaskChoose(taskChildData,callback, entity) if taskChildData.ActionType == MDL.Task.Enum_ActionType.Consistent then local taskFatherData = DataSheetManager.TaskFatherData:GetDataByID(taskChildData.TaskLineID) if taskFatherData.Type == "GoldHeroActivity" then UIManager.OpenSpecialView(Const_UI_Lua.UIEnum.UIGoldenHeroStoryOption, {taskChildData=taskChildData, callback=callback, entity=entity}) elseif taskFatherData.Type == "SuperGoldHero" then UIManager.OpenSpecialView(Const_UI_Lua.UIEnum.UISuperGoldStoryOption, {taskChildData=taskChildData, callback=callback}) end else if not UIManager.IsViewOpened(Const_UI_Lua.UIEnum.UIDialogueNormalView) then UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UIDialogueNormalView, {taskChildData=taskChildData, callback=callback, entity=entity}) else EventSystem.Dispatch(EventID.Task_StartTask, taskChildData, callback, entity) end end end function private.OpenDontMergeView() for i,v in ipairs(dontMergeView) do UIManager.OpenSpecialView(v) end end function private.OpenMapInfoView() local levelInfoData = BattleDataGetter.GetLevelInfoData() if levelInfoData.LevelNameIDS ~= "" then UIManager.OpenView(Const_UI_Lua.UIEnum.UIMapInfoView) end end --关闭显示的复活界面 function private.CloseAllRevive() for _,v in ipairs(reviveView) do UIManager.CloseView(v) end end --输入礼包码 function HomeMain_Controller.OpenGiftCode() UTL.MessageBox.ShowInputOkBox(Const_IDS.IDS_ConvertGift_Title, function(code) MDL.HomeMain.ClaimGiftCodeReq(code) end, Const_IDS.IDS_ConvertGift_ConfirmButton, Const_IDS.IDS_ConvertGift_EnterButton) end --LuaFuncEntry重构后,这个还不能删除,因为小于1.13的包还需要使用 function HomeMain_Controller.DispatchEvent(eventID, ...) EventSystem.Dispatch(eventID,...) end function private.OpenBackView() if CTL.Activities.IsLimitActivityTransferID() then CTL.Activities.GoActivity(CTL.Activities.limitActivityTransferID) CTL.Activities.limitActivityTransferID = nil return end if preLevelType == LuaConst.LevelType.SoloFight then UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UISoloFightPanel) elseif preLevelType == LuaConst.LevelType.NineVsNineFight then if CTL.ThreeTeamFight.OpenMain() then CTL.ThreeTeamFight.TryEnterChallenge(false) end elseif preLevelType == LuaConst.LevelType.Biography then UIManager.OpenView(Const_UI_Lua.UIEnum.UIHeroBiographySubPanel, {biographyId = CTL.Biography.GetTempBiographyId()}) elseif preLevelType == LuaConst.LevelType.Resource then if MDL.MaterialLevel.CurLevelId then UIManager.OpenAndPush(Const_UI_Lua.UIEnum.UIActivitiesMain, nil, nil, Const_UI_Lua.UIEnum.UIHomeMain) UIManager.OpenAndPush(Const_UI_Lua.UIEnum.UIMaterialLevelMainPanel, nil, nil, Const_UI_Lua.UIEnum.UIActivitiesMain) UIManager.OpenAndPush(Const_UI_Lua.UIEnum.UIMaterialLevel, {id = MDL.MaterialLevel.CurLevelId}, nil, Const_UI_Lua.UIEnum.UIMaterialLevelMainPanel) end elseif preLevelType == LuaConst.LevelType.NORMAL then if CTL.LevelSelect.GetRecoverBool() then UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UILevelSelectPanel) end elseif preLevelType == LuaConst.LevelType.PersonalBoss then CTL.PersonalBoss.OpenPersonalBossPanelByArea() elseif preLevelType == LuaConst.LevelType.SyncWorldBoss then -- 世界boss if MDL.WorldBoss.GetIsEnterMain() then if CTL.WarZone.IsWarZoneOpen() then UIManager.OpenView(Const_UI_Lua.UIEnum.UIBossMainPanel) end UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UIWorldBossMainPanel) end elseif preLevelType == LuaConst.LevelType.SyncWarZoneWorldBoss then -- 战区世界Boss if MDL.CountryWorldBoss.GetIsEnterMain() then UIManager.OpenView(Const_UI_Lua.UIEnum.UIBossMainPanel) UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UICountryWorldBossMain) end elseif preLevelType == LuaConst.LevelType.SyncTeamPVP then if preIsReplayBattle then if CTL.Replay.IsReplayFromMyRecords() then UIManager.OpenAndPush(Const_UI_Lua.UIEnum.UIFairPlayMainPanel, nil, nil, Const_UI_Lua.UIEnum.UIHomeMain) UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UIFairPlayHistoryMain, {selectType = MDL.Replay.FairPlayType.TVT}, nil, Const_UI_Lua.UIEnum.UIFairPlayMainPanel) else UIManager.OpenAndPush(Const_UI_Lua.UIEnum.UIFairPlayMainPanel, nil, nil, Const_UI_Lua.UIEnum.UIHomeMain) UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UIReplayMain, nil, nil, Const_UI_Lua.UIEnum.UIFairPlayMainPanel) end else --队长不变,且自己是队长的情况下 local isLeader = CTL.Team.IsSelfLeader() if not CTL.Team.IsInTeam() or (isLeader and wasLeader == isLeader) then UIManager.OpenAndPush(Const_UI_Lua.UIEnum.UIActivitiesMain, nil, nil, Const_UI_Lua.UIEnum.UIHomeMain) UIManager.OpenAndPush(Const_UI_Lua.UIEnum.UIFairPlayMainPanel, nil, nil, Const_UI_Lua.UIEnum.UIActivitiesMain) UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UISyncTeamPVPMainPanel, nil, nil, Const_UI_Lua.UIEnum.UIFairPlayMainPanel) end end elseif preLevelType == LuaConst.LevelType.SyncTeamPVE then --队长不变,且自己是队长的情况下 local isLeader = CTL.Team.IsSelfLeader() if not CTL.Team.IsInTeam() or (isLeader and wasLeader == isLeader) then CTL.TeamDungeon.OpenMainPanelByLevelID(preLevelId) end elseif preLevelType == LuaConst.LevelType.ClimbTower then CTL.ClimbTower.OpenClimbTowerMainView() elseif preLevelType == LuaConst.LevelType.NationClimbTower then CTL.NationClimbTower.OpenNationClimbTowerMainView() elseif preLevelType == LuaConst.LevelType.BossChallenge then if preIsReplayBattle then UIManager.OpenAndPush(Const_UI_Lua.UIEnum.UIFairPlayMainPanel, nil, nil, Const_UI_Lua.UIEnum.UIHomeMain) UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UIFairPlayHistoryMain, nil, nil, Const_UI_Lua.UIEnum.UIFairPlayMainPanel) --todo:林建 :需要选中 无双挑战 的页签。 else UIManager.OpenAndPush(Const_UI_Lua.UIEnum.UIActivitiesMain, nil, nil, Const_UI_Lua.UIEnum.UIHomeMain) UIManager.OpenAndPush(Const_UI_Lua.UIEnum.UIFairPlayMainPanel, nil, nil, Const_UI_Lua.UIEnum.UIActivitiesMain) UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UIBossChallengeMain, nil, nil, Const_UI_Lua.UIEnum.UIFairPlayMainPanel) end elseif preLevelType == LuaConst.LevelType.SyncTeamDifficultLevel then --队长不变,且自己是队长的情况下 local isLeader = CTL.Team.IsSelfLeader() if isLeader and wasLeader == isLeader then CTL.MultiplayerDungeon.OpenMainPanelByLevelID(preLevelId) end elseif preLevelType == LuaConst.LevelType.SyncSolo then if preIsReplayBattle then if CTL.Replay.IsReplayFromMyRecords() then UIManager.OpenAndPush(Const_UI_Lua.UIEnum.UIFairPlayMainPanel, nil, nil, Const_UI_Lua.UIEnum.UIHomeMain) UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UIFairPlayHistoryMain, nil, nil, Const_UI_Lua.UIEnum.UIFairPlayMainPanel) --todo:林建 :需要选中 谁与争锋 的页签。 else UIManager.OpenAndPush(Const_UI_Lua.UIEnum.UIFairPlayMainPanel, nil, nil, Const_UI_Lua.UIEnum.UIHomeMain) UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UIReplayMain, nil, nil, Const_UI_Lua.UIEnum.UIFairPlayMainPanel) end else UIManager.OpenAndPush(Const_UI_Lua.UIEnum.UIActivitiesMain, nil, nil, Const_UI_Lua.UIEnum.UIHomeMain) UIManager.OpenAndPush(Const_UI_Lua.UIEnum.UIFairPlayMainPanel, nil, nil, Const_UI_Lua.UIEnum.UIActivitiesMain) UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UISyncSoloMainPanel, nil, nil, Const_UI_Lua.UIEnum.UIFairPlayMainPanel) end elseif preLevelType == LuaConst.LevelType.Nobility then -- 进爵副本结束后打开进爵界面 CTL.Nobility.OpenMainView() elseif preLevelType == LuaConst.LevelType.GoldHeroCooperate then -- 金将体验关——协同讨伐 local activityId, bossId, tabIndex = CTL.GoldenHeroBoss.LoadTempData() CTL.GoldenHeroBoss.ClearTempData() CTL.GoldenHeroMain.OpenMainView(activityId) CTL.GoldenHeroBoss.LocateShareBoss(activityId, bossId, tabIndex) elseif preLevelType == LuaConst.LevelType.GoldHeroExperience then -- 金将体验关——秘闻关卡 local activityId, levelId, levelIsFirst = MDL.GoldenHeroStory.LoadTempData() MDL.GoldenHeroStory.ClearTempData() CTL.GoldenHeroMain.OpenMainView(activityId) CTL.GoldenHeroStory.OpenStoryAndLevelView(activityId, levelId, levelIsFirst) elseif preLevelType == LuaConst.LevelType.GoldHeroClimbTower then -- 金将体验关——轶事关卡 local activityId = MDL.GoldenHeroAnecdote.LoadTempData() MDL.GoldenHeroAnecdote.ClearTempData() CTL.GoldenHeroMain.OpenMainView(activityId) CTL.GoldenHeroAnecdote.OpenAnecdoteView(activityId) elseif preLevelType == LuaConst.LevelType.GoldHeroShow then -- 金将体验关——试用关 local activityId = MDL.GoldenHeroMain.LoadTempData() MDL.GoldenHeroMain.ClearTempData() CTL.GoldenHeroMain.OpenMainView(activityId) elseif preLevelType == LuaConst.LevelType.GoldHeroTrail then -- 彩金——boss试炼 local activityId, difficultId, bossLevelId = CTL.SuperGoldBoss.LoadTempData() CTL.SuperGoldBoss.ClearTempData() CTL.SuperGoldMain.OpenMainView(activityId) CTL.SuperGoldBoss.LocateDifficultLevel(activityId, difficultId) elseif preLevelType == LuaConst.LevelType.SyncGuildBossWait or preLevelType == LuaConst.LevelType.SyncGuildBoss or preLevelType == LuaConst.LevelType.GuildBossTown then -- 势力boss if CTL.GuildBoss.GetIsShowAuction() then CTL.GuildAuction.TryOpenGuildAuctionPanel(MDL.GuildAuction.AllAuctionType.GuildBoss) end elseif preLevelType == LuaConst.LevelType.SyncGuildWarMapLeft or preLevelType == LuaConst.LevelType.SyncGuildWarMapMiddle or preLevelType == LuaConst.LevelType.SyncGuildWarMapRight or preLevelType == LuaConst.LevelType.SyncGuildWarMapResources or preLevelType == LuaConst.LevelType.GuildWarWaitingArea then -- 军团势力战 if CTL.GuildWar.IsDuringFirstFight() then local info = MDL.GuildWar.GetWarInfo() info.isLeave = true end CTL.GuildAuction.TryOpenGuildAuctionPanel(MDL.GuildAuction.AllAuctionType.GuildWar) elseif preLevelType == LuaConst.LevelType.DemonGod then UIManager.OpenAndPush(Const_UI_Lua.UIEnum.UIActivitiesMain, nil, nil, Const_UI_Lua.UIEnum.UIHomeMain) CTL.DemonGod.OpenDemonGodView() elseif preLevelType == LuaConst.LevelType.SyncPlanesEscort or preLevelType == LuaConst.LevelType.CrossEscortTown or preLevelType == LuaConst.LevelType.SingleEscortTown then CTL.GuildAuction.TryOpenGuildAuctionPanel(MDL.GuildAuction.AllAuctionType.Escort) elseif preLevelType == LuaConst.LevelType.FightThroneThirdFloor then CTL.GuildAuction.TryOpenGuildAuctionPanel(MDL.GuildAuction.AllAuctionType.FightThrone) elseif preLevelType == LuaConst.LevelType.SyncUnfairSolo or preLevelType == LuaConst.LevelType.SyncFairSoloTournament or preLevelType == LuaConst.LevelType.SyncUnfairTeamPVP or preLevelType == LuaConst.LevelType.SyncTeamFairChampionship then MDL.WatchBattle.OnQuitWatchWar() CTL.WatchBattle.ShutBullet() elseif preLevelType == LuaConst.LevelType.CrossHeroMatchTown or preLevelType == LuaConst.LevelType.CrossHeroMatchTown3V3 or preLevelType == LuaConst.LevelType.CrossFairSoloTournamentTown or preLevelType == LuaConst.LevelType.SingleFairSoloTournamentTown or preLevelType == LuaConst.LevelType.TeamFairChampionshipTown then CTL.WatchBattle.ShutBullet() elseif preLevelType == LuaConst.LevelType.SyncSoloPractice or preLevelType == LuaConst.LevelType.SyncTeamPVPPractice then if preIsReplayBattle then if CTL.Replay.IsReplayFromMyRecords() then UIManager.OpenAndPush(Const_UI_Lua.UIEnum.UIFairPlayMainPanel, nil, nil, Const_UI_Lua.UIEnum.UIHomeMain) UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UIFairPlayHistoryMain, nil, nil, Const_UI_Lua.UIEnum.UIFairPlayMainPanel) end else CTL.WatchBattle.ShutBullet() CTL.CustomRoom.TryOpenRoomPanel(true) end elseif preLevelType == LuaConst.LevelType.SyncCountryEveningBoss then UIManager.OpenView(Const_UI_Lua.UIEnum.UICountryNightBossMain) elseif preLevelType == LuaConst.LevelType.CrossFairSoloTournamentTown or preLevelType == LuaConst.LevelType.SingleFairSoloTournamentTown then CTL.WatchBattle.ShutBullet() elseif preLevelType == LuaConst.LevelType.StormChallenge then if MDL.Storm.IsOpen() then UIManager.OpenView(Const_UI_Lua.UIEnum.UIStormEntrance) UIManager.OpenView(Const_UI_Lua.UIEnum.UIStormMain) end elseif preLevelType == LuaConst.LevelType.LootMine then CTL.GuildMine.OpenGuildMineView() elseif preLevelType == LuaConst.LevelType.SyncCityWarMainFirstStage or preLevelType == LuaConst.LevelType.SyncCityWarMainSecondStage or preLevelType == LuaConst.LevelType.SyncCityWarSide or preLevelType == LuaConst.LevelType.SyncCityWarMainWaitingArea or preLevelType == LuaConst.LevelType.SyncCityWarSideWaitingArea then CTL.ChangAnSiege.OpenMainView() elseif preLevelType == LuaConst.LevelType.ExpelMonster then CTL.ExpelMonster.OpenExpelMonsterMainView() elseif preLevelType == LuaConst.LevelType.SlgGvE then CTL.SlgGvE.OpenSlgGvEMain(nil, CTL.SlgGvE.GetLastBattleGridIndex()) elseif preLevelType == LuaConst.LevelType.RogueLike then CTL.SubjectMonth.OpenMainView() CTL.Rogue.OpenRogueMainView() elseif preLevelType == LuaConst.LevelType.SubjectMonthBossChallenge then CTL.SubjectMonth.OpenMainView() CTL.MonthBossChallenge.OpenChallengeView() end end function private.OpenBackPkRoomView() if preLevelType == LuaConst.LevelType.SyncSoloPractice or preLevelType == LuaConst.LevelType.SyncTeamPVPPractice then if preIsReplayBattle then if CTL.Replay.IsReplayFromMyRecords() then UIManager.OpenAndPush(Const_UI_Lua.UIEnum.UIFairPlayMainPanel, nil, nil, Const_UI_Lua.UIEnum.UIHomeMain) UIManager.OpenAndPushAll(Const_UI_Lua.UIEnum.UIFairPlayHistoryMain, nil, nil, Const_UI_Lua.UIEnum.UIFairPlayMainPanel) end else CTL.CustomRoom.TryOpenRoomPanel(true) end end end --主界面提示Icon function HomeMain_Controller.GetFirstNotices() return firstNotices end function HomeMain_Controller.GetSecondNotices() return secondNotices end function HomeMain_Controller.AddMainNotice(noticeType) local info = DataSheetManager.InfoReminder:GetDataByID(noticeType) if info then if info.ShowType == 1 then if not table.containValue(firstNotices, noticeType) then table.insert(firstNotices, noticeType) table.sort(firstNotices, private.SortReminder) EventSystem.Dispatch(EventID.UI_HomeMain_RefreshNotice, true) end else if not table.containValue(secondNotices, noticeType) then table.insert(secondNotices, noticeType) table.sort(secondNotices, private.SortReminder) EventSystem.Dispatch(EventID.UI_HomeMain_RefreshNotice, false) end end end end function HomeMain_Controller.RemoveMainNotice(noticeType) local info = DataSheetManager.InfoReminder:GetDataByID(noticeType) if info.ShowType == 1 then table.removebyvalue(firstNotices, noticeType) EventSystem.Dispatch(EventID.UI_HomeMain_RefreshNotice, true) else table.removebyvalue(secondNotices, noticeType) EventSystem.Dispatch(EventID.UI_HomeMain_RefreshNotice, false) end end function HomeMain_Controller.GetFocusTarget() return private.focusTarget end function HomeMain_Controller.SetFocusTarget(target) private.focusTarget = target end function HomeMain_Controller.SetEnterTownRestoreView(viewType) private.enterTownRestoreView = viewType end function HomeMain_Controller.AddTownHomeDelayView(viewName, viewContext) private.AddToDelayList({name = viewName, context = viewContext}) end function HomeMain_Controller.AddTownHomeDelayFunc(viewFunc, ...) private.AddToDelayList({func = viewFunc, params = {...}}) end --添加非UI的事件 --由于非UI的事件没有焦点切换,会导致下一个Delay无法执行,这里对非UI事件做个标记 --从队列出来的是非UI的事件,需要继续执行ExecuteDelayViewData function HomeMain_Controller.AddTownHomeDelayFuncNoUI(viewFunc, ...) private.AddToDelayList({ func = viewFunc, isUI = false, params = { ... } }) end function private.AddToDelayList(data) table.insert(private.delayTownHomeViewList, data) if private.focusTarget == Const_UI_Lua.UIEnum.UITownHome then private.PopTownHomeDelayView() end end -- 等待主城延迟显示的界面队列是否为空 function HomeMain_Controller.DelayListIsEmpty() return #private.delayTownHomeViewList == 0 end function HomeMain_Controller.ClearTownHomeDelayView() private.delayTownHomeViewList = {} end function private.PopTownHomeDelayView() TimerUtil.TimeOut(private.ExecuteDelayViewData) end function private.ExecuteDelayViewData() if private.focusTarget ~= Const_UI_Lua.UIEnum.UITownHome then return end local data = table.remove(private.delayTownHomeViewList, 1) if data then if data.name then UIManager.OpenView(data.name, data.context) elseif data.func then data.func(table.unpack(data.params)) end if data.isUI == false then if private.focusTarget == Const_UI_Lua.UIEnum.UITownHome then private.PopTownHomeDelayView() end end else -- 延迟界面执行完毕 执行打脸图流程 CTL.PushInterface.TriggerExcutePushInterface() end end function private.SortReminder(a, b) local aInfo = DataSheetManager.InfoReminder:GetDataByID(a) local bInfo = DataSheetManager.InfoReminder:GetDataByID(b) return aInfo.SortId < bInfo.SortId end --离开场景的时候需要清理系统相关 function HomeMain_Controller.ClearByLevelType() if preLevelType == LuaConst.LevelType.GuildPartyMap then CTL.GuildParty.ExitGuildPartyScene() elseif preLevelType == LuaConst.LevelType.SyncUnfairTeamPVP or preLevelType == LuaConst.LevelType.SyncTeamFairChampionship then MDL.SyncTeamPVP.ClearCacheChannel() end end function HomeMain_Controller.CheckLevelTypeIsTown(levelType) return levelType == LuaConst.LevelType.TOWN or levelType == LuaConst.LevelType.CrossServerTown or levelType == LuaConst.LevelType.CrossEscortTown or levelType == LuaConst.LevelType.SingleEscortTown end -- 战斗开始通用倒计时 function private.OpenCountDownPanel() local viewName = Const_UI_Lua.UIEnum.UIBattleCountDownFormalPanel if not UIManager.IsViewOpened(viewName) then UIManager.OpenView(viewName) end end return HomeMain_Controller