mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-28 00:44:45 +00:00
Ace gui tab and mover
This commit is contained in:
@@ -239,7 +239,7 @@ function E:CreateMoverPopup()
|
||||
desc:SetText(L["DESC_MOVERCONFIG"])
|
||||
|
||||
local snapping = CreateFrame("CheckButton", f:GetName().."CheckButton", f, "OptionsCheckButtonTemplate")
|
||||
_G[snapping:GetName() .. "Text"]:SetText(L["Sticky Frames"])
|
||||
_G[snapping:GetName().."Text"]:SetText(L["Sticky Frames"])
|
||||
|
||||
snapping:SetScript("OnShow", function()
|
||||
this:SetChecked(E.db.general.stickyFrames)
|
||||
@@ -250,7 +250,7 @@ function E:CreateMoverPopup()
|
||||
end)
|
||||
|
||||
local lock = CreateFrame("Button", f:GetName().."CloseButton", f, "OptionsButtonTemplate")
|
||||
_G[lock:GetName() .. "Text"]:SetText(L["Lock"])
|
||||
_G[lock:GetName().."Text"]:SetText(L["Lock"])
|
||||
|
||||
lock:SetScript("OnClick", function()
|
||||
E:ToggleConfigMode(true)
|
||||
@@ -269,7 +269,7 @@ function E:CreateMoverPopup()
|
||||
align:SetAutoFocus(false)
|
||||
align:SetScript("OnEscapePressed", function()
|
||||
this:SetText(E.db.gridSize)
|
||||
EditBox_ClearFocus(this)
|
||||
this:ClearFocus()
|
||||
end)
|
||||
align:SetScript("OnEnterPressed", function()
|
||||
local text = this:GetText()
|
||||
@@ -283,14 +283,14 @@ function E:CreateMoverPopup()
|
||||
this:SetText(E.db.gridSize)
|
||||
end
|
||||
E:Grid_Show()
|
||||
EditBox_ClearFocus(this)
|
||||
this:ClearFocus()
|
||||
end)
|
||||
align:SetScript("OnEditFocusLost", function()
|
||||
this:SetText(E.db.gridSize)
|
||||
end)
|
||||
align:SetScript("OnEditFocusGained", align.HighlightText)
|
||||
align:SetScript("OnShow", function()
|
||||
EditBox_ClearFocus(this)
|
||||
this:ClearFocus()
|
||||
this:SetText(E.db.gridSize)
|
||||
end)
|
||||
|
||||
@@ -356,7 +356,7 @@ function E:CreateMoverPopup()
|
||||
xOffset.currentValue = 0
|
||||
xOffset:SetScript("OnEscapePressed", function()
|
||||
this:SetText(E:Round(xOffset.currentValue))
|
||||
EditBox_ClearFocus(this)
|
||||
this:ClearFocus()
|
||||
end)
|
||||
xOffset:SetScript("OnEnterPressed", function()
|
||||
local num = this:GetText()
|
||||
@@ -366,14 +366,14 @@ function E:CreateMoverPopup()
|
||||
E:NudgeMover(diff)
|
||||
end
|
||||
this:SetText(E:Round(xOffset.currentValue))
|
||||
EditBox_ClearFocus(this)
|
||||
this:ClearFocus()
|
||||
end)
|
||||
xOffset:SetScript("OnEditFocusLost", function()
|
||||
this:SetText(E:Round(xOffset.currentValue))
|
||||
end)
|
||||
xOffset:SetScript("OnEditFocusGained", xOffset.HighlightText)
|
||||
xOffset:SetScript("OnShow", function()
|
||||
EditBox_ClearFocus(this)
|
||||
this:ClearFocus()
|
||||
this:SetText(E:Round(xOffset.currentValue))
|
||||
end)
|
||||
|
||||
@@ -391,7 +391,7 @@ function E:CreateMoverPopup()
|
||||
yOffset.currentValue = 0
|
||||
yOffset:SetScript("OnEscapePressed", function()
|
||||
this:SetText(E:Round(yOffset.currentValue))
|
||||
EditBox_ClearFocus(this)
|
||||
this:ClearFocus()
|
||||
end)
|
||||
yOffset:SetScript("OnEnterPressed", function()
|
||||
local num = this:GetText()
|
||||
@@ -401,14 +401,14 @@ function E:CreateMoverPopup()
|
||||
E:NudgeMover(nil, diff)
|
||||
end
|
||||
this:SetText(E:Round(yOffset.currentValue))
|
||||
EditBox_ClearFocus(this)
|
||||
this:ClearFocus()
|
||||
end)
|
||||
yOffset:SetScript("OnEditFocusLost", function()
|
||||
this:SetText(E:Round(yOffset.currentValue))
|
||||
end)
|
||||
yOffset:SetScript("OnEditFocusGained", yOffset.HighlightText)
|
||||
yOffset:SetScript("OnShow", function()
|
||||
EditBox_ClearFocus(this)
|
||||
this:ClearFocus()
|
||||
this:SetText(E:Round(yOffset.currentValue))
|
||||
end)
|
||||
|
||||
|
||||
@@ -24,19 +24,19 @@ local function GetPoint(obj)
|
||||
return format("%s,%s,%s,%d,%d", point, anchor:GetName(), secondaryPoint, E:Round(x), E:Round(y))
|
||||
end
|
||||
|
||||
local function UpdateCoords()
|
||||
local mover = this.child
|
||||
local x, y, _, nudgePoint, nudgeInversePoint = E:CalculateMoverPoints(mover)
|
||||
local function UpdateCoords(self)
|
||||
local mover = self.child;
|
||||
local x, y, _, nudgePoint, nudgeInversePoint = E:CalculateMoverPoints(mover);
|
||||
|
||||
local coordX, coordY = E:GetXYOffset(nudgeInversePoint, 1)
|
||||
ElvUIMoverNudgeWindow:ClearAllPoints()
|
||||
ElvUIMoverNudgeWindow:SetPoint(nudgePoint, mover, nudgeInversePoint, coordX, coordY)
|
||||
E:UpdateNudgeFrame(mover, x, y)
|
||||
local coordX, coordY = E:GetXYOffset(nudgeInversePoint, 1);
|
||||
ElvUIMoverNudgeWindow:ClearAllPoints();
|
||||
ElvUIMoverNudgeWindow:SetPoint(nudgePoint, mover, nudgeInversePoint, coordX, coordY);
|
||||
E:UpdateNudgeFrame(mover, x, y);
|
||||
end
|
||||
|
||||
local isDragging = false
|
||||
local coordFrame = CreateFrame("Frame")
|
||||
coordFrame:SetScript("OnUpdate", UpdateCoords)
|
||||
coordFrame:SetScript("OnUpdate", function() UpdateCoords(this) end)
|
||||
coordFrame:Hide()
|
||||
|
||||
local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, shouldDisable)
|
||||
@@ -164,7 +164,8 @@ local function CreateMover(parent, name, text, overlay, snapOffset, postdrag, sh
|
||||
ElvUIMoverNudgeWindow:Show()
|
||||
E.AssignFrameToNudge(this)
|
||||
coordFrame.child = this
|
||||
coordFrame:GetScript("OnUpdate")(coordFrame)
|
||||
UpdateCoords(coordFrame)
|
||||
--coordFrame:GetScript("OnUpdate")(coordFrame)
|
||||
end
|
||||
|
||||
local function OnMouseDown(button)
|
||||
@@ -332,7 +333,7 @@ function E:CreateMover(parent, name, text, overlay, snapoffset, postdrag, moverT
|
||||
E.CreatedMovers[name]["text"] = text
|
||||
E.CreatedMovers[name]["overlay"] = overlay
|
||||
E.CreatedMovers[name]["postdrag"] = postdrag
|
||||
E.CreatedMovers[name]["snapoffset"] = snapOffset
|
||||
E.CreatedMovers[name]["snapoffset"] = snapoffset
|
||||
E.CreatedMovers[name]["point"] = GetPoint(parent)
|
||||
E.CreatedMovers[name]["shouldDisable"] = shouldDisable
|
||||
|
||||
|
||||
@@ -23,10 +23,9 @@ local Callbacks = {["onplay"] = {}, ["onpause"] = {}, ["onresume"] = {}, ["onsto
|
||||
|
||||
-- Update all current animations
|
||||
local AnimationOnUpdate = function()
|
||||
local elapsed = arg1
|
||||
for i = 1, getn(this) do
|
||||
if this[i] then -- Double check the the index still exists, due to pauses/stops removing them on the fly
|
||||
this[i]:Update(elapsed, i)
|
||||
this[i]:Update(arg1, i)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ local ToggleDropDownMenu = ToggleDropDownMenu
|
||||
local Minimap_OnClick = Minimap_OnClick
|
||||
local GetMinimapZoneText = GetMinimapZoneText
|
||||
|
||||
local menuFrame = CreateFrame("Frame", "MinimapRightClickMenu", E.UIParent, "UIDropDownMenuTemplate")
|
||||
local menuFrame = CreateFrame("Frame", "MinimapRightClickMenu", E.UIParent, "L_UIDropDownMenuTemplate")
|
||||
local menuList = {
|
||||
{text = "CHARACTER_BUTTON",
|
||||
func = function() ToggleCharacter("PaperDollFrame") end},
|
||||
|
||||
@@ -321,7 +321,7 @@ function S:SkinAce3()
|
||||
if TYPE == "ScrollFrame" then
|
||||
local frame = widget.scrollbar
|
||||
SkinScrollBar(frame)
|
||||
elseif TYPE == "InlineGroup" or TYPE == "TreeGroup" or TYPE == "TabGroup" or TYPE == "Frame" or TYPE == "DropdownGroup" or TYPE == "Window" then
|
||||
elseif TYPE == "InlineGroup" or TYPE == "TreeGroup" or TYPE == "TabGroup-ElvUI" or TYPE == "Frame" or TYPE == "DropdownGroup" or TYPE == "Window" then
|
||||
local frame = widget.content:GetParent()
|
||||
if TYPE == "Frame" then
|
||||
E:StripTextures(frame)
|
||||
@@ -379,7 +379,7 @@ function S:SkinAce3()
|
||||
end
|
||||
end
|
||||
|
||||
if TYPE == "TabGroup" then
|
||||
if TYPE == "TabGroup-ElvUI" then
|
||||
local oldCreateTab = widget.CreateTab
|
||||
widget.CreateTab = function(self, id)
|
||||
local tab = oldCreateTab(self, id)
|
||||
|
||||
Reference in New Issue
Block a user