mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 16:34:45 +00:00
E:Point, E:Size, E:Width, E:Height, & cleanup
This commit is contained in:
@@ -73,8 +73,7 @@ function AB:PositionAndSizeBar(barName)
|
||||
|
||||
local barWidth = (size * (buttonsPerRow * widthMult)) + ((buttonSpacing * (buttonsPerRow - 1)) * widthMult) + (buttonSpacing * (widthMult-1)) + ((self.db[barName].backdrop and (E.Border + backdropSpacing) or E.Spacing)*2)
|
||||
local barHeight = (size * (numColumns * heightMult)) + ((buttonSpacing * (numColumns - 1)) * heightMult) + (buttonSpacing * (heightMult-1)) + ((self.db[barName].backdrop and (E.Border + backdropSpacing) or E.Spacing)*2)
|
||||
bar:SetWidth(barWidth)
|
||||
bar:SetHeight(barHeight)
|
||||
E:Size(bar, barWidth, barHeight)
|
||||
|
||||
bar.mouseover = self.db[barName].mouseover
|
||||
|
||||
@@ -107,8 +106,7 @@ function AB:PositionAndSizeBar(barName)
|
||||
|
||||
button:SetParent(bar)
|
||||
|
||||
button:SetWidth(size)
|
||||
button:SetHeight(size)
|
||||
E:Size(button, size)
|
||||
ActionButton_ShowGrid(button)
|
||||
|
||||
if i == 1 then
|
||||
@@ -121,7 +119,7 @@ function AB:PositionAndSizeBar(barName)
|
||||
else
|
||||
x, y = -firstButtonSpacing, firstButtonSpacing
|
||||
end
|
||||
button:SetPoint(point, bar, point, x, y)
|
||||
E:Point(button, point, bar, point, x, y)
|
||||
elseif mod((i - 1), buttonsPerRow) == 0 then
|
||||
x = 0
|
||||
y = -buttonSpacing
|
||||
@@ -131,7 +129,7 @@ function AB:PositionAndSizeBar(barName)
|
||||
buttonPoint = "BOTTOM"
|
||||
anchorPoint = "TOP"
|
||||
end
|
||||
button:SetPoint(buttonPoint, lastColumnButton, anchorPoint, x, y)
|
||||
E:Point(button, buttonPoint, lastColumnButton, anchorPoint, x, y)
|
||||
else
|
||||
x = buttonSpacing
|
||||
y = 0
|
||||
@@ -141,7 +139,7 @@ function AB:PositionAndSizeBar(barName)
|
||||
buttonPoint = "RIGHT"
|
||||
anchorPoint = "LEFT"
|
||||
end
|
||||
button:SetPoint(buttonPoint, lastButton, anchorPoint, x, y)
|
||||
E:Point(button, buttonPoint, lastButton, anchorPoint, x, y)
|
||||
end
|
||||
|
||||
if i > numButtons then
|
||||
@@ -181,13 +179,13 @@ end
|
||||
function AB:CreateBar(id)
|
||||
local bar = CreateFrame("Button", "ElvUI_Bar"..id, E.UIParent)
|
||||
local point, anchor, attachTo, x, y = split(",", self["barDefaults"]["bar"..id].position)
|
||||
bar:SetPoint(point, anchor, attachTo, x, y)
|
||||
E:Point(bar, point, anchor, attachTo, x, y)
|
||||
bar.id = id
|
||||
E:CreateBackdrop(bar, "Default")
|
||||
bar:SetFrameStrata("LOW")
|
||||
local offset = E.Spacing
|
||||
bar.backdrop:SetPoint("TOPLEFT", bar, "TOPLEFT", offset, -offset)
|
||||
bar.backdrop:SetPoint("BOTTOMRIGHT", bar, "BOTTOMRIGHT", -offset, offset)
|
||||
E:Point(bar.backdrop, "TOPLEFT", bar, "TOPLEFT", offset, -offset)
|
||||
E:Point(bar.backdrop, "BOTTOMRIGHT", bar, "BOTTOMRIGHT", -offset, offset)
|
||||
bar.buttons = {}
|
||||
self:HookScript(bar, "OnEnter", "Bar_OnEnter")
|
||||
self:HookScript(bar, "OnLeave", "Bar_OnLeave")
|
||||
@@ -289,7 +287,7 @@ function AB:StyleButton(button, noBackdrop)
|
||||
|
||||
if count then
|
||||
count:ClearAllPoints()
|
||||
count:SetPoint("BOTTOMRIGHT", 0, 2)
|
||||
E:Point(count, "BOTTOMRIGHT", 0, 2)
|
||||
E:FontTemplate(count, LSM:Fetch("font", self.db.font), self.db.fontSize, self.db.fontOutline)
|
||||
count:SetTextColor(color.r, color.g, color.b)
|
||||
end
|
||||
@@ -440,7 +438,7 @@ function AB:FixKeybindText(button)
|
||||
end
|
||||
|
||||
hotkey:ClearAllPoints()
|
||||
hotkey:SetPoint("TOPRIGHT", 0, -3)
|
||||
E:Point(hotkey, "TOPRIGHT", 0, -3)
|
||||
end
|
||||
|
||||
function AB:ActionButton_Update()
|
||||
|
||||
@@ -121,11 +121,9 @@ function AB:PositionAndSizeBarPet()
|
||||
|
||||
local barWidth = (size * (buttonsPerRow * widthMult)) + ((buttonSpacing * (buttonsPerRow - 1)) * widthMult) + (buttonSpacing * (widthMult-1)) + (backdropSpacing*2) + ((self.db["barPet"].backdrop and E.Border or E.Spacing)*2)
|
||||
local barHeight = (size * (numColumns * heightMult)) + ((buttonSpacing * (numColumns - 1)) * heightMult) + (buttonSpacing * (heightMult-1)) + (backdropSpacing*2) + ((self.db["barPet"].backdrop and E.Border or E.Spacing)*2)
|
||||
bar:SetWidth(barWidth)
|
||||
bar:SetHeight(barHeight)
|
||||
E:Size(bar, barWidth, barHeight)
|
||||
|
||||
bar.mover:SetWidth(bar:GetWidth())
|
||||
bar.mover:SetHeight(bar:GetHeight())
|
||||
E:Size(bar.mover, bar:GetWidth(), bar:GetHeight())
|
||||
|
||||
if self.db["barPet"].enabled then
|
||||
bar:SetScale(1)
|
||||
@@ -171,8 +169,7 @@ function AB:PositionAndSizeBarPet()
|
||||
lastColumnButton = _G["PetActionButton"..i - buttonsPerRow]
|
||||
button:SetParent(bar)
|
||||
button:ClearAllPoints()
|
||||
button:SetWidth(size)
|
||||
button:SetHeight(size)
|
||||
E:Size(button, size)
|
||||
button:Show()
|
||||
|
||||
if i == 1 then
|
||||
@@ -187,7 +184,7 @@ function AB:PositionAndSizeBarPet()
|
||||
x, y = -firstButtonSpacing, firstButtonSpacing
|
||||
end
|
||||
|
||||
button:SetPoint(point, bar, point, x, y)
|
||||
E:Point(button, point, bar, point, x, y)
|
||||
elseif mod((i - 1), buttonsPerRow) == 0 then
|
||||
local x = 0
|
||||
local y = -buttonSpacing
|
||||
@@ -197,7 +194,7 @@ function AB:PositionAndSizeBarPet()
|
||||
buttonPoint = "BOTTOM"
|
||||
anchorPoint = "TOP"
|
||||
end
|
||||
button:SetPoint(buttonPoint, lastColumnButton, anchorPoint, x, y)
|
||||
E:Point(button, buttonPoint, lastColumnButton, anchorPoint, x, y)
|
||||
else
|
||||
local x = buttonSpacing
|
||||
local y = 0
|
||||
@@ -208,7 +205,7 @@ function AB:PositionAndSizeBarPet()
|
||||
anchorPoint = "LEFT"
|
||||
end
|
||||
|
||||
button:SetPoint(buttonPoint, lastButton, anchorPoint, x, y)
|
||||
E:Point(button, buttonPoint, lastButton, anchorPoint, x, y)
|
||||
end
|
||||
|
||||
if i > numButtons then
|
||||
@@ -242,9 +239,9 @@ function AB:CreateBarPet()
|
||||
E:CreateBackdrop(bar, "Default")
|
||||
bar.backdrop:SetAllPoints()
|
||||
if self.db["bar4"].enabled then
|
||||
bar:SetPoint("RIGHT", ElvUI_Bar4, "LEFT", -4, 0)
|
||||
E:Point(bar, "RIGHT", ElvUI_Bar4, "LEFT", -4, 0)
|
||||
else
|
||||
bar:SetPoint("RIGHT", E.UIParent, "RIGHT", -4, 0)
|
||||
E:Point(bar, "RIGHT", E.UIParent, "RIGHT", -4, 0)
|
||||
end
|
||||
|
||||
PetActionBarFrame.showgrid = 1
|
||||
|
||||
@@ -141,14 +141,13 @@ function AB:PositionAndSizeBarShapeShift()
|
||||
|
||||
local barWidth = (size * (buttonsPerRow * widthMult)) + ((buttonSpacing * (buttonsPerRow - 1)) * widthMult) + (buttonSpacing * (widthMult-1)) + ((self.db["barShapeShift"].backdrop == true and (E.Border + backdropSpacing) or E.Spacing)*2)
|
||||
local barHeight = (size * (numColumns * heightMult)) + ((buttonSpacing * (numColumns - 1)) * heightMult) + (buttonSpacing * (heightMult-1)) + ((self.db["barShapeShift"].backdrop == true and (E.Border + backdropSpacing) or E.Spacing)*2)
|
||||
bar:SetWidth(barWidth)
|
||||
bar:SetHeight(barHeight)
|
||||
E:Size(bar, barWidth, barHeight)
|
||||
|
||||
if self.db["barShapeShift"].enabled then
|
||||
bar:SetScale(1)
|
||||
bar:SetAlpha(bar.db.alpha)
|
||||
E:EnableMover(bar.mover:GetName())
|
||||
bar:SetPoint("CENTER", 0, 0)
|
||||
E:Point(bar, "CENTER", 0, 0)
|
||||
else
|
||||
bar:SetScale(0.0001)
|
||||
bar:SetAlpha(0)
|
||||
@@ -182,8 +181,7 @@ function AB:PositionAndSizeBarShapeShift()
|
||||
lastColumnButton = _G["ElvUI_StanceBarButton"..i-buttonsPerRow]
|
||||
button:SetParent(bar)
|
||||
button:ClearAllPoints()
|
||||
button:SetWidth(size)
|
||||
button:SetHeight(size)
|
||||
E:Size(button, size)
|
||||
|
||||
if self.db["barShapeShift"].mouseover == true then
|
||||
bar:SetAlpha(0)
|
||||
@@ -203,7 +201,7 @@ function AB:PositionAndSizeBarShapeShift()
|
||||
x, y = -firstButtonSpacing, firstButtonSpacing
|
||||
end
|
||||
|
||||
button:SetPoint(point, bar, point, x, y)
|
||||
E:Point(button, point, bar, point, x, y)
|
||||
elseif mod((i - 1), buttonsPerRow) == 0 then
|
||||
local x = 0
|
||||
local y = -buttonSpacing
|
||||
@@ -213,7 +211,7 @@ function AB:PositionAndSizeBarShapeShift()
|
||||
buttonPoint = "BOTTOM"
|
||||
anchorPoint = "TOP"
|
||||
end
|
||||
button:SetPoint(buttonPoint, lastColumnButton, anchorPoint, x, y)
|
||||
E:Point(button, buttonPoint, lastColumnButton, anchorPoint, x, y)
|
||||
else
|
||||
local x = buttonSpacing
|
||||
local y = 0
|
||||
@@ -224,7 +222,7 @@ function AB:PositionAndSizeBarShapeShift()
|
||||
anchorPoint = "LEFT"
|
||||
end
|
||||
|
||||
button:SetPoint(buttonPoint, lastButton, anchorPoint, x, y)
|
||||
E:Point(button, buttonPoint, lastButton, anchorPoint, x, y)
|
||||
end
|
||||
|
||||
if i > numButtons then
|
||||
@@ -289,7 +287,7 @@ end
|
||||
function AB:CreateBarShapeShift()
|
||||
E:CreateBackdrop(bar, "Default")
|
||||
bar.backdrop:SetAllPoints()
|
||||
bar:SetPoint("TOPLEFT", E.UIParent, "TOPLEFT", 4, -4)
|
||||
E:Point(bar, "TOPLEFT", E.UIParent, "TOPLEFT", 4, -4)
|
||||
bar.buttons = {}
|
||||
|
||||
self:HookScript(bar, "OnEnter", "Bar_OnEnter")
|
||||
|
||||
@@ -119,7 +119,7 @@ function AB:BindUpdate(button, spellmacro)
|
||||
bind.button.name = GetMacroInfo(bind.button.id)
|
||||
|
||||
GameTooltip:SetOwner(bind, "ANCHOR_TOP")
|
||||
GameTooltip:SetPoint("BOTTOM", bind, "TOP", 0, 1)
|
||||
E:Point(GameTooltip, "BOTTOM", bind, "TOP", 0, 1)
|
||||
GameTooltip:AddLine(bind.button.name, 1, 1, 1)
|
||||
|
||||
bind.button.bindings = {GetBindingKey(spellmacro.." "..bind.button.name)}
|
||||
@@ -148,7 +148,7 @@ function AB:BindUpdate(button, spellmacro)
|
||||
GameTooltip:Show()
|
||||
GameTooltip:SetScript("OnHide", function()
|
||||
this:SetOwner(bind, "ANCHOR_NONE")
|
||||
this:SetPoint("BOTTOM", bind, "TOP", 0, 1)
|
||||
E:Point(this, "BOTTOM", bind, "TOP", 0, 1)
|
||||
this:AddLine(bind.button.name, 1, 1, 1)
|
||||
bind.button.bindings = {GetBindingKey(bind.button.bindstring)}
|
||||
if getn(bind.button.bindings) == 0 then
|
||||
@@ -180,7 +180,7 @@ function AB:BindUpdate(button, spellmacro)
|
||||
GameTooltip:Show()
|
||||
GameTooltip:SetScript("OnHide", function()
|
||||
this:SetOwner(bind, "ANCHOR_TOP")
|
||||
this:SetPoint("BOTTOM", bind, "TOP", 0, 4)
|
||||
E:Point(this, "BOTTOM", bind, "TOP", 0, 4)
|
||||
this:AddLine(bind.button.name, 1, 1, 1)
|
||||
bind.button.bindings = {GetBindingKey(bind.button.bindstring)}
|
||||
if getn(bind.button.bindings) == 0 then
|
||||
@@ -281,16 +281,14 @@ function AB:LoadKeyBinder()
|
||||
f:SetMovable(true)
|
||||
f:SetFrameLevel(99)
|
||||
f:SetClampedToScreen(true)
|
||||
f:SetWidth(360)
|
||||
f:SetHeight(130)
|
||||
E:Size(f, 360, 130)
|
||||
E:SetTemplate(f, "Transparent")
|
||||
f:Hide()
|
||||
|
||||
local header = CreateFrame("Button", nil, f)
|
||||
E:SetTemplate(header, "Default", true)
|
||||
header:SetWidth(100)
|
||||
header:SetHeight(25)
|
||||
header:SetPoint("CENTER", f, "TOP")
|
||||
E:Size(header, 100, 25)
|
||||
E:Point(header, "CENTER", f, "TOP")
|
||||
header:SetFrameLevel(header:GetFrameLevel() + 2)
|
||||
header:EnableMouse(true)
|
||||
header:RegisterForClicks("AnyUp", "AnyDown")
|
||||
@@ -299,15 +297,15 @@ function AB:LoadKeyBinder()
|
||||
|
||||
local title = header:CreateFontString("OVERLAY")
|
||||
E:FontTemplate(title)
|
||||
title:SetPoint("CENTER", header, "CENTER")
|
||||
E:Point(title, "CENTER", header, "CENTER")
|
||||
title:SetText("Key Binds")
|
||||
|
||||
local desc = f:CreateFontString("ARTWORK")
|
||||
desc:SetFontObject("GameFontHighlight")
|
||||
desc:SetJustifyV("TOP")
|
||||
desc:SetJustifyH("LEFT")
|
||||
desc:SetPoint("TOPLEFT", 18, -32)
|
||||
desc:SetPoint("BOTTOMRIGHT", -18, 48)
|
||||
E:Point(desc, "TOPLEFT", 18, -32)
|
||||
E:Point(desc, "BOTTOMRIGHT", -18, 48)
|
||||
desc:SetText(L["Hover your mouse over any actionbutton or spellbook button to bind it. Press the escape key or right click to clear the current actionbutton's keybinding."])
|
||||
|
||||
local perCharCheck = CreateFrame("CheckButton", f:GetName().."CheckButton", f, "OptionsCheckButtonTemplate")
|
||||
@@ -334,13 +332,13 @@ function AB:LoadKeyBinder()
|
||||
|
||||
local save = CreateFrame("Button", f:GetName().."SaveButton", f, "OptionsButtonTemplate")
|
||||
_G[save:GetName() .. "Text"]:SetText(L["Save"])
|
||||
save:SetWidth(150)
|
||||
E:Width(save, 150)
|
||||
save:SetScript("OnClick", function()
|
||||
AB:DeactivateBindMode(true)
|
||||
end)
|
||||
|
||||
local discard = CreateFrame("Button", f:GetName().."DiscardButton", f, "OptionsButtonTemplate")
|
||||
discard:SetWidth(150)
|
||||
E:Width(discard, 150)
|
||||
_G[discard:GetName() .. "Text"]:SetText(L["Discard"])
|
||||
|
||||
discard:SetScript("OnClick", function()
|
||||
@@ -348,9 +346,9 @@ function AB:LoadKeyBinder()
|
||||
end)
|
||||
|
||||
--position buttons
|
||||
perCharCheck:SetPoint("BOTTOMLEFT", discard, "TOPLEFT", 0, 2)
|
||||
save:SetPoint("BOTTOMRIGHT", -14, 10)
|
||||
discard:SetPoint("BOTTOMLEFT", 14, 10)
|
||||
E:Point(perCharCheck, "BOTTOMLEFT", discard, "TOPLEFT", 0, 2)
|
||||
E:Point(save, "BOTTOMRIGHT", -14, 10)
|
||||
E:Point(discard, "BOTTOMLEFT", 14, 10)
|
||||
|
||||
local S = E:GetModule("Skins")
|
||||
S:HandleCheckBox(perCharCheck)
|
||||
|
||||
@@ -50,8 +50,8 @@ function AB:HandleMicroButton(button)
|
||||
|
||||
local f = CreateFrame("Frame", nil, button)
|
||||
f:SetFrameLevel(1)
|
||||
f:SetPoint("BOTTOMLEFT", button, "BOTTOMLEFT", 2, 0)
|
||||
f:SetPoint("TOPRIGHT", button, "TOPRIGHT", -2, -28)
|
||||
E:Point(f, "BOTTOMLEFT", button, "BOTTOMLEFT", 2, 0)
|
||||
E:Point(f, "TOPRIGHT", button, "TOPRIGHT", -2, -28)
|
||||
E:SetTemplate(f, "Default", true)
|
||||
button.backdrop = f
|
||||
|
||||
@@ -80,12 +80,12 @@ function AB:UpdateMicroPositionDimensions()
|
||||
button:ClearAllPoints()
|
||||
|
||||
if prevButton == microBar then
|
||||
button:SetPoint("TOPLEFT", prevButton, "TOPLEFT", -2 + E.Border, 28 - E.Border)
|
||||
E:Point(button, "TOPLEFT", prevButton, "TOPLEFT", -2 + E.Border, 28 - E.Border)
|
||||
elseif mod((i - 1), self.db.microbar.buttonsPerRow) == 0 then
|
||||
button:SetPoint("TOP", lastColumnButton, "BOTTOM", 0, 28 - self.db.microbar.yOffset)
|
||||
E:Point(button, "TOP", lastColumnButton, "BOTTOM", 0, 28 - self.db.microbar.yOffset)
|
||||
numRows = numRows + 1
|
||||
else
|
||||
button:SetPoint("LEFT", prevButton, "RIGHT", - 4 + self.db.microbar.xOffset, 0)
|
||||
E:Point(button, "LEFT", prevButton, "RIGHT", - 4 + self.db.microbar.xOffset, 0)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -95,8 +95,7 @@ function AB:UpdateMicroPositionDimensions()
|
||||
microBar:SetAlpha(self.db.microbar.alpha)
|
||||
end
|
||||
|
||||
microBar:SetWidth(((CharacterMicroButton:GetWidth() - 4) * self.db.microbar.buttonsPerRow) + (self.db.microbar.xOffset * (self.db.microbar.buttonsPerRow - 1)) + E.Border * 2)
|
||||
microBar:SetHeight(((CharacterMicroButton:GetHeight() - 28) * numRows) + (self.db.microbar.yOffset * (numRows - 1)) + E.Border * 2)
|
||||
E:Size(microBar, ((CharacterMicroButton:GetWidth() - 4) * self.db.microbar.buttonsPerRow) + (self.db.microbar.xOffset * (self.db.microbar.buttonsPerRow - 1)) + E.Border * 2, ((CharacterMicroButton:GetHeight() - 28) * numRows) + (self.db.microbar.yOffset * (numRows - 1)) + E.Border * 2)
|
||||
|
||||
if self.db.microbar.enabled then
|
||||
microBar:Show()
|
||||
@@ -112,7 +111,7 @@ function AB:UpdateMicroPositionDimensions()
|
||||
end
|
||||
|
||||
function AB:SetupMicroBar()
|
||||
microBar:SetPoint("TOPLEFT", 4, -48)
|
||||
E:Point(microBar, "TOPLEFT", 4, -48)
|
||||
|
||||
for i = 1, getn(MICRO_BUTTONS) do
|
||||
self:HandleMicroButton(_G[MICRO_BUTTONS[i]])
|
||||
|
||||
Reference in New Issue
Block a user