E:Point, E:Size, E:Width, E:Height, & cleanup

This commit is contained in:
Crum
2018-05-16 23:20:04 -05:00
parent eac6a04517
commit d52da42f77
65 changed files with 958 additions and 1102 deletions
+14 -16
View File
@@ -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)