local UITeamInviteInPanel = require("View/Team/UITeamInviteInPanel") local UIPKInviteInPanel = UIViewClass(UITeamInviteInPanel) local StrangerIndex = 0 local FriendIndex = 1 local GuildIndex = 2 function UIPKInviteInPanel:OnOpened(context) self.activityID = context and context.activityID UIUtils.SetLabelText(self.UICommonPopUp.txt_Title, Const_IDS["IDS_PK_Room_InviteTitle"]) end function UIPKInviteInPanel:RefreshSingleApplyTeamInfo(inviteInfo, cell) --好友的数据字段名首字母都是小写,陌生人和势力的数据中字段名都是大写 CTL.Character.SetPortraitAndFrame(cell.UIHeroHead150, inviteInfo.PortraitId or inviteInfo.portraitId, inviteInfo.FrameId or inviteInfo.frameId, inviteInfo.level) UIUtils.SetLabelText(cell.lab_GuildName, Const_IDS["IDS_TeamUI_ActiveInvitation_NoGuild"]) local server = "" if CTL.CrossServer.IsInCrossServerScene() then server = CTL.CrossServer.GetServerShowStr(inviteInfo.ShowServerId or inviteInfo.showServerId, not (inviteInfo.IsCross or inviteInfo.isCross)) end cell.lab_RoleName.text = inviteInfo.name .. server CTL.Player.OperateGenderImage(cell.image_Gender, inviteInfo.sex) local guildId = inviteInfo.guildID local emblemContent = inviteInfo.EmblemContent local emblemFrame = inviteInfo.EmblemFrame --工会的用工会基础信息 if self.currentIndex == GuildIndex and self.guildBaseInfo then guildId = self.guildBaseInfo.id emblemContent = self.guildBaseInfo.emblemContent emblemFrame = self.guildBaseInfo.emblemFrame elseif self.currentIndex == StrangerIndex then guildId = inviteInfo.guildId end --有工会的话显示势力名字、徽记显示 if not string.isNilOrEmpty(inviteInfo.guildName) then cell.lab_GuildName.text = inviteInfo.guildName UIUtils.SetLabel(cell.txt_GuildInitiate,emblemContent) if emblemFrame > 0 then UTL.Item.SetAtlasSprite(cell.img_GuildMark, "UI_Guild", DataSheetManager.GuildEmblem:GetDataByID(emblemFrame).Image) end UIUtils.SetActive(cell.txt_GuildInitiate, true) UIUtils.SetActive(cell.img_GuildMark, true) else UIUtils.SetActive(cell.txt_GuildInitiate, false) UIUtils.SetActive(cell.img_GuildMark, false) end --同势力显示不同颜色的工会名字 if MDL.Guild.IsSameGuild(guildId) then UIUtils.SetLabel(cell.lab_GuildName, UTL.Color.FormatTextByColor(UTL.Color.ModelNameColor.Blue, inviteInfo.guildName)) end if self.activityID == LuaConst.ActivityType.SyncSoloPK then UIUtils.SetActive(cell.lab_Level_1v1, true) UIUtils.SetActive(cell.lab_Level_3v3, false) if GameAppInfo.IsVietnamPackage() then UIUtils.SetLabel(cell.lab_Level_1v1, self:GetDanRankDesc(inviteInfo.SyncSoloEloScore)) else UIUtils.SetLabel(cell.lab_Level_1v1, string.FormatByIdsId(Const_IDS["IDS_PK_Room_Invite_1v1"], self:GetDanRankDesc(inviteInfo.SyncSoloEloScore))) end else UIUtils.SetActive(cell.lab_Level_1v1, false) UIUtils.SetActive(cell.lab_Level_3v3, true) if GameAppInfo.IsVietnamPackage() then UIUtils.SetLabel(cell.lab_Level_3v3, self:GetDanRankDesc(inviteInfo.SyncTvTEloScore)) else UIUtils.SetLabel(cell.lab_Level_3v3, string.FormatByIdsId(Const_IDS["IDS_PK_Room_Invite_3v3"], self:GetDanRankDesc(inviteInfo.SyncTvTEloScore))) end end end function UIPKInviteInPanel:OnCellClicked(scrollRect, index, cellTable, target, data) if target == cellTable.btn_Invite then cellTable.btn_Invite:SetGray(true) MDL.CustomRoom.CustomRoomInviteReq(data.acid) end end function UIPKInviteInPanel:GetDanRankDesc(eloPoint) local rankData = self.activityID == LuaConst.ActivityType.SyncSoloPK and MDL.SyncSolo.GetLevelByScore(eloPoint) or MDL.SyncTeamPVP.GetLevelByScore(eloPoint) local maxScore = self.activityID == LuaConst.ActivityType.SyncSoloPK and MDL.SyncSolo.GetMaxScore() or MDL.SyncTeamPVP.GetMaxScore() if eloPoint >= maxScore then return string.FormatByIdsId(Const_IDS["IDS_PK_InviteListLevelMax"], UIUtils.GetLocalizedTxt(Const_IDS[rankData.LevelName])) else return UIUtils.GetLocalizedTxt(Const_IDS[rankData.LevelName]) end end return UIPKInviteInPanel