mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
movers
This commit is contained in:
@@ -30,7 +30,7 @@ E.ConfigModeLocalizedStrings = {
|
|||||||
SOLO = SOLO,
|
SOLO = SOLO,
|
||||||
PARTY = PARTY,
|
PARTY = PARTY,
|
||||||
RAID = RAID,
|
RAID = RAID,
|
||||||
ACTIONBARS = ACTIONBARS_LABEL
|
ACTIONBARS = ACTIONBAR_LABEL
|
||||||
}
|
}
|
||||||
|
|
||||||
function E:Grid_Show()
|
function E:Grid_Show()
|
||||||
@@ -148,7 +148,7 @@ local function ConfigMode_OnClick()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function ConfigMode_Initialize()
|
local function ConfigMode_Initialize()
|
||||||
local info = UIDropDownMenu_CreateInfo()
|
local info = {}
|
||||||
info.func = ConfigMode_OnClick
|
info.func = ConfigMode_OnClick
|
||||||
|
|
||||||
for _, configMode in ipairs(E.ConfigModeLayouts) do
|
for _, configMode in ipairs(E.ConfigModeLayouts) do
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ local CreateFrame = CreateFrame
|
|||||||
E.CreatedMovers = {}
|
E.CreatedMovers = {}
|
||||||
E.DisabledMovers = {}
|
E.DisabledMovers = {}
|
||||||
|
|
||||||
local function SizeChanged()
|
local function SizeChanged(self)
|
||||||
this.mover:SetWidth(this.dirtyWidth and this.dirtyWidth or this:GetWidth())
|
self.mover:SetWidth(self.dirtyWidth and self.dirtyWidth or self:GetWidth())
|
||||||
this.mover:SetHeight(this.dirtyHeight and this.dirtyHeight or this:GetHeight())
|
self.mover:SetHeight(self.dirtyHeight and self.dirtyHeight or self:GetHeight())
|
||||||
end
|
end
|
||||||
|
|
||||||
local function GetPoint(obj)
|
local function GetPoint(obj)
|
||||||
@@ -106,56 +106,56 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh
|
|||||||
f:SetPoint(point, anchor, secondaryPoint, x, y)
|
f:SetPoint(point, anchor, secondaryPoint, x, y)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function OnDragStart()
|
local function OnDragStart(self)
|
||||||
if E.db["general"].stickyFrames then
|
if E.db["general"].stickyFrames then
|
||||||
Sticky:StartMoving(this, E["snapBars"], f.snapOffset, f.snapOffset, f.snapOffset, f.snapOffset)
|
Sticky:StartMoving(self, E["snapBars"], f.snapOffset, f.snapOffset, f.snapOffset, f.snapOffset)
|
||||||
else
|
else
|
||||||
this:StartMoving()
|
self:StartMoving()
|
||||||
end
|
end
|
||||||
coordFrame.child = this
|
coordFrame.child = self
|
||||||
coordFrame:Show()
|
coordFrame:Show()
|
||||||
isDragging = true
|
isDragging = true
|
||||||
end
|
end
|
||||||
|
|
||||||
local function OnDragStop()
|
local function OnDragStop(self)
|
||||||
isDragging = false
|
isDragging = false
|
||||||
if E.db["general"].stickyFrames then
|
if E.db["general"].stickyFrames then
|
||||||
Sticky:StopMoving(this)
|
Sticky:StopMoving(self)
|
||||||
else
|
else
|
||||||
this:StopMovingOrSizing()
|
self:StopMovingOrSizing()
|
||||||
end
|
end
|
||||||
|
|
||||||
local x, y, point = E:CalculateMoverPoints(this)
|
local x, y, point = E:CalculateMoverPoints(self)
|
||||||
this:ClearAllPoints()
|
self:ClearAllPoints()
|
||||||
local overridePoint
|
local overridePoint
|
||||||
if(this.positionOverride) then
|
if(self.positionOverride) then
|
||||||
if(this.positionOverride == "BOTTOM" or this.positionOverride == "TOP") then
|
if(self.positionOverride == "BOTTOM" or self.positionOverride == "TOP") then
|
||||||
overridePoint = "BOTTOM"
|
overridePoint = "BOTTOM"
|
||||||
else
|
else
|
||||||
overridePoint = "BOTTOMLEFT"
|
overridePoint = "BOTTOMLEFT"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
this:SetPoint(this.positionOverride or point, E.UIParent, overridePoint and overridePoint or point, x, y)
|
self:SetPoint(self.positionOverride or point, E.UIParent, overridePoint and overridePoint or point, x, y)
|
||||||
if(this.positionOverride) then
|
if(self.positionOverride) then
|
||||||
this.parent:ClearAllPoints()
|
self.parent:ClearAllPoints()
|
||||||
this.parent:SetPoint(this.positionOverride, this, this.positionOverride)
|
self.parent:SetPoint(self.positionOverride, self, self.positionOverride)
|
||||||
end
|
end
|
||||||
|
|
||||||
E:SaveMoverPosition(name)
|
E:SaveMoverPosition(name)
|
||||||
|
|
||||||
if ElvUIMoverNudgeWindow then
|
if ElvUIMoverNudgeWindow then
|
||||||
E:UpdateNudgeFrame(this, x, y)
|
E:UpdateNudgeFrame(self, x, y)
|
||||||
end
|
end
|
||||||
|
|
||||||
coordFrame.child = nil
|
coordFrame.child = nil
|
||||||
coordFrame:Hide()
|
coordFrame:Hide()
|
||||||
|
|
||||||
if postdrag ~= nil and type(postdrag) == "function" then
|
if postdrag ~= nil and type(postdrag) == "function" then
|
||||||
postdrag(this, E:GetScreenQuadrant(this))
|
postdrag(self, E:GetScreenQuadrant(self))
|
||||||
end
|
end
|
||||||
|
|
||||||
this:SetUserPlaced(false)
|
self:SetUserPlaced(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function OnEnter()
|
local function OnEnter()
|
||||||
@@ -201,16 +201,16 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
f:SetScript("OnDragStart", OnDragStart)
|
f:SetScript("OnDragStart", function() OnDragStart(f) end)
|
||||||
f:SetScript("OnMouseUp", E.AssignFrameToNudge)
|
f:SetScript("OnMouseUp", E.AssignFrameToNudge)
|
||||||
f:SetScript("OnDragStop", OnDragStop)
|
f:SetScript("OnDragStop", function() OnDragStop(f) end)
|
||||||
f:SetScript("OnEnter", OnEnter)
|
f:SetScript("OnEnter", OnEnter)
|
||||||
f:SetScript("OnMouseDown", OnMouseDown)
|
f:SetScript("OnMouseDown", OnMouseDown)
|
||||||
f:SetScript("OnLeave", OnLeave)
|
f:SetScript("OnLeave", OnLeave)
|
||||||
f:SetScript("OnShow", OnShow)
|
f:SetScript("OnShow", OnShow)
|
||||||
f:SetScript("OnMouseWheel", OnMouseWheel)
|
f:SetScript("OnMouseWheel", OnMouseWheel)
|
||||||
|
|
||||||
parent:SetScript("OnSizeChanged", SizeChanged)
|
parent:SetScript("OnSizeChanged", function() SizeChanged(parent) end)
|
||||||
parent.mover = f
|
parent.mover = f
|
||||||
|
|
||||||
parent:ClearAllPoints()
|
parent:ClearAllPoints()
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ function UF:Update_RaidFrames(frame, db)
|
|||||||
|
|
||||||
frame.Portrait = frame.Portrait or (db.portrait.style == "2D" and frame.Portrait2D or frame.Portrait3D)
|
frame.Portrait = frame.Portrait or (db.portrait.style == "2D" and frame.Portrait2D or frame.Portrait3D)
|
||||||
frame.colors = ElvUF.colors
|
frame.colors = ElvUF.colors
|
||||||
--frame:RegisterForClicks(self.db.targetOnMouseDown and "AnyDown" or "AnyUp")
|
frame:RegisterForClicks(self.db.targetOnMouseDown and "LeftButtonDown" or "LeftButtonUp", self.db.targetOnMouseDown and "RightButtonDown" or "RightButtonUp")
|
||||||
|
|
||||||
do
|
do
|
||||||
if self.thinBorders then
|
if self.thinBorders then
|
||||||
|
|||||||
@@ -573,8 +573,8 @@ function UF.groupPrototype:Configure_Groups(self)
|
|||||||
|
|
||||||
if self.mover then
|
if self.mover then
|
||||||
self.mover.positionOverride = DIRECTION_TO_GROUP_ANCHOR_POINT[direction]
|
self.mover.positionOverride = DIRECTION_TO_GROUP_ANCHOR_POINT[direction]
|
||||||
--E:UpdatePositionOverride(self.mover:GetName())
|
E:UpdatePositionOverride(self.mover:GetName())
|
||||||
--self:GetScript("OnSizeChanged")(self) --Mover size is not updated if frame is hidden, so call an update manually
|
self:GetScript("OnSizeChanged")(self) --Mover size is not updated if frame is hidden, so call an update manually
|
||||||
end
|
end
|
||||||
|
|
||||||
self:SetWidth(width - db.horizontalSpacing)
|
self:SetWidth(width - db.horizontalSpacing)
|
||||||
@@ -600,7 +600,7 @@ function UF.groupPrototype:AdjustVisibility(self)
|
|||||||
group:Show()
|
group:Show()
|
||||||
else
|
else
|
||||||
if group.forceShow then
|
if group.forceShow then
|
||||||
--group:Hide()
|
group:Hide()
|
||||||
UF:UnshowChildUnits(group, group:GetChildren())
|
UF:UnshowChildUnits(group, group:GetChildren())
|
||||||
group:SetAttribute("startingIndex", 1)
|
group:SetAttribute("startingIndex", 1)
|
||||||
else
|
else
|
||||||
@@ -647,7 +647,7 @@ function UF.headerPrototype:Update(isForced)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function UF.headerPrototype:Reset()
|
function UF.headerPrototype:Reset()
|
||||||
--self:Hide()
|
self:Hide()
|
||||||
|
|
||||||
self:SetAttribute("showPlayer", true)
|
self:SetAttribute("showPlayer", true)
|
||||||
|
|
||||||
@@ -767,13 +767,13 @@ function UF:CreateAndUpdateHeaderGroup(group, groupFilter, template, headerUpdat
|
|||||||
UF["headerFunctions"][group]:Update(self[group])
|
UF["headerFunctions"][group]:Update(self[group])
|
||||||
end
|
end
|
||||||
|
|
||||||
if(db.enable) then
|
if db.enable then
|
||||||
if self[group].mover then
|
if self[group].mover then
|
||||||
E:EnableMover(self[group].mover:GetName())
|
E:EnableMover(self[group].mover:GetName())
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- UnregisterStateDriver(self[group], "visibility")
|
-- UnregisterStateDriver(self[group], "visibility")
|
||||||
-- self[group]:Hide()
|
self[group]:Hide()
|
||||||
if self[group].mover then
|
if self[group].mover then
|
||||||
E:DisableMover(self[group].mover:GetName())
|
E:DisableMover(self[group].mover:GetName())
|
||||||
end
|
end
|
||||||
@@ -902,9 +902,11 @@ function UF:UpdateAllHeaders(event)
|
|||||||
shouldUpdateHeader = true
|
shouldUpdateHeader = true
|
||||||
end
|
end
|
||||||
self:CreateAndUpdateHeaderGroup(group, nil, nil, shouldUpdateHeader)
|
self:CreateAndUpdateHeaderGroup(group, nil, nil, shouldUpdateHeader)
|
||||||
|
|
||||||
header:Hide()
|
header:Hide()
|
||||||
header:Show()
|
header:Show()
|
||||||
if group == "party" or group == "raid" or group == "raid40" then
|
|
||||||
|
if group == "party" or group == "raid" then
|
||||||
--Update BuffIndicators on profile change as they might be using profile specific data
|
--Update BuffIndicators on profile change as they might be using profile specific data
|
||||||
--self:UpdateAuraWatchFromHeader(group)
|
--self:UpdateAuraWatchFromHeader(group)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user