local UISoloFightDropPopUp = UIViewClass() function UISoloFightDropPopUp:OnOpened(context) self:RegistSystemEvent(EventID.UI_Solofight_RankDetail_Refresh,self.RefreshPlayer) -- 界面标题 UIUtils.SetLabelText(self.UICommonPopView.txt_Title, Const_IDS["IDS_ActivityNew_NewHint_1"]) self:RefreshInfo() end function UISoloFightDropPopUp:RefreshInfo() self:RefreshCurInfo() self:RefreshDropInfo() local curTitleName = CTL.OfficialPosition.GetTitleFullTxt(self.curTitleData) local curTitleRank = MDL.SoloFight.GetDropTipInfo().rankIdx self.lab_notice.text = string.FormatByIdsKey("IDS_ActivityNew_NewHint_2", curTitleName, curTitleRank) local dropEndTime = MDL.SoloFight.GetDropTipInfo().dropTime - UTL.Time.GetServerTimestamp() if dropEndTime > 0 then self:StartRepeatFunc(self.OnUpdateFun, dropEndTime) end local timeStr = UIUtils.GetLocalizedTxt(Const_IDS.IDS_ActivityNew_NewHint_3).."{0}:{1}:{2}" self.lab_cuntime:ResetAndBeginCustomTimer(false, dropEndTime, 0, timeStr) end function UISoloFightDropPopUp:RefreshCurInfo() self.curTitleData = DataSheetManager.OfficialPosition:GetDataByID(MDL.SoloFight.GetDropTipInfo().titleId) UIUtils.SetImageByAssetBundle(self.img_current.icon_gz, self.curTitleData.OfficialHat) UTL.Color.SetQualityImageByType(self.img_current.img_pz, self.curTitleData.QualityColor, UTL.Color.QualityType.OfficialPositionQuality) UIUtils.SetLabel(self.img_current.lab_gz, UTL.Color.FormatQualityText(UIUtils.GetLocalizedTxt(Const_IDS[self.curTitleData.Name1]), self.curTitleData.QualityColor)) end function UISoloFightDropPopUp:RefreshDropInfo() local titleData = DataSheetManager.OfficialPosition:GetDataByID(MDL.SoloFight.GetDropTipInfo().titleId - 1) UIUtils.SetImageByAssetBundle(self.img_after.icon_gz, titleData.OfficialHat) UTL.Color.SetQualityImageByType(self.img_after.img_pz, titleData.QualityColor, UTL.Color.QualityType.OfficialPositionQuality) UIUtils.SetLabel(self.img_after.lab_gz, UTL.Color.FormatQualityText(UIUtils.GetLocalizedTxt(Const_IDS[titleData.Name1]), titleData.QualityColor)) end function UISoloFightDropPopUp:OnUpdateFun(deltaTime, timeSinceUpdate) self:CloseView() end function UISoloFightDropPopUp:OnBackButtonPressed() self:OnButtonClicked(self.UICommonPopView.btn_Close) end function UISoloFightDropPopUp:OnClosed() CTL.HomeMain.RemoveMainNotice(CTL.HomeMain.NoticeType.SoloFight) end function UISoloFightDropPopUp:OnButtonClicked(comp) if comp == self.event_go then self:CloseView() CTL.SoloFight.OpenSoloFightView() elseif comp == self.UICommonPopView.btn_Close or comp == self.event_ignor then self:CloseView() end end return UISoloFightDropPopUp