local UIGuildEscortStart = UIViewClass() -- [[ -- 势力押镖-押镖开启确认 -- ]] -------------------- function UIGuildEscortStart:OnOpened(context) self:RegistSystemEvent(EventID.TeamMemberChanged, self.RefreshTeamInfo) self:InitPanel() self:RefreshTeamInfo() end function UIGuildEscortStart:OnBackButtonPressed() self:OnButtonClicked(self.btn_Cancel) end function UIGuildEscortStart:OnButtonClicked(comp) if comp == self.UICommonPopUp.btn_Close then self:CloseView() elseif comp == self.btn_Cancel then self:CloseView() elseif comp == self.btn_Start then MDL.GuildEscort.EscortPrepareInfoRequest() self:CloseView() end end -------------------- function UIGuildEscortStart:InitPanel() -- 设置标题 UIUtils.SetLabelText(self.UICommonPopUp.txt_Title, Const_IDS.IDS_Escort_Start) -- 设置镖车品质 local curLevelEscort = MDL.GuildEscort.GetCurLevelEscort() local escortData = DataSheetManager.GuildEscortData:GetDataByID(curLevelEscort) if escortData then local colorStr = UTL.Color.FormatTextByColor(escortData.NameColor, UIUtils.GetLocalizedTxt(Const_IDS[escortData.NameDes])) UIUtils.SetLabel(self.txt_StartEscort, string.FormatByIdsId(Const_IDS.IDS_Escort_ConfirmStart, colorStr)) else logging.error(LTAG.ERROR, "没有找到品质为:", curLevelEscort, " 的镖车数据,请检查配置表 或者 下发数据") end -- 设置额外奖励 UIUtils.SetLabel(self.text_BuffDesc, string.FormatByIdsId(Const_IDS.IDS_Escort_AwardUp, CTL.GuildEscort.EscortTeamAwardUp)) end -- 刷新队伍信息 function UIGuildEscortStart:RefreshTeamInfo() -- 如果是没组队 人数也算一个人 local teamMemberNum, ratio = CTL.GuildEscort.GetTeamBonus() UIUtils.SetLabel(self.txt_TeamNum, string.FormatByIdsId(Const_IDS.IDS_MultiplayerDungeon_PlayerNum, teamMemberNum)) UIUtils.SetLabel(self.text_Speed, string.FormatByIdsId(Const_IDS.IDS_Escort_TeamNum1, ratio)) UIUtils.SetLabel(self.text_Reward, string.FormatByIdsId(Const_IDS.IDS_Escort_TeamNum2, ratio)) end return UIGuildEscortStart