gui: use cluster move on shift key down

This commit is contained in:
shagu
2016-11-18 20:28:47 +01:00
parent 92721c57f7
commit 32f3b15990
2 changed files with 73 additions and 6 deletions
+3 -3
View File
@@ -3,7 +3,7 @@ pfUI:RegisterModule("group", function ()
if pfUI_config.unitframes.disable == "1" then return end
-- hide blizzard group frames
for i=1, 5 do
for i=1, 4 do
if getglobal("PartyMemberFrame" .. i) then
getglobal("PartyMemberFrame" .. i):Hide()
getglobal("PartyMemberFrame" .. i).Show = function () return end
@@ -27,7 +27,7 @@ pfUI:RegisterModule("group", function ()
pfUI.uf.group:SetScript("OnEvent", function()
PartyMemberBackground:Hide()
for i=1, 5 do
for i=1, 4 do
if pfUI_config.unitframes.group.hide_in_raid == "1" and UnitInRaid("player") then
pfUI.uf.group[i]:Hide()
return
@@ -75,7 +75,7 @@ pfUI:RegisterModule("group", function ()
end
end)
for i=1, 5 do
for i=1, 4 do
pfUI.uf.group[i] = CreateFrame("Button","pfGroup" .. i,UIParent)
pfUI.uf.group[i]:SetWidth(175)
+70 -3
View File
@@ -193,12 +193,79 @@ pfUI:RegisterModule("gui", function ()
end
frame.drag:SetScript("OnMouseDown",function()
frame:StartMoving()
end)
if IsShiftKeyDown() then
if strsub(frame:GetName(),0,6) == "pfRaid" then
for i=1,40 do
local cframe = getglobal("pfRaid" .. i)
cframe:StartMoving()
cframe:StopMovingOrSizing()
cframe.drag:SetBackdropBorderColor(1,1,1,1)
end
end
if strsub(frame:GetName(),0,7) == "pfGroup" then
for i=1,4 do
local cframe = getglobal("pfGroup" .. i)
cframe:StartMoving()
cframe:StopMovingOrSizing()
cframe.drag:SetBackdropBorderColor(1,1,1,1)
end
end
_, _, _, xpos, ypos = frame:GetPoint()
frame.oldPos = { xpos, ypos }
else
frame.oldPos = nil
end
frame.drag:SetBackdropBorderColor(1,1,1,1)
frame:StartMoving()
end)
frame.drag:SetScript("OnMouseUp",function()
frame:StopMovingOrSizing()
_, _, _, xpos, ypos = frame:GetPoint()
frame.drag:SetBackdropBorderColor(.2,1,.8,1)
if frame.oldPos then
local diffxpos = frame.oldPos[1] - xpos
local diffypos = frame.oldPos[2] - ypos
if strsub(frame:GetName(),0,6) == "pfRaid" then
for i=1,40 do
local cframe = getglobal("pfRaid" .. i)
cframe.drag:SetBackdropBorderColor(.2,1,.8,1)
if cframe:GetName() ~= frame:GetName() then
local _, _, _, xpos, ypos = cframe:GetPoint()
cframe:SetPoint("TOPLEFT", xpos - diffxpos, ypos - diffypos)
local _, _, _, xpos, ypos = cframe:GetPoint()
if not pfUI_config.position[cframe:GetName()] then
pfUI_config.position[cframe:GetName()] = {}
end
pfUI_config.position[cframe:GetName()]["xpos"] = xpos
pfUI_config.position[cframe:GetName()]["ypos"] = ypos
end
end
elseif strsub(frame:GetName(),0,7) == "pfGroup" then
for i=1,4 do
local cframe = getglobal("pfGroup" .. i)
cframe.drag:SetBackdropBorderColor(.2,1,.8,1)
if cframe:GetName() ~= frame:GetName() then
local _, _, _, xpos, ypos = cframe:GetPoint()
cframe:SetPoint("TOPLEFT", xpos - diffxpos, ypos - diffypos)
local _, _, _, xpos, ypos = cframe:GetPoint()
if not pfUI_config.position[cframe:GetName()] then
pfUI_config.position[cframe:GetName()] = {}
end
pfUI_config.position[cframe:GetName()]["xpos"] = xpos
pfUI_config.position[cframe:GetName()]["ypos"] = ypos
end
end
end
end
if not pfUI_config.position[frame:GetName()] then
pfUI_config.position[frame:GetName()] = {}
@@ -206,7 +273,7 @@ pfUI:RegisterModule("gui", function ()
pfUI_config.position[frame:GetName()]["xpos"] = xpos
pfUI_config.position[frame:GetName()]["ypos"] = ypos
end)
end)
if pfUI.gitter:IsShown() then
frame:SetMovable(true)