local UIHeroMatch3v3LobbyInfo = UIViewClass() function UIHeroMatch3v3LobbyInfo:OnOpened(context) self:RegistSystemEvent(EventID.UI_HeroMatch3v3_RefreshInfo, self.RefreshBattleInfo) self:RegistSystemEvent(EventID.UI_TownHome_BtnState_Changed, self.UpdatePanelFoldState) self:UpdatePanelFoldState(MDL.HomeMain.TownFoldType.RightBottom, not MDL.HomeMain.GetTownHomeUIFoldStateByType(MDL.HomeMain.TownFoldType.RightBottom)) if MDL.HeroMatch3v3.GetMatchStageInfo(MDL.HeroMatch3v3.GetCurStageID()) then self:RefreshBattleInfo() else -- 活动未开启处于匹配大厅场景回到洛阳5 CTL.HeroMatch3v3.CheckQuitMatchLobby() if MDL.HeroMatch3v3.CheckIsBattleStage() then MDL.HeroMatch3v3.HeroMatchOpenRequest() end end end function UIHeroMatch3v3LobbyInfo:OnButtonClicked(comp) if comp == self.btn_Info then UIManager.OpenView(Const_UI_Lua.UIEnum.UICommonNoteView, { id = LuaConst.NoteID.HeroMatch3v3 }) elseif comp == self.btn_CurrentState then CTL.HeroMatch3v3.OpenHeroMatch3v3MainView() elseif comp == self.btn_TalkPick then UIManager.OpenView(Const_UI_Lua.UIEnum.UIHeroMatch3v3Guessing, nil, "HeroMatch1v1/UIHeroMatch1v1Guessing") elseif comp == self.btn_Close then self.state:SetState(1) elseif comp == self.btn_Open then self.state:SetState(0) end end function UIHeroMatch3v3LobbyInfo:RefreshBattleInfo() local stageInfo = MDL.HeroMatch3v3.GetMatchStageInfo(MDL.HeroMatch3v3.GetCurStageID()) local startTimestamp = stageInfo.stateEndTime local leftTime = startTimestamp - UTL.Time.GetServerTimestamp() > 0 and startTimestamp - UTL.Time.GetServerTimestamp() or 0 if stageInfo.state == MDL.HeroMatch3v3.Enum_State.Battle then UIUtils.SetLabelText(self.lab_MatchCountDown, Const_IDS["IDS_HeroMatch3v3_SkipBattleTime"]) else UIUtils.SetLabelText(self.lab_MatchCountDown, Const_IDS["IDS_HeroMatch3v3_MatchingTime"]) end self.txt_MatchCountDown:ResetAndBeginTimer(false, leftTime) local progressTxt, roundTxt, curFightRound = CTL.HeroMatch3v3.GetCurStageDesc() if stageInfo.stageId <= MDL.HeroMatch3v3.Stage.Filtration_2 then UIUtils.SetLabelText(self.txt_NextRace, Const_IDS["IDS_HeroMatch3v3_SurplusNum"]) else UIUtils.SetLabelText(self.txt_NextRace, Const_IDS["IDS_HeroMatch3v3_NextRace"]) end UIUtils.SetLabel(self.txt_Progress, progressTxt) UIUtils.SetLabel(self.txt_LeftCount, roundTxt) end function UIHeroMatch3v3LobbyInfo:UpdatePanelFoldState(foldType, isFold) if foldType == MDL.HomeMain.TownFoldType.RightBottom then if self.state.CurState == 0 then UIUtils.SetActive(self.info_Panel.gameObject, isFold) else UIUtils.SetActive(self.btn_Open, isFold) end end end return UIHeroMatch3v3LobbyInfo