mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-11 08:00:01 +00:00
pettarget: add pet target unitframe
This commit is contained in:
+3
-1
@@ -827,7 +827,8 @@ pfUI:RegisterModule("gui", function ()
|
||||
[2] = { "target", T["Target"] },
|
||||
[3] = { "ttarget", T["Target-Target"]},
|
||||
[4] = { "pet", T["Pet"] },
|
||||
[5] = { "focus", T["Focus"] },
|
||||
[5] = { "ptarget", T["Pet-Target"]},
|
||||
[6] = { "focus", T["Focus"] },
|
||||
},
|
||||
|
||||
["gf"] = {
|
||||
@@ -851,6 +852,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
if not this.setup then
|
||||
-- link update tables
|
||||
update.ttarget = update["targettarget"]
|
||||
update.ptarget = update["pettarget"]
|
||||
update.grouptarget = update["group"]
|
||||
update.grouppet = update["group"]
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
pfUI:RegisterModule("pettarget", function ()
|
||||
-- do not go further on disabled UFs
|
||||
if C.unitframes.disable == "1" then return end
|
||||
|
||||
local default_border = pfUI_config.appearance.border.default
|
||||
if pfUI_config.appearance.border.unitframes ~= "-1" then
|
||||
default_border = pfUI_config.appearance.border.unitframes
|
||||
end
|
||||
|
||||
pfUI.uf.pettargetScanner = CreateFrame("Button",nil,UIParent)
|
||||
pfUI.uf.pettargetScanner:SetScript("OnUpdate", function()
|
||||
if pfUI.uf.pettarget.config.visible == "0" then return end
|
||||
if ( this.limit or 1) > GetTime() then return else this.limit = GetTime() + .2 end
|
||||
if UnitExists("pettarget") or (pfUI.unlock and pfUI.unlock:IsShown()) then
|
||||
pfUI.uf.pettarget:Show()
|
||||
else
|
||||
pfUI.uf.pettarget:Hide()
|
||||
pfUI.uf.pettarget.lastUnit = nil
|
||||
end
|
||||
end)
|
||||
|
||||
pfUI.uf.pettarget = pfUI.uf:CreateUnitFrame("PetTarget", nil, C.unitframes.ptarget, .2)
|
||||
pfUI.uf.pettarget:UpdateFrameSize()
|
||||
pfUI.uf.pettarget:SetPoint("TOP", pfUI.uf.pet, "BOTTOM", 0, -default_border)
|
||||
UpdateMovable(pfUI.uf.pettarget)
|
||||
end)
|
||||
@@ -4,6 +4,7 @@ pfUI:RegisterModule("targettarget", function ()
|
||||
|
||||
pfUI.uf.targettargetScanner = CreateFrame("Button",nil,UIParent)
|
||||
pfUI.uf.targettargetScanner:SetScript("OnUpdate", function()
|
||||
if pfUI.uf.targettarget.config.visible == "0" then return end
|
||||
if ( this.limit or 1) > GetTime() then return else this.limit = GetTime() + .2 end
|
||||
if UnitExists("targettarget") or (pfUI.unlock and pfUI.unlock:IsShown()) then
|
||||
pfUI.uf.targettarget:Show()
|
||||
|
||||
Reference in New Issue
Block a user