I'm currently working on some additions/changes to the oUF_Neav layout and I've run into a snag. I'm trying to hide the Level text when I am resting or in combat, and display those icons instead. I'm able to get the icons to display correctly, however I'm having issues with hiding the Level text. This is the code I'm currently running:
Code:
-- level
if (unit == "player" or unit == "target" or unit == "focus") then
self.Level = CreateFont(self.Health, "Interface\\AddOns\\oUF_Neav\\media\\fontNumber.ttf", 17, "OUTLINE", 0, 0)
self.Level:SetPoint("CENTER", self.f, (unit == "player" and -63) or 63.5, -15)
self.Level:SetText("[level]")
self:Tag(self.Level, "[level]")
end
--combaticon
if (unit == "player") then
self.Combat = self.Health:CreateTexture(nil, 'OVERLAY', self)
self.Combat:SetHeight(20)
self.Combat:SetWidth(20)
self.Combat:SetPoint('CENTER', self.f, -63, -15)
self.Combat:SetTexture('Interface\\CharacterFrame\\UI-StateIcon')
self.Combat:SetTexCoord(0.58, 0.90, 0.08, 0.41)
end
--resticon
if (unit == "player") then
self.Resting = self.Health:CreateTexture(nil, 'OVERLAY', self)
self.Resting:SetHeight(28)
self.Resting:SetWidth(28)
self.Resting:SetPoint('CENTER', self.f, -63, -15)
self.Resting:SetTexture('Interface\\CharacterFrame\\UI-StateIcon')
self.Resting:SetTexCoord(0,0.5,0,0.421875)
end
I then have this set to the player frame specifically:
Code:
if self.Resting then
self.Level:Hide()
elseif self.Combat then
self.Level:Hide()
else
self.Level:Show()
end
I've also tried
Code:
if (not self.Resting or self.Combat) then
self.Level:Show()
else
self.Level:Hide()
end
The first hides the level text all the time, while the second doesn't hide it at all. I'm not sure where to go from here. Any help would be appreciated.
Edit: Actually, after beating on a target dummy my request has become slightly more complicated. I'd like to prioritize Resting icon > Combat icon > Level text. I still haven't found a way to do this though.