I see!
I guess I can take this thread to ask another question, I can't seem to get an HP text working on my party frames anymore, it just doesn't show up no matter what I change about it. I've tried moving it around, I've tried rearranging the code a bit (a ton, actually. I barely know where things are anymore!
) and I've tried changing the tag I use in case that was the fault, but none work. It just doesn't show, no error or anything.
These are the relevant parts to my party frames in my Shared function:
Code:
local HealthValue = Health:CreateFontString(nil, 'OVERLAY')
HealthValue:SetPoint('RIGHT', -7, -1)
HealthValue:SetFont(FONT, FONTSIZE, FONTSTYLE)
HealthValue:SetJustifyH('RIGHT')
HealthValue.frequentUpdates = 1/4
self.HealthValue = HealthValue
local PowerValue = self.Health:CreateFontString(nil, 'OVERLAY')
if(unit=='player' or unit=='party') then
PowerValue:SetFont(FONT, FONTSIZE, FONTSTYLE)
PowerValue:SetJustifyH('LEFT')
PowerValue.frequentUpdates = 0.1
if(unit=='player') then
self:Tag(PowerValue, '[oppower]')
PowerValue:SetPoint('LEFT', 7, -1)
PowerValue:SetPoint('RIGHT', self.HealthValue, 'LEFT', -3)
else
self:Tag(PowerValue, '[oppartypp]')
PowerValue:SetPoint('LEFT', 7, 0)
PowerValue:SetPoint('RIGHT', self.HealthValue, 'LEFT', -3)
HealthValue:SetPoint('RIGHT', -7, 0)
end
end
And this is the party stuff in my UnitSpecific function:
Code:
party = function(self)
local Name = self.Health:CreateFontString(nil, 'OVERLAY')
Name:SetPoint('CENTER', 0, 0)
Name:SetPoint('CENTER', self, 'CENTER')
Name:SetFont(FONT, FONTSIZE, FONTSTYLE)
Name:SetJustifyH('CENTER')
self:Tag(Name, '[opname]')
local RoleIcon = self:CreateTexture(nil, 'ARTWORK')
RoleIcon:SetPoint('LEFT', self, 'RIGHT', 3, 0)
RoleIcon:SetSize(14, 14)
RoleIcon:SetAlpha(1)
self.LFDRole = RoleIcon
local ReadyCheck = self:CreateTexture(nil, 'OVERLAY')
ReadyCheck:SetPoint('LEFT', self, 'RIGHT', 3, 0)
ReadyCheck:SetSize(14, 14)
self.ReadyCheck = ReadyCheck
self:HookScript('OnEnter', function() RoleIcon:SetAlpha(1) end)
self:HookScript('OnLeave', function() RoleIcon:SetAlpha(0) end)
self.Tag(HealthValue, '[ophealth]')
self.Health:SetAllPoints()
end,
I spawn my party frames using p3lim's header code:
Code:
self:SpawnHeader(nil, nil, 'custom [group:party] show; [@raid3,exists] hide; [@raid26,exists] hide; hide',
'showParty', true, 'showRaid', false, 'showPlayer', false, 'yOffset', -4,
'oUF-initialConfigFunction', [[
self:SetHeight(24)
self:SetWidth(159)
]]
):SetPoint('TOP', oUF_opUnitFramesPlayer, 'BOTTOM', 0, -10)
And then I hide Blizzard's party frames using oUF's DisableBlizzard function.
The party frames spawn just fine, they work great when it comes to my power tag and name tag, but my HP tag just doesn't show up.
Oh yeah, the tag I want to show is this:
Code:
oUF.Tags.Methods['oppartyhp'] = function(unit)
local cur, max = UnitHealth(unit), UnitHealthMax(unit)
if(cur ~= max and not UnitIsDeadOrGhost(unit)) then
return ('|cffff0000-%s|r'):format(ShortValue(max - cur))
else
return ('%s'):format(ShortValue(max))
end
end
For my full .lua file, go
here. For the tags file, go
here. Word of caution:
They're messy.
I've tried moving the "self.Tag(HealthValue, '[ophealth]')" line to my Shared function (it's currently in my UnitSpecific function) but to no avail.
EDIT: Actually, come to think of it, it doesn't work for my Focus frame or Pet frame either. Odd.