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:
@@ -93,8 +93,7 @@ local function ResetAll()
|
||||
f.Desc2:SetText("")
|
||||
f.Desc3:SetText("")
|
||||
f.Desc4:SetText("")
|
||||
f:SetWidth(550)
|
||||
f:SetHeight(400)
|
||||
E:Size(f, 550, 400)
|
||||
if f.StepTitles then
|
||||
for i = 1, getn(f.side.Lines) do f.side.Lines[i].text:SetText("") end
|
||||
end
|
||||
@@ -155,9 +154,8 @@ end
|
||||
|
||||
function PI:CreateStepComplete()
|
||||
local imsg = CreateFrame("Frame", "PluginInstallStepComplete", E.UIParent)
|
||||
imsg:SetWidth(418)
|
||||
imsg:SetHeight(72)
|
||||
imsg:SetPoint("TOP", 0, -190)
|
||||
E:Size(imsg, 418, 72)
|
||||
E:Point(imsg, "TOP", 0, -190)
|
||||
imsg:Hide()
|
||||
imsg:SetScript("OnShow", function(self)
|
||||
if self.message then
|
||||
@@ -175,31 +173,28 @@ function PI:CreateStepComplete()
|
||||
|
||||
imsg.bg = imsg:CreateTexture(nil, "BACKGROUND")
|
||||
imsg.bg:SetTexture([[Interface\LevelUp\LevelUpTex]])
|
||||
imsg.bg:SetPoint("BOTTOM", 0, 0)
|
||||
imsg.bg:SetWidth(326)
|
||||
imsg.bg:SetHeight(103)
|
||||
E:Point(imsg.bg, "BOTTOM", 0, 0)
|
||||
E:Size(imsg.bg, 326, 103)
|
||||
imsg.bg:SetTexCoord(0.00195313, 0.63867188, 0.03710938, 0.23828125)
|
||||
imsg.bg:SetVertexColor(1, 1, 1, 0.6)
|
||||
|
||||
imsg.lineTop = imsg:CreateTexture(nil, "BACKGROUND")
|
||||
imsg.lineTop:SetDrawLayer("BACKGROUND", 2)
|
||||
imsg.lineTop:SetTexture([[Interface\LevelUp\LevelUpTex]])
|
||||
imsg.lineTop:SetPoint("TOP", 0, 0)
|
||||
imsg.lineTop:SetWidth(418)
|
||||
imsg.lineTop:SetHeight(7)
|
||||
E:Point(imsg.lineTop, "TOP", 0, 0)
|
||||
E:Size(imsg.lineTop, 418, 7)
|
||||
imsg.lineTop:SetTexCoord(0.00195313, 0.81835938, 0.01953125, 0.03320313)
|
||||
|
||||
imsg.lineBottom = imsg:CreateTexture(nil, "BACKGROUND")
|
||||
imsg.lineBottom:SetDrawLayer("BACKGROUND", 2)
|
||||
imsg.lineBottom:SetTexture([[Interface\LevelUp\LevelUpTex]])
|
||||
imsg.lineBottom:SetPoint("BOTTOM", 0, 0)
|
||||
imsg.lineBottom:SetWidth(418)
|
||||
imsg.lineBottom:SetHeight(7)
|
||||
E:Point(imsg.lineBottom, "BOTTOM", 0, 0)
|
||||
E:Size(imsg.lineBottom, 418, 7)
|
||||
imsg.lineBottom:SetTexCoord(0.00195313, 0.81835938, 0.01953125, 0.03320313)
|
||||
|
||||
imsg.text = imsg:CreateFontString(nil, "ARTWORK")
|
||||
E:FontTemplate(imsg.text, E["media"].normFont, 32, "OUTLINE")
|
||||
imsg.text:SetPoint("BOTTOM", 0, 12)
|
||||
E:Point(imsg.text, "BOTTOM", 0, 12)
|
||||
imsg.text:SetTextColor(1, 0.82, 0)
|
||||
imsg.text:SetJustifyH("CENTER")
|
||||
end
|
||||
@@ -207,22 +202,20 @@ end
|
||||
function PI:CreateFrame()
|
||||
f = CreateFrame("Button", "PluginInstallFrame", E.UIParent)
|
||||
f.SetPage = SetPage
|
||||
f:SetWidth(550)
|
||||
f:SetHeight(400)
|
||||
E:Size(f, 550, 400)
|
||||
E:SetTemplate(f, "Transparent")
|
||||
f:SetPoint("CENTER", 0, 0)
|
||||
E:Point(f, "CENTER", 0, 0)
|
||||
f:SetFrameStrata("TOOLTIP")
|
||||
|
||||
f.Title = f:CreateFontString(nil, "OVERLAY")
|
||||
E:FontTemplate(f.Title, nil, 17, nil)
|
||||
f.Title:SetPoint("TOP", 0, -5)
|
||||
E:Point(f.Title, "TOP", 0, -5)
|
||||
|
||||
f.Next = CreateFrame("Button", "PluginInstallNextButton", f, "UIPanelButtonTemplate")
|
||||
E:StripTextures(f.Next)
|
||||
E:SetTemplate(f.Next, "Default", true)
|
||||
f.Next:SetWidth(110)
|
||||
f.Next:SetHeight(25)
|
||||
f.Next:SetPoint("BOTTOMRIGHT", -5, 5)
|
||||
E:Size(f.Next, 110, 25)
|
||||
E:Point(f.Next, "BOTTOMRIGHT", -5, 5)
|
||||
f.Next:SetText(CONTINUE)
|
||||
f.Next:Disable()
|
||||
f.Next:SetScript("OnClick", NextPage)
|
||||
@@ -231,9 +224,8 @@ function PI:CreateFrame()
|
||||
f.Prev = CreateFrame("Button", "PluginInstallPrevButton", f, "UIPanelButtonTemplate")
|
||||
E:StripTextures(f.Prev)
|
||||
E:SetTemplate(f.Prev, "Default", true)
|
||||
f.Prev:SetWidth(110)
|
||||
f.Prev:SetHeight(25)
|
||||
f.Prev:SetPoint("BOTTOMLEFT", 5, 5)
|
||||
E:Size(f.Prev, 110, 25)
|
||||
E:Point(f.Prev, "BOTTOMLEFT", 5, 5)
|
||||
f.Prev:SetText(PREV)
|
||||
f.Prev:Disable()
|
||||
f.Prev:SetScript("OnClick", PreviousPage)
|
||||
@@ -244,8 +236,8 @@ function PI:CreateFrame()
|
||||
E:CreateBackdrop(f.Status, "Default", true)
|
||||
f.Status:SetStatusBarTexture(E["media"].normTex)
|
||||
f.Status:SetStatusBarColor(unpack(E["media"].rgbvaluecolor))
|
||||
f.Status:SetPoint("TOPLEFT", f.Prev, "TOPRIGHT", 6, -2)
|
||||
f.Status:SetPoint("BOTTOMRIGHT", f.Next, "BOTTOMLEFT", -6, 2)
|
||||
E:Point(f.Status, "TOPLEFT", f.Prev, "TOPRIGHT", 6, -2)
|
||||
E:Point(f.Status, "BOTTOMRIGHT", f.Next, "BOTTOMLEFT", -6, 2)
|
||||
-- Setup StatusBar Animation
|
||||
f.Status.anim = CreateAnimationGroup(f.Status)
|
||||
f.Status.anim.progress = f.Status.anim:CreateAnimation("Progress")
|
||||
@@ -254,94 +246,89 @@ function PI:CreateFrame()
|
||||
|
||||
f.Status.text = f.Status:CreateFontString(nil, "OVERLAY")
|
||||
E:FontTemplate(f.Status.text)
|
||||
f.Status.text:SetPoint("CENTER", 0, 0)
|
||||
E:Point(f.Status.text, "CENTER", 0, 0)
|
||||
|
||||
f.Option1 = CreateFrame("Button", "PluginInstallOption1Button", f, "UIPanelButtonTemplate")
|
||||
E:StripTextures(f.Option1)
|
||||
f.Option1:SetWidth(160)
|
||||
f.Option1:SetHeight(30)
|
||||
f.Option1:SetPoint("BOTTOM", 0, 45)
|
||||
E:Size(f.Option1, 160, 30)
|
||||
E:Point(f.Option1, "BOTTOM", 0, 45)
|
||||
f.Option1:SetText("")
|
||||
f.Option1:Hide()
|
||||
E.Skins:HandleButton(f.Option1, true)
|
||||
|
||||
f.Option2 = CreateFrame("Button", "PluginInstallOption2Button", f, "UIPanelButtonTemplate")
|
||||
E:StripTextures(f.Option2)
|
||||
f.Option2:SetWidth(160)
|
||||
f.Option2:SetHeight(30)
|
||||
f.Option2:SetPoint("BOTTOMLEFT", f, "BOTTOM", 4, 45)
|
||||
E:Size(f.Option2, 160, 30)
|
||||
E:Point(f.Option2, "BOTTOMLEFT", f, "BOTTOM", 4, 45)
|
||||
f.Option2:SetText("")
|
||||
f.Option2:Hide()
|
||||
f.Option2:SetScript("OnShow", function() f.Option1:SetWidth(110); f.Option1:ClearAllPoints(); f.Option1:SetPoint("BOTTOMRIGHT", f, "BOTTOM", -4, 45) end)
|
||||
f.Option2:SetScript("OnHide", function() f.Option1:SetWidth(160); f.Option1:ClearAllPoints(); f.Option1:SetPoint("BOTTOM", 0, 45) end)
|
||||
f.Option2:SetScript("OnShow", function() E:Width(f.Option1, 110); f.Option1:ClearAllPoints(); E:Point(f.Option1, "BOTTOMRIGHT", f, "BOTTOM", -4, 45) end)
|
||||
f.Option2:SetScript("OnHide", function() E:Width(f.Option1, 160); f.Option1:ClearAllPoints(); E:Point(f.Option1, "BOTTOM", 0, 45) end)
|
||||
E.Skins:HandleButton(f.Option2, true)
|
||||
|
||||
f.Option3 = CreateFrame("Button", "PluginInstallOption3Button", f, "UIPanelButtonTemplate")
|
||||
E:StripTextures(f.Option3)
|
||||
f.Option3:SetWidth(100)
|
||||
f.Option3:SetHeight(30)
|
||||
f.Option3:SetPoint("LEFT", f.Option2, "RIGHT", 4, 0)
|
||||
E:Size(f.Option3, 100, 30)
|
||||
E:Point(f.Option3, "LEFT", f.Option2, "RIGHT", 4, 0)
|
||||
f.Option3:SetText("")
|
||||
f.Option3:Hide()
|
||||
f.Option3:SetScript("OnShow", function() f.Option1:SetWidth(100); f.Option1:ClearAllPoints(); f.Option1:SetPoint("RIGHT", f.Option2, "LEFT", -4, 0); f.Option2:SetWidth(100); f.Option2:ClearAllPoints(); f.Option2:SetPoint("BOTTOM", f, "BOTTOM", 0, 45) end)
|
||||
f.Option3:SetScript("OnHide", function() f.Option1:SetWidth(160); f.Option1:ClearAllPoints(); f.Option1:SetPoint("BOTTOM", 0, 45); f.Option2:SetWidth(110); f.Option2:ClearAllPoints(); f.Option2:SetPoint("BOTTOMLEFT", f, "BOTTOM", 4, 45) end)
|
||||
f.Option3:SetScript("OnShow", function() E:Width(f.Option1, 100); f.Option1:ClearAllPoints(); E:Point(f.Option1, "RIGHT", f.Option2, "LEFT", -4, 0); E:Width(f.Option2, 100); f.Option2:ClearAllPoints(); E:Point(f.Option2, "BOTTOM", f, "BOTTOM", 0, 45) end)
|
||||
f.Option3:SetScript("OnHide", function() E:Width(f.Option1, 160); f.Option1:ClearAllPoints(); E:Point(f.Option1, "BOTTOM", 0, 45); E:Width(f.Option2, 110); f.Option2:ClearAllPoints(); E:Point(f.Option2, "BOTTOMLEFT", f, "BOTTOM", 4, 45) end)
|
||||
E.Skins:HandleButton(f.Option3, true)
|
||||
|
||||
f.Option4 = CreateFrame("Button", "PluginInstallOption4Button", f, "UIPanelButtonTemplate")
|
||||
E:StripTextures(f.Option4)
|
||||
f.Option4:SetWidth(100)
|
||||
f.Option4:SetHeight(30)
|
||||
f.Option4:SetPoint("LEFT", f.Option3, "RIGHT", 4, 0)
|
||||
E:Size(f.Option4, 100, 30)
|
||||
E:Point(f.Option4, "LEFT", f.Option3, "RIGHT", 4, 0)
|
||||
f.Option4:SetText("")
|
||||
f.Option4:Hide()
|
||||
f.Option4:SetScript("OnShow", function()
|
||||
f.Option1:SetWidth(100)
|
||||
f.Option2:SetWidth(100)
|
||||
E:Width(f.Option1, 100)
|
||||
E:Width(f.Option2, 100)
|
||||
|
||||
f.Option1:ClearAllPoints();
|
||||
f.Option1:SetPoint("RIGHT", f.Option2, "LEFT", -4, 0);
|
||||
E:Point(f.Option1, "RIGHT", f.Option2, "LEFT", -4, 0);
|
||||
f.Option2:ClearAllPoints();
|
||||
f.Option2:SetPoint("BOTTOMRIGHT", f, "BOTTOM", -4, 45)
|
||||
E:Point(f.Option2, "BOTTOMRIGHT", f, "BOTTOM", -4, 45)
|
||||
end)
|
||||
f.Option4:SetScript("OnHide", function() f.Option1:SetWidth(160); f.Option1:ClearAllPoints(); f.Option1:SetPoint("BOTTOM", 0, 45); f.Option2:SetWidth(110); f.Option2:ClearAllPoints(); f.Option2:SetPoint("BOTTOMLEFT", f, "BOTTOM", 4, 45) end)
|
||||
f.Option4:SetScript("OnHide", function() E:Width(f.Option1, 160); f.Option1:ClearAllPoints(); E:Point(f.Option1, "BOTTOM", 0, 45); E:Width(f.Option2, 110); f.Option2:ClearAllPoints(); E:Point(f.Option2, "BOTTOMLEFT", f, "BOTTOM", 4, 45) end)
|
||||
E.Skins:HandleButton(f.Option4, true)
|
||||
|
||||
f.SubTitle = f:CreateFontString(nil, "OVERLAY")
|
||||
E:FontTemplate(f.SubTitle, nil, 15, nil)
|
||||
f.SubTitle:SetPoint("TOP", 0, -40)
|
||||
E:Point(f.SubTitle, "TOP", 0, -40)
|
||||
|
||||
f.Desc1 = f:CreateFontString(nil, "OVERLAY")
|
||||
E:FontTemplate(f.Desc1)
|
||||
f.Desc1:SetPoint("TOPLEFT", 20, -75)
|
||||
f.Desc1:SetWidth(f:GetWidth() - 40)
|
||||
E:Point(f.Desc1, "TOPLEFT", 20, -75)
|
||||
E:Width(f.Desc1, f:GetWidth() - 40)
|
||||
|
||||
f.Desc2 = f:CreateFontString(nil, "OVERLAY")
|
||||
E:FontTemplate(f.Desc2)
|
||||
f.Desc2:SetPoint("TOP", f.Desc1, "BOTTOM", 0, -20)
|
||||
f.Desc2:SetWidth(f:GetWidth() - 40)
|
||||
E:Point(f.Desc2, "TOP", f.Desc1, "BOTTOM", 0, -20)
|
||||
E:Width(f.Desc2, f:GetWidth() - 40)
|
||||
|
||||
f.Desc3 = f:CreateFontString(nil, "OVERLAY")
|
||||
E:FontTemplate(f.Desc3)
|
||||
f.Desc3:SetPoint("TOP", f.Desc2, "BOTTOM", 0, -20)
|
||||
f.Desc3:SetWidth(f:GetWidth() - 40)
|
||||
E:Point(f.Desc3, "TOP", f.Desc2, "BOTTOM", 0, -20)
|
||||
E:Width(f.Desc3, f:GetWidth() - 40)
|
||||
|
||||
f.Desc4 = f:CreateFontString(nil, "OVERLAY")
|
||||
E:FontTemplate(f.Desc4)
|
||||
f.Desc4:SetPoint("TOP", f.Desc3, "BOTTOM", 0, -20)
|
||||
f.Desc4:SetWidth(f:GetWidth() - 40)
|
||||
E:Point(f.Desc4, "TOP", f.Desc3, "BOTTOM", 0, -20)
|
||||
E:Width(f.Desc4, f:GetWidth() - 40)
|
||||
|
||||
local close = CreateFrame("Button", "PluginInstallCloseButton", f, "UIPanelCloseButton")
|
||||
close:SetPoint("TOPRIGHT", f, "TOPRIGHT")
|
||||
E:Point(close, "TOPRIGHT", f, "TOPRIGHT")
|
||||
close:SetScript("OnClick", function() f:Hide() end)
|
||||
E.Skins:HandleCloseButton(close)
|
||||
|
||||
f.pending = CreateFrame("Frame", "PluginInstallPendingButton", f)
|
||||
f.pending:SetWidth(20)
|
||||
f.pending:SetHeight(20)
|
||||
f.pending:SetPoint("TOPLEFT", f, "TOPLEFT", 8, -8)
|
||||
E:Size(f.pending, 20)
|
||||
E:Point(f.pending, "TOPLEFT", f, "TOPLEFT", 8, -8)
|
||||
f.pending.tex = f.pending:CreateTexture(nil, "OVERLAY")
|
||||
f.pending.tex:SetPoint("TOPLEFT", f.pending, "TOPLEFT", 2, -2)
|
||||
f.pending.tex:SetPoint("BOTTOMRIGHT", f.pending, "BOTTOMRIGHT", -2, 2)
|
||||
E:Point(f.pending.tex, "TOPLEFT", f.pending, "TOPLEFT", 2, -2)
|
||||
E:Point(f.pending.tex, "BOTTOMRIGHT", f.pending, "BOTTOMRIGHT", -2, 2)
|
||||
f.pending.tex:SetTexture([[Interface\OptionsFrame\UI-OptionsFrame-NewFeatureIcon]])
|
||||
E:CreateBackdrop(f.pending, "Transparent")
|
||||
f.pending:SetScript("OnEnter", function(self)
|
||||
@@ -358,17 +345,16 @@ function PI:CreateFrame()
|
||||
end)
|
||||
|
||||
f.tutorialImage = f:CreateTexture("PluginInstallTutorialImage", "OVERLAY")
|
||||
f.tutorialImage:SetWidth(256)
|
||||
f.tutorialImage:SetHeight(128)
|
||||
f.tutorialImage:SetPoint("BOTTOM", 0, 70)
|
||||
E:Size(f.tutorialImage, 256, 128)
|
||||
E:Point(f.tutorialImage, "BOTTOM", 0, 70)
|
||||
|
||||
f.side = CreateFrame("Frame", "PluginInstallTitleFrame", f)
|
||||
E:SetTemplate(f.side, "Transparent")
|
||||
f.side:SetPoint("TOPLEFT", f, "TOPRIGHT", E.PixelMode and 1 or 3, 0)
|
||||
f.side:SetPoint("BOTTOMLEFT", f, "BOTTOMRIGHT", E.PixelMode and 1 or 3, 0)
|
||||
f.side:SetWidth(140)
|
||||
E:Point(f.side, "TOPLEFT", f, "TOPRIGHT", E.PixelMode and 1 or 3, 0)
|
||||
E:Point(f.side, "BOTTOMLEFT", f, "BOTTOMRIGHT", E.PixelMode and 1 or 3, 0)
|
||||
E:Width(f.side, 140)
|
||||
f.side.text = f.side:CreateFontString(nil, "OVERLAY")
|
||||
f.side.text:SetPoint("TOP", f.side, "TOP", 0, -4)
|
||||
E:Point(f.side.text, "TOP", f.side, "TOP", 0, -4)
|
||||
f.side.text:SetFont(E["media"].normFont, 18, "OUTLINE")
|
||||
f.side.text:SetText(L["Steps"])
|
||||
f.side.Lines = {} --Table to keep shown lines
|
||||
@@ -376,15 +362,14 @@ function PI:CreateFrame()
|
||||
for i = 1, 18 do
|
||||
local button = CreateFrame("Button", nil, f)
|
||||
if i == 1 then
|
||||
button:SetPoint("TOP", f.side.text, "BOTTOM", 0, -6)
|
||||
E:Point(button, "TOP", f.side.text, "BOTTOM", 0, -6)
|
||||
else
|
||||
button:SetPoint("TOP", f.side.Lines[i - 1], "BOTTOM")
|
||||
E:Point(button, "TOP", f.side.Lines[i - 1], "BOTTOM")
|
||||
end
|
||||
button:SetWidth(130)
|
||||
button:SetHeight(BUTTON_HEIGHT)
|
||||
E:Size(button, 130, BUTTON_HEIGHT)
|
||||
button.text = button:CreateFontString(nil, "OVERLAY")
|
||||
button.text:SetPoint("TOPLEFT", button, "TOPLEFT", 2, -2)
|
||||
button.text:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 2)
|
||||
E:Point(button.text, "TOPLEFT", button, "TOPLEFT", 2, -2)
|
||||
E:Point(button.text, "BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 2)
|
||||
button.text:SetFont(E["media"].normFont, 14, "OUTLINE")
|
||||
button:SetScript("OnClick", function() if i <= f.MaxPage then SetPage(i, f.CurrentPage) end end)
|
||||
button.text:SetText("")
|
||||
@@ -439,15 +424,15 @@ function PI:RunInstall()
|
||||
f.Pages = db.Pages
|
||||
|
||||
PluginInstallFrame:Show()
|
||||
f:SetPoint("CENTER")
|
||||
E:Point(f, "CENTER")
|
||||
if db.StepTitles and getn(db.StepTitles) == f.MaxPage then
|
||||
f:SetPoint("CENTER", E.UIParent, "CENTER", -((db.StepTitleWidth or 140)/2), 0)
|
||||
f.side:SetWidth(db.StepTitleWidth or 140)
|
||||
E:Point(f, "CENTER", E.UIParent, "CENTER", -((db.StepTitleWidth or 140)/2), 0)
|
||||
E:Width(f.side, db.StepTitleWidth or 140)
|
||||
f.side:Show()
|
||||
|
||||
for i = 1, getn(f.side.Lines) do
|
||||
if db.StepTitles[i] then
|
||||
f.side.Lines[i]:SetWidth(db.StepTitleButtonWidth or 130)
|
||||
E:Width(f.side.Lines[i], db.StepTitleButtonWidth or 130)
|
||||
f.side.Lines[i].text:SetJustifyH(db.StepTitleTextJustification or "CENTER")
|
||||
f.side.Lines[i]:Show()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user