mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-25 17:16:02 +00:00
combopoints: convert to seperate module & movable
This commit is contained in:
@@ -79,6 +79,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("unitframes", nil, "layout", "default")
|
||||
pfUI:UpdateConfig("unitframes", nil, "rangecheck", "0")
|
||||
pfUI:UpdateConfig("unitframes", nil, "rangechecki", ".5")
|
||||
pfUI:UpdateConfig("unitframes", nil, "combosize", "6")
|
||||
|
||||
-- pfUI:UpdateConfig("unitframes", nil, "buff_size", "20") -- TODO migrate, deprecated
|
||||
-- pfUI:UpdateConfig("unitframes", nil, "debuff_size", "20") -- TODO migrate, deprecated
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
pfUI:RegisterModule("combopoints", function ()
|
||||
-- Hide Blizzard combo point frame and unregister all events to prevent it from popping up again
|
||||
ComboFrame:Hide()
|
||||
ComboFrame:UnregisterAllEvents()
|
||||
|
||||
pfUI.combopoints = CreateFrame("Frame")
|
||||
|
||||
pfUI.combopoints:RegisterEvent("UNIT_COMBO_POINTS")
|
||||
pfUI.combopoints:RegisterEvent("PLAYER_COMBO_POINTS")
|
||||
pfUI.combopoints:RegisterEvent("UNIT_DISPLAYPOWER")
|
||||
pfUI.combopoints:RegisterEvent("PLAYER_TARGET_CHANGED")
|
||||
pfUI.combopoints:RegisterEvent('UNIT_ENERGY')
|
||||
pfUI.combopoints:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
|
||||
pfUI.combopoints:SetScript("OnEvent", function()
|
||||
if event == "PLAYER_ENTERING_WORLD" then
|
||||
local combo_size = C["unitframes"]["combosize"]
|
||||
|
||||
for point=1, 5 do
|
||||
if not pfUI.combopoints["combopoint" .. point] then
|
||||
pfUI.combopoints["combopoint" .. point] = CreateFrame("Frame", "pfCombo" .. point, UIParent)
|
||||
pfUI.combopoints["combopoint" .. point]:SetFrameStrata("HIGH")
|
||||
pfUI.combopoints["combopoint" .. point]:SetWidth(combo_size)
|
||||
pfUI.combopoints["combopoint" .. point]:SetHeight(combo_size)
|
||||
CreateBackdrop(pfUI.combopoints["combopoint" .. point])
|
||||
|
||||
if pfUI.uf.target then
|
||||
pfUI.combopoints["combopoint" .. point]:SetPoint("TOPLEFT", pfUI.uf.target, "TOPRIGHT", C.appearance.border.default*3, -(point - 1) * (combo_size + C.appearance.border.default*3))
|
||||
else
|
||||
pfUI.combopoints["combopoint" .. point]:SetPoint("CENTER", UIParent, "CENTER", (point - 3) * (combo_size + C.appearance.border.default*3), 10 )
|
||||
end
|
||||
UpdateMovable(pfUI.combopoints["combopoint" .. point])
|
||||
end
|
||||
|
||||
if point < 3 then
|
||||
local tex = pfUI.combopoints["combopoint" .. point]:CreateTexture("OVERLAY")
|
||||
tex:SetAllPoints(pfUI.combopoints["combopoint" .. point])
|
||||
tex:SetTexture(1, .3, .3, .75)
|
||||
elseif point < 4 then
|
||||
local tex = pfUI.combopoints["combopoint" .. point]:CreateTexture("OVERLAY")
|
||||
tex:SetAllPoints(pfUI.combopoints["combopoint" .. point])
|
||||
tex:SetTexture(1, 1, .3, .75)
|
||||
else
|
||||
local tex = pfUI.combopoints["combopoint" .. point]:CreateTexture("OVERLAY")
|
||||
tex:SetAllPoints(pfUI.combopoints["combopoint" .. point])
|
||||
tex:SetTexture(.3, 1, .3, .75)
|
||||
end
|
||||
pfUI.combopoints["combopoint" .. point]:Hide()
|
||||
end
|
||||
else
|
||||
local combopoints = GetComboPoints("target")
|
||||
for point=1, 5 do
|
||||
pfUI.combopoints["combopoint" .. point]:Hide()
|
||||
end
|
||||
for point=1, combopoints do
|
||||
pfUI.combopoints["combopoint" .. point]:Show()
|
||||
end
|
||||
end
|
||||
end)
|
||||
end)
|
||||
+33
-2
@@ -162,7 +162,12 @@ pfUI:RegisterModule("gui", function ()
|
||||
frame.drag:SetScript("OnMouseWheel", function()
|
||||
local scale = round(frame:GetScale() + arg1/10, 1)
|
||||
|
||||
if IsShiftKeyDown() and strsub(frame:GetName(),0,6) == "pfRaid" then
|
||||
if IsShiftKeyDown() and strsub(frame:GetName(),0,7) == "pfCombo" then
|
||||
for i=1,5 do
|
||||
local frame = _G["pfCombo" .. i]
|
||||
pfUI.gui:SaveScale(frame, scale)
|
||||
end
|
||||
elseif IsShiftKeyDown() and strsub(frame:GetName(),0,6) == "pfRaid" then
|
||||
for i=1,40 do
|
||||
local frame = _G["pfRaid" .. i]
|
||||
pfUI.gui:SaveScale(frame, scale)
|
||||
@@ -193,6 +198,14 @@ pfUI:RegisterModule("gui", function ()
|
||||
|
||||
frame.drag:SetScript("OnMouseDown",function()
|
||||
if IsShiftKeyDown() then
|
||||
if strsub(frame:GetName(),0,7) == "pfCombo" then
|
||||
for i=1,5 do
|
||||
local cframe = _G["pfCombo" .. i]
|
||||
cframe:StartMoving()
|
||||
cframe:StopMovingOrSizing()
|
||||
cframe.drag.backdrop:SetBackdropBorderColor(1,1,1,1)
|
||||
end
|
||||
end
|
||||
if strsub(frame:GetName(),0,6) == "pfRaid" then
|
||||
for i=1,40 do
|
||||
local cframe = _G["pfRaid" .. i]
|
||||
@@ -235,8 +248,25 @@ pfUI:RegisterModule("gui", function ()
|
||||
if frame.oldPos then
|
||||
local diffxpos = frame.oldPos[1] - xpos
|
||||
local diffypos = frame.oldPos[2] - ypos
|
||||
if strsub(frame:GetName(),0,7) == "pfCombo" then
|
||||
for i=1,5 do
|
||||
local cframe = _G["pfCombo" .. i]
|
||||
cframe.drag.backdrop:SetBackdropBorderColor(.2,1,.8,1)
|
||||
if cframe:GetName() ~= frame:GetName() then
|
||||
local _, _, _, xpos, ypos = cframe:GetPoint()
|
||||
cframe:SetPoint("TOPLEFT", xpos - diffxpos, ypos - diffypos)
|
||||
|
||||
if strsub(frame:GetName(),0,6) == "pfRaid" then
|
||||
local _, _, _, xpos, ypos = cframe:GetPoint()
|
||||
|
||||
if not C.position[cframe:GetName()] then
|
||||
C.position[cframe:GetName()] = {}
|
||||
end
|
||||
|
||||
C.position[cframe:GetName()]["xpos"] = xpos
|
||||
C.position[cframe:GetName()]["ypos"] = ypos
|
||||
end
|
||||
end
|
||||
elseif strsub(frame:GetName(),0,6) == "pfRaid" then
|
||||
for i=1,40 do
|
||||
local cframe = _G["pfRaid" .. i]
|
||||
cframe.drag.backdrop:SetBackdropBorderColor(.2,1,.8,1)
|
||||
@@ -866,6 +896,7 @@ pfUI:RegisterModule("gui", function ()
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Unit Frame Layout", C.unitframes, "layout", "dropdown", { "default", "tukui" })
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Aggressive 40y-Range Check (Will break stuff)", C.unitframes, "rangecheck", "checkbox")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "40y-Range Check Interval", C.unitframes, "rangechecki")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Combopoint Size", C.unitframes, "combosize")
|
||||
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Buff- And Debuff Indicators", nil, nil, "header")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Show Hots as Buff Indicators", C.unitframes, "show_hots", "checkbox")
|
||||
|
||||
@@ -13,10 +13,6 @@ pfUI:RegisterModule("target", function ()
|
||||
TargetFrame:Hide()
|
||||
TargetFrame:UnregisterAllEvents()
|
||||
|
||||
-- Hide Blizzard combo point frame and unregister all events to prevent it from popping up again
|
||||
ComboFrame:Hide()
|
||||
ComboFrame:UnregisterAllEvents()
|
||||
|
||||
pfUI.uf.target = pfUI.uf:CreateUnitFrame("Target", nil, C.unitframes.target)
|
||||
pfUI.uf.target:UpdateFrameSize()
|
||||
pfUI.uf.target:SetPoint("BOTTOMLEFT", UIParent, "BOTTOM", 75, 125)
|
||||
|
||||
Reference in New Issue
Block a user