2023-07-14 19:35:33 +00:00
|
|
|
--工会boss队员头像组件
|
|
|
|
local XUiGuildBossTeamList = XClass(nil, "XUiGuildBossTeamList")
|
|
|
|
|
|
|
|
function XUiGuildBossTeamList:Ctor(ui)
|
|
|
|
self.GameObject = ui.gameObject
|
|
|
|
self.Transform = ui.transform
|
|
|
|
XTool.InitUiObject(self)
|
|
|
|
self.MaxHeadNum = 3
|
|
|
|
end
|
|
|
|
|
|
|
|
function XUiGuildBossTeamList:Init(data, characterHeadInfoList, needBigHead)
|
|
|
|
characterHeadInfoList = characterHeadInfoList or {}
|
2024-09-01 20:49:41 +00:00
|
|
|
local emptyNum = 0
|
2023-07-14 19:35:33 +00:00
|
|
|
for i = 1, self.MaxHeadNum do
|
2024-09-01 20:49:41 +00:00
|
|
|
self["TeamHeadObj" .. i].gameObject:SetActiveEx(false)
|
|
|
|
if data[i] and data[i] <= 0 then
|
|
|
|
emptyNum = emptyNum + 1 -- 靠左对齐
|
2023-07-14 19:35:33 +00:00
|
|
|
else
|
2024-09-01 20:49:41 +00:00
|
|
|
local index = i - emptyNum
|
|
|
|
self["TeamHeadObj" .. index].gameObject:SetActiveEx(true)
|
2023-07-14 19:35:33 +00:00
|
|
|
if i <= #data then
|
2024-09-01 20:49:41 +00:00
|
|
|
self["TryMarkObj" .. index].gameObject:SetActiveEx(data[i] < 1000000)
|
2023-07-14 19:35:33 +00:00
|
|
|
--Head
|
|
|
|
local characterId
|
|
|
|
if XRobotManager.CheckIsRobotId(data[i]) then
|
|
|
|
characterId = XRobotManager.GetCharacterId(data[i])
|
|
|
|
else
|
|
|
|
characterId = data[i]
|
|
|
|
end
|
|
|
|
local iconPath
|
|
|
|
local headInfo = characterHeadInfoList[i] or {}
|
|
|
|
if needBigHead then
|
|
|
|
iconPath = XDataCenter.CharacterManager.GetCharBigHeadIcon(characterId, true, headInfo.HeadFashionId, headInfo.HeadFashionType)
|
|
|
|
else
|
|
|
|
iconPath = XDataCenter.CharacterManager.GetCharSmallHeadIcon(characterId, true, headInfo.HeadFashionId, headInfo.HeadFashionType)
|
|
|
|
end
|
2024-09-01 20:49:41 +00:00
|
|
|
self["ImgHead" .. index]:SetRawImage(iconPath)
|
2023-07-14 19:35:33 +00:00
|
|
|
|
2024-09-01 20:49:41 +00:00
|
|
|
self["TeamHeadObj" .. index].gameObject:SetActiveEx(true)
|
2023-07-14 19:35:33 +00:00
|
|
|
else
|
2024-09-01 20:49:41 +00:00
|
|
|
self["TeamHeadObj" .. index].gameObject:SetActiveEx(false)
|
2023-07-14 19:35:33 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
return XUiGuildBossTeamList
|