local UISoloFightMsg = UIViewClass() function UISoloFightMsg:OnOpened(context) UIUtils.SetLabelText(self.UICommonPopUp.txt_Title, Const_IDS["IDS_OfflineSoloFight_Event"]) self:Refresh(context) if context and #context > 0 then MDL.SoloFight.SaveEventTime(context[1].occurTime) self.group_UnSoloFightMsg.gameObject:SetActive(false) self.view_StageSelect.gameObject:SetActive(true) else self.group_UnSoloFightMsg.gameObject:SetActive(true) self.view_StageSelect.gameObject:SetActive(false) end end function UISoloFightMsg:Refresh(list) for i,v in ipairs(list) do self.view_StageSelect:AddData(v,0) end end function UISoloFightMsg:OnBackButtonPressed() self:OnButtonClicked(self.UICommonPopUp.btn_Close) end function UISoloFightMsg:OnButtonClicked(comp) if comp == self.UICommonPopUp.btn_Close then self:CloseView() elseif comp == self.btn_PageLeft then elseif comp == self.btn_PageRight then end end -- Self_Fight_Other = 1, --你挑战别人成功,排名上升 -- Other_Fight_Self = 2, --别人挑战你成功,排名下降 -- Others_Fight_Up = 3, --别人挑战别人,导致你排名上升 -- Others_Fight_Down = 4, --别人挑战别人,导致你排名下降 function UISoloFightMsg:OnCellInit(scrollRect, index, cellTable, data) local portraitId local level local frameId local guildName = data.headInfo.guildName if data.eventType == MDL.SoloFight.EventType.Self_Fight_Other then --我是挑战者,势力名应该用防守方的 guildName = data.defendGuildName if string.isNilOrEmpty(guildName) then cellTable.lab_Msg01.text = string.FormatByIdsId(Const_IDS.IDS_OfflineSoloFight_Event_ChallengeOthers,data.name) else cellTable.lab_Msg01.text = string.FormatByIdsId(Const_IDS.IDS_OfflineSoloFight_Event_ChallengeOthers_Guild, guildName, data.name) end cellTable.lab_Msg02.text = string.FormatByIdsId(Const_IDS.IDS_OfflineSoloFight_Event_RankingHigher,data.idxDelta) portraitId = MDL.Character.GetCurWearPortrait() frameId = MDL.Character.GetCurWearFrame() level = MDL.Player.GetRoleLevel() cellTable.arrowUp.gameObject:SetActive(true) cellTable.arrowDown.gameObject:SetActive(false) cellTable.btn_Challenge.gameObject:SetActive(false) elseif data.eventType == MDL.SoloFight.EventType.Other_Fight_Self then if string.isNilOrEmpty(guildName) then cellTable.lab_Msg01.text = string.FormatByIdsId(Const_IDS.IDS_OfflineSoloFight_Event_ChallengedByOthers,data.name) else cellTable.lab_Msg01.text = string.FormatByIdsId(Const_IDS.IDS_OfflineSoloFight_Event_ChallengedByOthers_Guild, guildName, data.name) end cellTable.lab_Msg02.text = string.FormatByIdsId(Const_IDS.IDS_OfflineSoloFight_Event_RankingLower,data.idxDelta) portraitId = data.headInfo.PortraitId frameId = data.headInfo.FrameId level = data.headInfo.level cellTable.arrowUp.gameObject:SetActive(false) cellTable.arrowDown.gameObject:SetActive(true) cellTable.btn_Challenge.gameObject:SetActive(true) elseif data.eventType == MDL.SoloFight.EventType.Others_Fight_Up then if string.isNilOrEmpty(guildName) then cellTable.lab_Msg01.text = string.FormatByIdsId(Const_IDS.IDS_OfflineSoloFight_Event_ChangedByOthers_Higher,data.name) else cellTable.lab_Msg01.text = string.FormatByIdsId(Const_IDS.IDS_OfflineSoloFight_Event_ChangedByOthers_Higher_Guild, guildName, data.name) end cellTable.lab_Msg02.text = string.FormatByIdsId(Const_IDS.IDS_OfflineSoloFight_Event_RankingHigher,data.idxDelta) portraitId = data.headInfo.PortraitId frameId = data.headInfo.FrameId level = data.headInfo.level cellTable.arrowUp.gameObject:SetActive(true) cellTable.arrowDown.gameObject:SetActive(false) cellTable.btn_Challenge.gameObject:SetActive(false) elseif data.eventType == MDL.SoloFight.EventType.Others_Fight_Down then if string.isNilOrEmpty(guildName) then cellTable.lab_Msg01.text = string.FormatByIdsId(Const_IDS.IDS_OfflineSoloFight_Event_ChangedByOthers_Lower,data.name) else cellTable.lab_Msg01.text = string.FormatByIdsId(Const_IDS.IDS_OfflineSoloFight_Event_ChangedByOthers_Lower_Guild, guildName, data.name) end cellTable.lab_Msg02.text = string.FormatByIdsId(Const_IDS.IDS_OfflineSoloFight_Event_RankingLower,data.idxDelta) portraitId = data.headInfo.PortraitId frameId = data.headInfo.FrameId level = data.headInfo.level cellTable.arrowUp.gameObject:SetActive(false) cellTable.arrowDown.gameObject:SetActive(true) cellTable.btn_Challenge.gameObject:SetActive(true) end CTL.Character.SetPortraitAndFrame(cellTable.UIHeroHead190, portraitId, frameId, level) cellTable.lab_Time.text = os.date(UTL.Time.FormatDateEnum.MDHMS,data.occurTime) end function UISoloFightMsg:OnCellClicked(scrollRect, index, cellTable, target, data) if target == cellTable.btn_Challenge then MDL.SoloFight.FightReq(data.headInfo.acid, 1, true) end end return UISoloFightMsg