Volsci
Legend
I've recently been getting more "serious" about arena on ATR.
For the next bit of future, I am looking to get more comfortable when recognizing combat v out of combat (for saps). I'm somewhat comfortable with it and can manage mid-game saps relatively consistently, but I'd like to take it a step further.
What I'm looking to do is configure a miniature addon for use in arena that would display an icon next to a playerframe when somebody is in combat, and no icon when they aren't, so I can get more comfortable with situations where someone may be out of combat. Or maybe even a simple script, I'm not sure.
After I did a little research, I wound up with the following:
local f = CreateFrame("Frame", UIParent)
f.t = f:CreateTexture()
f.t:SetTexture("Interface\\CHARACTERFRAME\\UI-StateIcon.blp")
f.t:SetTexCoord(0.5,1,0,0.49);
f.t:SetAllPoints(f)
f:SetWidth(20)
f:SetHeight(20)
f:SetPoint("CENTER", TargetFrame, "CENTER", 15, 20)
f:Show()
local function FrameOnUpdate(self)
if UnitAffectingCombat("target") then
self:Show()
else
self:Hide()
end
end
local g = CreateFrame("Frame")
g:SetScript("OnUpdate", function(self) FrameOnUpdate(f) end)
Thoughts on this? What (if anything) needs fixing?
And, most importantly, are there any secrets I should know about for implementing it to my UI? or is it as simple as dropping it into my addon folder in a text document labeled .lua
Thanks!
Genocist
For the next bit of future, I am looking to get more comfortable when recognizing combat v out of combat (for saps). I'm somewhat comfortable with it and can manage mid-game saps relatively consistently, but I'd like to take it a step further.
What I'm looking to do is configure a miniature addon for use in arena that would display an icon next to a playerframe when somebody is in combat, and no icon when they aren't, so I can get more comfortable with situations where someone may be out of combat. Or maybe even a simple script, I'm not sure.
After I did a little research, I wound up with the following:
local f = CreateFrame("Frame", UIParent)
f.t = f:CreateTexture()
f.t:SetTexture("Interface\\CHARACTERFRAME\\UI-StateIcon.blp")
f.t:SetTexCoord(0.5,1,0,0.49);
f.t:SetAllPoints(f)
f:SetWidth(20)
f:SetHeight(20)
f:SetPoint("CENTER", TargetFrame, "CENTER", 15, 20)
f:Show()
local function FrameOnUpdate(self)
if UnitAffectingCombat("target") then
self:Show()
else
self:Hide()
end
end
local g = CreateFrame("Frame")
g:SetScript("OnUpdate", function(self) FrameOnUpdate(f) end)
Thoughts on this? What (if anything) needs fixing?
And, most importantly, are there any secrets I should know about for implementing it to my UI? or is it as simple as dropping it into my addon folder in a text document labeled .lua
Thanks!
Genocist
Last edited by a moderator: