--[[ 肉鸽游戏战斗结算 ]] local UIRogueBattleSummaryPanel = UIViewClass() function UIRogueBattleSummaryPanel:OnOpened(context) UIManager.ActiveUIModle(false, "UIRogueBattleSummaryPanel") UIUtils.SetLabelText(self.lab_Notice, Const_IDS.IDS_CountryNightBoss_ThisTimeScore) self.autoExitLevelTime = DataSheetManager.ConstData:GetDataByID("AutoExitBarrier").IntValue if context.isWin then CTL.Sound.PlayGameSound("MUSIC_Victory") else CTL.Sound.PlayGameSound("MUSIC_Fail") end self:ShowSummary(context.isWin) self:SetBattleSummaryData(context.MaxScore) end function UIRogueBattleSummaryPanel:SetBattleSummaryData(highestScore) local liveTime, levelID, defeatNum, score = BattleDataGetter.GetRogueLikeBattleSummaryData() UIUtils.SetLabel(self.lab_Condition01, score) local id = CTL.Rogue.LevelIDToID(levelID) if MDL.Rogue.GetLevelPassTimes(id) > 1 then UIUtils.SetActive(self.lab_Top.gameObject, true) UIUtils.SetLabel(self.lab_Top, UIUtils.GetLocalizedTxt(Const_IDS["IDS_SuperGoldHeroActivity_HeroTrial_AccountHint3"]) .. highestScore) else UIUtils.SetActive(self.lab_Top.gameObject, false) end UIUtils.SetActive(self.group_New.gameObject, score > highestScore) local cfg = CTL.Rogue.GetLevelRewardDataByLevelID(BattleDataGetter.GetLevelInfoData().LevelID, score) if cfg then self.state_Reward:SetState(1) self.RewardScroll:ReloadAll(cfg.Item_Table) else self.state_Reward:SetState(0) end local heroId = BattleDataGetter.GetMainPlayerCharacterID() UTL.Item.ItemSquareItemIconByHeroId(heroId, self.img_Avatar01) UIUtils.SetLabelText(self.txt_HeroName, Const_IDS[DataSheetManager.HeroNum:GetDataByID(heroId).NameIDS]) local exp = MDL.Rogue.GetHeroExp(heroId) local levelUpExp = CTL.Rogue.GetHeroLevelUpExp(heroId) self.ProgressBarChapterGoal.fillAmount = exp / levelUpExp local level = MDL.Rogue.GetHeroLevel(heroId) UIUtils.SetLabel(self.txt_HeroLevel, string.FormatByIdsId(Const_IDS.IDS_BreakThrough_Lv, level)) local beforeLevel = self.context.heroLevelBeforeBattle if level > beforeLevel then local points = CTL.Rogue.GetHeroLevelUpSkillPoints(heroId, beforeLevel, level) UIManager.OpenView(Const_UI_Lua.UIEnum.UIHeroLvUpSuccess, {heroId = heroId, before = string.FormatByIdsId(Const_IDS.IDS_HorseSoul_Button3, beforeLevel), after = string.FormatByIdsId(Const_IDS.IDS_HorseSoul_Button3, level), points = points}) end end function UIRogueBattleSummaryPanel:OnCellInit(scrollRect, index, cellTable, data) UTL.Item.SetItemCell(cellTable.item, data.ItemID, data.ItemNum) end function UIRogueBattleSummaryPanel:OnCellClicked(scrollRect, index, cellTable, target, data) if scrollRect == self.RewardScroll then UTL.ItemTips.ShowCommonTipsById(data.ItemID) end end function UIRogueBattleSummaryPanel:ShowSummary(isWin) CameraController.Instance:SetDOF(true, 2) local type = not isWin and CTL.LevelSelect.CommonSummaryType.Over or nil self.summaryTemplateEffectHandle1, self.summaryTemplateEffectHandle2 = CTL.LevelSelect.ShowCommonSummaryTemplate(self, isWin, nil, nil, type) CameraController.Instance:SetGray(not isWin) end -- 点击按钮回城 function UIRogueBattleSummaryPanel:OnClickBackTownButton() MDL.Level.SendRoleLeaveFuben() end function UIRogueBattleSummaryPanel:OnBackButtonPressed() self:OnButtonClicked(self.event_BackTown) end function UIRogueBattleSummaryPanel:OnButtonClicked(obj) if obj == self.event_BackTown then self:OnClickBackTownButton() end end function UIRogueBattleSummaryPanel:OnClosed() UIManager.ActiveUIModle(true, "UIRogueBattleSummaryPanel") CTL.LevelSelect.RemoveSummaryTemplateEffect(self) end return UIRogueBattleSummaryPanel