local UIGuildEscortFighting = UIViewClass() -- [[ -- 势力押镖-准备战斗界面 -- ]] -------------------- function UIGuildEscortFighting:OnOpened(context) self:InitPanel(context) end -------------------- function UIGuildEscortFighting:InitPanel(context) local playerList = context.BeRobBattleInfo.enemyHeadInfo -- 设置军团信息(用敌方第一个人的信息来设置) -- 设置军团名字 local playerInfo = playerList[1] if playerInfo == nil then logging.error(LTAG.ERROR, "没有第一个玩家的数据,请检查下发数据") -- 这里是数据错误 防止玩家界面显示有问题所以直接关闭该界面 self:CloseView() end UIUtils.SetLabel(self.txt_GuildName, playerInfo.guildName) -- 设置军团徽记 if string.isNilOrEmpty(playerInfo.EmblemContent) then UIUtils.SetActive(self.img_Guild, false) else UIUtils.SetActive(self.img_Guild, true) UIUtils.SetLabel(self.txt_Guild, playerInfo.EmblemContent) local guildEmblemCfg = DataSheetManager.GuildEmblem:GetDataByID(playerInfo.EmblemFrame) if guildEmblemCfg then UTL.Item.SetAtlasSprite(self.img_Guild, "UI_Guild", guildEmblemCfg.Image) end end -- 设置玩家显示 for i, v in ipairs(playerList) do local item = self.obj_PlayerList[i] UIUtils.SetActive(item.gameObject, true) UIUtils.SetLabel(item.text_Name, v.name) UIUtils.SetLabel(item.text_BR, string.FormatByIdsId(Const_IDS.IDS_Escort_FightPower, v.gsSum)) -- 设置是否为仇人或者被劫镖过 UIUtils.SetActive(item.img_Foe, MDL.GuildEscort.IsShowPlayerRival(v.acid)) CTL.Character.SetPortraitAndFrame(item.HeroHead, v.PortraitId, v.FrameId) end for i = #playerList + 1, #self.obj_PlayerList do UIUtils.SetActive(self.obj_PlayerList[i].gameObject, false) end -- 设置标题 if CTL.GuildEscort.IsTransport() then self.state_Title:SetState(0) else self.state_Title:SetState(1) end end return UIGuildEscortFighting