So then I'm doing it backwards, ok well if I rip your code then put my stuff in there I still don't get anything. Probably missing something though now that I think about it....
Code:
------------------------------------------------------------------------
-- oUF Layout boiletplate
-- Author : Kelly Crabbé
------------------------------------------------------------------------
------------------------------------------------------------------------
-- Namespace
------------------------------------------------------------------------
local _, ns = ...
------------------------------------------------------------------------
-- Config
------------------------------------------------------------------------
local NORMALFONT = STANDARD_TEXT_FONT
local TEXTURE = [=[Interface\ChatFrame\ChatFrameBackground]=]
local BACKDROP = {
bgFile = TEXTURE, insets = {top = -1, bottom = -1, left = -1, right = -1}
}
-----------------------------
-- Add custom functions (overrides)
------------------------------------------------------------------------
-- UnitSpecific settings
------------------------------------------------------------------------
local UnitSpecific = {
player = function(self)
-- player specific stuff
local frame = CreateFrame("Frame", "Bob", UIParent)
frame:SetPoint("CENTER",UIParent,0,0)
frame:SetSize(100,100)
end,
target = function(self)
-- target specific stuff
end,
party = function(self)
-- party frames
end,
boss = function(self)
-- boss frames
end,
arena = function(self)
-- arena frames
end
}
UnitSpecific.raid = UnitSpecific.party -- raid is equal to party
------------------------------------------------------------------------
-- Shared settings
------------------------------------------------------------------------
local function Shared(self, unit)
self:SetScript("OnEnter", UnitFrame_OnEnter)
self:SetScript("OnLeave", UnitFrame_OnLeave)
self:RegisterForClicks"AnyUp"
-- shared functions
local frame = CreateFrame("Frame", "Bob", UIParent)
frame:SetPoint("CENTER",UIParent,0,0)
-- Position and size
local Health = CreateFrame("StatusBar", nil, frame)
Health:SetHeight(50)
Health:SetPoint('TOP')
Health:SetPoint('LEFT')
Health:SetPoint('RIGHT')
-- Options
Health.frequentUpdates = true
Health.colorTapping = true
Health.colorDisconnected = true
Health.colorClass = true
Health.colorReaction = true
Health.colorHealth = true
-- Register it with oUF
frame.Health = Health
frame.Health.bg = Background
-- leave this in!!
if(UnitSpecific[unit]) then
return UnitSpecific[unit](self)
end
end
oUF:RegisterStyle('Bob', Shared)
oUF:Factory(function(self)
self:SetActiveStyle('Bob')
self:Spawn('player'):SetPoint('CENTER', -300, -250)
self:Spawn('target'):SetPoint('CENTER', 300, -250)
self:SpawnHeader(nil, nil, 'custom [group:party] show; [@raid3,exists] show; [@raid26,exists] hide; hide',
'showParty', true, 'showRaid', true, 'showPlayer', true, 'yOffset', -6,
'oUF-initialConfigFunction', [[
self:SetHeight(16)
self:SetWidth(126)
]]
):SetPoint('TOP', Minimap, 'BOTTOM', 0, -10)
end)
local PreperationHandler = CreateFrame('Frame')
PreperationHandler:RegisterEvent('PLAYER_LOGIN')
PreperationHandler:SetScript('OnEvent', function(self, event)
-- Insert base function here
end)