+local function updateLeaderIcon(frame, unit)
+ if UnitIsGroupLeader(frame.unit) then
+ if HasLFGRestrictions() then
+ frame.leader:SetTexture("Interface\\LFGFrame\\UI-LFG-ICON-PORTRAITROLES");
+ frame.leader:SetTexCoord(0, 0.296875, 0.015625, 0.3125);
+ else
+ frame.leader:SetTexture("Interface\\GROUPFRAME\\UI-Group-LeaderIcon");
+ frame.leader:SetTexCoord(0, 1, 0, 1);
+ end
+ frame.leader:Show();
+ elseif UnitIsGroupAssistant(frame.unit) then
+ frame.leader:SetTexture("Interface\\GROUPFRAME\\UI-Group-AssistantIcon");
+ frame.leader:SetTexCoord(0, 1, 0, 1);
+ frame.leader:Show();
+ else
+ frame.leader:Hide();
+ end
+end
+
+local function updateHealthColor(frame, unit)
+ if not UnitPlayerControlled(unit) and UnitIsTapDenied(unit) then
+ frame.health:SetVertexColor(0.5, 0.5, 0.5);
+ elseif UnitIsPlayer(unit) then
+ local _, class = UnitClass(unit);
+ local color = RAID_CLASS_COLORS[class];
+ if color then
+ frame.health:SetVertexColor(color.r, color.g, color.b)
+ else
+ frame.health:SetVertexColor(unpack(healthColor))
+ end
+ elseif UnitPlayerControlled(unit) then
+ frame.health:SetVertexColor(0, 1, 0);
+ else
+ frame.health:SetVertexColor(UnitSelectionColor(unit));
+ end
+end
+
+local function updateRaidMarker(frame, unit)
+ local index = GetRaidTargetIndex(unit);
+ if index then
+ SetRaidTargetIconTexture(frame.targeticon, index);
+ frame.targeticon:Show();
+ else
+ frame.targeticon:Hide();
+ end
+end
+