local UIBossChallengeSummaryPanel = require "View/FairPlay/BossChallenge/UIBossChallengeSummaryPanel"; local UISubjectMonthChallengeSummaryPanel = UIViewClass(UIBossChallengeSummaryPanel) function UISubjectMonthChallengeSummaryPanel:SetBossChallengeScore(info) self.txt_Score.text = info.curPoint self.txt_TimeScore.text = "+" .. info.passTimePoint self.txt_Damage.text = UTL.Attr.FormatNumberToPercentage(1 - info.bossHpLeft, 0) self.txt_DamageScore.text = "+" .. info.bossHpLeftPoint self.txt_SurvivalNum.text = info.heroLeft self.txt_SurvivalScore.text = "+" .. info.heroLeftPoint if info.bossKilledPoint > 0 then UIUtils.SetLabelText(self.txt_BossKill, Const_IDS["IDS_BossChallenge_Settlement_ScoreInfo_Yes"]) self.txt_Time.text = self:FormatTime(info.passTime) else UIUtils.SetLabelText(self.txt_BossKill, Const_IDS["IDS_BossChallenge_Settlement_ScoreInfo_No"]) UIUtils.SetLabelText(self.txt_Time, Const_IDS["IDS_BossChallenge_Settlement_ScoreInfo_NotPass"]) end self.txt_BossKillScore.text = "+" .. info.bossKilledPoint self.bossId = info.bossLevelId local cfg = CTL.MonthBossChallenge.GetLevelCfg(self.bossId) local scoreData = DataSheetManager.VersionsBossChallengeScore:GetDataByID(cfg.Difficulty) self.txt_ScoreLimit.text = "/" .. scoreData.MaxScore UIUtils.SetActive(self.img_NewRecord, info.curPoint > info.lastPoint) UIUtils.SetActive(self.left_hp, true) self.txt_leftHP.text = info.heroLeftHpRate .. "%" self.txt_leftHPScore.text = "+" .. info.heroHpLeftPointScore end function UISubjectMonthChallengeSummaryPanel:FormatTime(passTime) local milTime = string.format("%.2f", passTime / 1000) return string.FormatByIdsId(Const_IDS.IDS_DragonArtey_Reborn1, milTime) end function UISubjectMonthChallengeSummaryPanel:SetBossChallengeText(score) local bossData = DataSheetManager.VersionsBossChallengeBoss:GetDataByID(self.bossId) UIUtils.SetLabelText(self.txt_Target, Const_IDS[bossData.BossChallengeName]) local isPass = CTL.MonthBossChallenge.IsChallengePassed(self.bossId, score) UIUtils.SetActive(self.event_ChallengeAgain, not isPass) if isPass then UIUtils.SetActive(self.txt_NotPass, false) UIUtils.SetActive(self.txt_Pass, true) UIUtils.SetLabelText(self.txt_Pass, Const_IDS["IDS_BossChallenge_Settlement_Pass2"]) CTL.Sound.PlayGameSound("MUSIC_Victory") else UIUtils.SetActive(self.txt_NotPass, true) UIUtils.SetActive(self.txt_Pass, false) UIUtils.SetLabelText(self.txt_NotPass, Const_IDS["IDS_FairPlay_FightRecord_Result_Lose"]) CTL.Sound.PlayGameSound("MUSIC_Fail") end end function UISubjectMonthChallengeSummaryPanel:OnClickChallengeAgain() local heroFormationList = MDL.MonthBossChallenge.LoadBossFormation(self.bossLevelId) for i, v in ipairs(heroFormationList) do if v == 0 then CTL.Tips.AddTipsMsg(Const_IDS["IDS_BossChallenge_ChooseHero_LackHero"]) return end end MDL.MonthBossChallenge.EnterBossChallengeRequest(self.bossId, heroFormationList) end -- 点击按钮回城 function UISubjectMonthChallengeSummaryPanel:OnClickBackTownButton() MDL.Level.SendRoleLeaveFuben() self:StopRepeatFunc(self.OnUpdateFun) end return UISubjectMonthChallengeSummaryPanel