Originally Posted by Sojik
Please do. I'm curious.
|
so I finally managed to spawn and style them:
arena and arenatarget frames:
party pet frames:
alright, so thats how I spawn them:
lua Code:
local function genStyle(self)
lib.init(self)
lib.moveme(self)
lib.gen_hpbar(self)
lib.gen_hpstrings(self)
lib.gen_ppbar(self)
lib.gen_highlight(self)
end
if cfg.showpartypet and oUF_Party:IsVisible() then
oUF:RegisterStyle("oUF_mono_PartyPet", CreatePartyPetStyle)
oUF:SetActiveStyle("oUF_mono_PartyPet")
local partypet = {}
for i = 1, 4 do
partypet[i] = oUF:Spawn('partypet'..i, 'oUF_PartyPet'..i)
if i == 1 then
partypet[i]:SetPoint('TOPLEFT', oUF_Party, 'TOPRIGHT', -7, 0)
else
partypet[i]:SetPoint('TOP', partypet[i-1], 'BOTTOM', 0, -27)
end
end
end
local gap = 56
if cfg.showarena then
SetCVar("showArenaEnemyFrames", false)
oUF:RegisterStyle("oUF_mono_Arena", CreateArenaStyle)
oUF:SetActiveStyle("oUF_mono_Arena")
local arena = {}
local arenatarget = {}
for i = 1, 5 do
arena[i] = oUF:Spawn("arena"..i, "oUF_Arena"..i)
if i == 1 then
arena[i]:SetPoint("BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -117, 372)
else
arena[i]:SetPoint("BOTTOMRIGHT", arena[i-1], "BOTTOMRIGHT", 0, gap)
end
end
oUF:RegisterStyle("oUF_mono_ArenaTarget", CreateArenaTargetStyle)
oUF:SetActiveStyle("oUF_mono_ArenaTarget")
for i = 1, 5 do
arenatarget[i] = oUF:Spawn("arena"..i.."target", "oUF_Arena"..i.."target"):SetPoint("TOPRIGHT",arena[i], "TOPLEFT", -4, 0)
end
end
I use specific style functions:
lua Code:
--party pets
local function CreatePartyPetStyle(self)
self.width = 35
self.height = 35
self.scale = 0.9
self.mystyle = "partypet"
genStyle(self)
self.Range = {
insideAlpha = 1,
outsideAlpha = 0.6}
self.Health.frequentUpdates = true
self.Health.colorDisconnected = true
self.Health.colorHappiness = true
self.colors.smooth = {1,0,0, .7,.41,.44, .3,.3,.3}
self.Health.colorSmooth = true
self.Health.bg.multiplier = 0.1
end
--arena frames
local function CreateArenaStyle(self)
self.width = 196
self.height = 22
self.scale = 0.9
self.mystyle = "arena"
genStyle(self)
self.Health.Smooth = true
self.Health.frequentUpdates = true
self.colors.smooth = {1,0,0, .7,.41,.44, .3,.3,.3}
self.Health.colorSmooth = true
self.Health.bg.multiplier = 0.1
self.Power.frequentUpdates = true
self.Power.colorPower = true
self.Power.bg.multiplier = 0.3
lib.createBuffs(self)
lib.gen_ppstrings(self)
lib.gen_castbar(self)
end
--mini arena targets
local function CreateArenaTargetStyle(self)
self.width = 35
self.height = 35
self.scale = 0.9
self.mystyle = "arenatarget"
genStyle(self)
self.Health.frequentUpdates = true
self.Health.colorDisconnected = true
self.Health.colorHappiness = true
self.colors.smooth = {1,0,0, .7,.41,.44, .3,.3,.3}
self.Health.colorSmooth = true
self.Health.bg.multiplier = 0.1
end
example of how I address to those frames from functions lib:
lua Code:
lib.gen_hpstrings = function(f, unit)
local h = CreateFrame("Frame", nil, f)
h:SetAllPoints(f.Health)
h:SetFrameLevel(10)
local valsize
if f.mystyle == "arenatarget" or f.mystyle == "partypet" then valsize = 11 else valsize = 13 end
local name = lib.gen_fontstring(h, cfg.font, 13, "THINOUTLINE")
local hpval = lib.gen_fontstring(h, cfg.font, valsize, "THINOUTLINE")
if f.mystyle == "target" or f.mystyle == "tot" then
name:SetPoint("RIGHT", f.Health, "RIGHT",-3,0)
hpval:SetPoint("LEFT", f.Health, "LEFT",3,0)
name:SetJustifyH("RIGHT")
name:SetPoint("LEFT", hpval, "RIGHT", 5, 0)
elseif f.mystyle == "arenatarget" or f.mystyle == "partypet" then
name:SetPoint("CENTER", f.Health, "CENTER",0,6)
name:SetJustifyH("LEFT")
hpval:SetPoint("CENTER", f.Health, "CENTER",0,-6)
else
name:SetPoint("LEFT", f.Health, "LEFT",3,0)
hpval:SetPoint("RIGHT", f.Health, "RIGHT",-3,0)
name:SetJustifyH("LEFT")
name:SetPoint("RIGHT", hpval, "LEFT", -5, 0)
end
if f.mystyle == "arenatarget" or f.mystyle == "partypet" then
f:Tag(name, '[mono:color][mono:shortname]')
f:Tag(hpval, '[mono:hpraid]')
else
f:Tag(name, '[mono:color][mono:longname]')
f:Tag(hpval, '[mono:hp]')
end
end
Sorry for the long post, but I didn't manage to find [spoiler] BBtag on those boards. Please point me out if there is one :/
Anyway my layout is available to download as
part of my UI pack if you want to check it out.
Originally Posted by Sojik
Code:
custom [group:party,nogroup:raid][@raid6,noexists,group:raid] show;hide
for party and raid10 for the raid frames.
|
I'm curious how to implement this without editing oUF core. I mean is it possible to apply those conditions straight to the layout without using that party-toggle hack-ish script?