Hello everyone,
after a break from WoW i wanted to start again, but instead of using ElvUI or any other compilation i want to build my UI from scratch this time. Therefore id' like to use oUF for UnitFrames, since it offers much more flexibility regarding specific units and what not.
But right from the start im running into problems.. every module has a basic implementation in the comment at the Top, i used the Boilerplate found at GitHub and started creating a basic HealthBar.. but it doesnt show up but isnt throwing erros either.. so im kind of clueless to the Whys, maybe someone here can help me
Lua Code:
local _, ns = ...
local texture = [[Interface\ChatFrame\ChatFrameBackground]]
local UnitSpecific = {
player = function(self)
-- Player specific layout code.
--[[ Position and size
local Power = CreateFrame('StatusBar', nil, self)
Power:SetHeight(20)
Power:SetPoint('BOTTOM')
Power:SetPoint('LEFT')
Power:SetPoint('RIGHT')
-- Add a background
local Background = Power:CreateTexture(nil, 'BACKGROUND')
Background:SetAllPoints(Power)
Background:SetTexture(1, 1, 1, .5)
-- Options
Power.frequentUpdates = true
Power.colorTapping = true
Power.colorDisconnected = true
Power.colorPower = true
Power.colorClass = true
Power.colorReaction = true
-- Make the background darker.
Background.multiplier = .5
-- Register it with oUF
Power.bg = Background
self.Power = Power
]]
end,
party = function(self)
-- Party specific layout code.
end,
}
local Shared = function(self, unit)
-- general
self:RegisterForClicks('AnyUp')
self:SetScript('OnEnter', UnitFrame_OnEnter)
self:SetScript('OnLeave', UnitFrame_OnLeave)
--self:SetBackdrop(BACKDROP)
--self:SetBackdropColor(0, 0, 0)
-- Shared layout code.
-- Position and size
local Health = CreateFrame('StatusBar', nil, self)
Health:SetSize(150,20)
Health:SetStatusBarTexture(texture)
Health:SetStatusBarColor(1/3, 1/3, 1/3)
Health:SetReverseFill(true)
Health.frequentUpdates = true
self.Health = Health
-- Add a background
local Background = Health:CreateTexture(nil, 'BACKGROUND')
Background:SetAllPoints()
Background:SetTexture(1, 1, 1, .5)
-- Make the background darker.
Background.multiplier = .5
-- Register it with oUF
Health.bg = Background
-- Options
Health.frequentUpdates = true
Health.colorTapping = true
Health.colorDisconnected = true
Health.colorClass = true
Health.colorReaction = true
--Health.colorHealth = true
--self.Health = Health
if(UnitSpecific[unit]) then
return UnitSpecific[unit](self)
end
end
oUF:RegisterStyle("MyLayout", Shared)
oUF:Factory(function(self)
self:SetActiveStyle("MyLayout")
self:Spawn("player"):SetPoint('CENTER', -300, -250)
-- oUF:SpawnHeader(overrideName, overrideTemplate, visibility, attributes ...)
local party = self:SpawnHeader(nil, nil, 'raid,party,solo',
-- [url]http://wowprogramming.com/docs/secure_template/Group_Headers[/url]
-- Set header attributes
'showParty', true,
'showPlayer', true,
'yOffset', -20
)
party:SetPoint("TOPLEFT", 30, -30)
end)
Thats my current code i am using. I also had a look at oUF_p3lim, there its done in the same way.
The default UI Player frame isnt showing up, but neither is mine..
I appreciate any help regarding my problems!
Thanks in advance