Since it seems I cannot move the default Boss1TargetFrame without running in to issues in combat, I've just decided to recreate the boss frames in XML with BossTargetFrameTemplate. XML is uncharted territory for me, so be gentle.
I have essentially gotten the frames to look how I want them to look, and function how I want them to function with the exception of their show state.
I can get them to hide when there's no bosses around, but I cannot get them to mirror the "normal" bossframes, especially when more than 1 boss gets pulled.
Here is my current code:
Basic XML
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<Script file="mBossframes.lua"/>
<Button name="mBoss1TargetFrame" inherits="BossTargetFrameTemplate" id="1">
<Anchors>
<Anchor point="TOPRIGHT" x="-310" y="-510"/>
</Anchors>
</Button>
<Button name="mBoss2TargetFrame" inherits="BossTargetFrameTemplate" id="2">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="mBoss1TargetFrame" relativePoint="BOTTOMLEFT" x="0" y="-30"/>
</Anchors>
</Button>
<Button name="mBoss3TargetFrame" inherits="BossTargetFrameTemplate" id="3">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="mBoss2TargetFrame" relativePoint="BOTTOMLEFT" x="0" y="-30"/>
</Anchors>
</Button>
<Button name="mBoss4TargetFrame" inherits="BossTargetFrameTemplate" id="4">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="mBoss3TargetFrame" relativePoint="BOTTOMLEFT" x="0" y="-30"/>
</Anchors>
</Button>
<Button name="mBoss5TargetFrame" inherits="BossTargetFrameTemplate" id="5">
<Anchors>
<Anchor point="TOPLEFT" relativeTo="mBoss4TargetFrame" relativePoint="BOTTOMLEFT" x="0" y="-30"/>
</Anchors>
</Button>
</Ui>
And Lua:
Lua Code:
function IsBossFrameShown()
for i = 1, MAX_BOSS_FRAMES do
local b = _G["Boss"..i.."TargetFrame"]
if b and b:IsShown() then
return true
end
end
return false
end
function UpdateView()
for i = 1, MAX_BOSS_FRAMES do
local t = _G["mBoss"..i.."TargetFrame"]
if mBoss1TargetFrame:IsShown() and IsBossFrameShown() then
return
elseif not mBoss1TargetFrame:IsShown() and IsBossFrameShown() then
mBoss1TargetFrame:Show()
elseif (t) then
t:Hide()
end
end
end
for i = 1, MAX_BOSS_FRAMES do
local b = _G["Boss"..i.."TargetFrame"]
b:HookScript("OnShow",function() UpdateView() end)
b:HookScript("OnHide",function() UpdateView() end)
end