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