Quantcast

Fix a bug with install

Darthpred [08-20-14 - 02:48]
Fix a bug with install
Filename
ElvUI_SLE/core/install.lua
diff --git a/ElvUI_SLE/core/install.lua b/ElvUI_SLE/core/install.lua
index e40a231..6f97a54 100644
--- a/ElvUI_SLE/core/install.lua
+++ b/ElvUI_SLE/core/install.lua
@@ -1090,20 +1090,20 @@ local function InstallComplete()
 end

 local function ResetAll()
-	InstallNextButton:Disable()
-	InstallPrevButton:Disable()
-	InstallOption1Button:Hide()
-	InstallOption1Button:SetScript("OnClick", nil)
-	InstallOption1Button:SetText("")
-	InstallOption2Button:Hide()
-	InstallOption2Button:SetScript('OnClick', nil)
-	InstallOption2Button:SetText('')
-	InstallOption3Button:Hide()
-	InstallOption3Button:SetScript('OnClick', nil)
-	InstallOption3Button:SetText('')
-	InstallOption4Button:Hide()
-	InstallOption4Button:SetScript('OnClick', nil)
-	InstallOption4Button:SetText('')
+	SLEInstallNextButton:Disable()
+	SLEInstallPrevButton:Disable()
+	SLEInstallOption1Button:Hide()
+	SLEInstallOption1Button:SetScript("OnClick", nil)
+	SLEInstallOption1Button:SetText("")
+	SLEInstallOption2Button:Hide()
+	SLEInstallOption2Button:SetScript('OnClick', nil)
+	SLEInstallOption2Button:SetText('')
+	SLEInstallOption3Button:Hide()
+	SLEInstallOption3Button:SetScript('OnClick', nil)
+	SLEInstallOption3Button:SetText('')
+	SLEInstallOption4Button:Hide()
+	SLEInstallOption4Button:SetScript('OnClick', nil)
+	SLEInstallOption4Button:SetText('')
 	SLEInstallFrame.SubTitle:SetText("")
 	SLEInstallFrame.Desc1:SetText("")
 	SLEInstallFrame.Desc2:SetText("")
@@ -1114,20 +1114,20 @@ end
 local function SetPage(PageNum)
 	CURRENT_PAGE = PageNum
 	ResetAll()
-	InstallStatus:SetValue(PageNum)
+	SLEInstallStatus:SetValue(PageNum)

 	local f = SLEInstallFrame

 	if PageNum == MAX_PAGE then
-		InstallNextButton:Disable()
+		SLEInstallNextButton:Disable()
 	else
-		InstallNextButton:Enable()
+		SLEInstallNextButton:Enable()
 	end

 	if PageNum == 1 then
-		InstallPrevButton:Disable()
+		SLEInstallPrevButton:Disable()
 	else
-		InstallPrevButton:Enable()
+		SLEInstallPrevButton:Enable()
 	end

 	if PageNum == 1 then
@@ -1136,59 +1136,59 @@ local function SetPage(PageNum)
 		f.Desc2:SetText("")
 		f.Desc3:SetText(L["Please press the continue button to go onto the next step."])

-		InstallOption1Button:Show()
-		InstallOption1Button:SetScript("OnClick", InstallComplete)
-		InstallOption1Button:SetText(L["Skip Process"])
+		SLEInstallOption1Button:Show()
+		SLEInstallOption1Button:SetScript("OnClick", InstallComplete)
+		SLEInstallOption1Button:SetText(L["Skip Process"])
 	elseif PageNum == 2 then
 		f.SubTitle:SetText(L["Chat"])
 		f.Desc1:SetText("This options will determine if you want to use default ElvUI's chat datapanels or let Shadow & Light handle them.")
 		f.Desc2:SetText("Shadow & Light will dock them outside of actual chat panels.")
 		f.Desc3:SetText(L["Importance: |cffD3CF00Medium|r"])

-		InstallOption1Button:Show()
-		InstallOption1Button:SetScript("OnClick", function() E.db.sle.datatext.chathandle = false; E:GetModule('Layout'):ToggleChatPanels() end)
-		InstallOption1Button:SetText("ElvUI Panels")
-		InstallOption2Button:Show()
-		InstallOption2Button:SetScript('OnClick', function() E.db.sle.datatext.chathandle = true; E:GetModule('Layout'):ToggleChatPanels() end)
-		InstallOption2Button:SetText("S&L Panels")
+		SLEInstallOption1Button:Show()
+		SLEInstallOption1Button:SetScript("OnClick", function() E.db.sle.datatext.chathandle = false; E:GetModule('Layout'):ToggleChatPanels() end)
+		SLEInstallOption1Button:SetText("ElvUI Panels")
+		SLEInstallOption2Button:Show()
+		SLEInstallOption2Button:SetScript('OnClick', function() E.db.sle.datatext.chathandle = true; E:GetModule('Layout'):ToggleChatPanels() end)
+		SLEInstallOption2Button:SetText("S&L Panels")
 	elseif PageNum == 3 then
 		f.SubTitle:SetText(L["Armory Mode"])
 		f.Desc1:SetText("Imma test text")
 		f.Desc2:SetText("This page is for armory mode disable/enable stuff")
 		f.Desc3:SetText(L["Importance: |cffFF0000Low|r"])

-		InstallOption1Button:Show()
-		InstallOption1Button:SetScript('OnClick', function() E.private.sle.characterframeoptions.enable = true; E.private.sle.inspectframeoptions.enable = true; end)
-		InstallOption1Button:SetText(L["Enable"])
+		SLEInstallOption1Button:Show()
+		SLEInstallOption1Button:SetScript('OnClick', function() E.private.sle.characterframeoptions.enable = true; E.private.sle.inspectframeoptions.enable = true; end)
+		SLEInstallOption1Button:SetText(L["Enable"])
 	elseif PageNum == 4 then
 		f.SubTitle:SetText("Shadow & Light Settings")
 		f.Desc1:SetText(L["You can now choose if you what to use one of authors' set of options. This will change not only the positioning of some elements but also change a bunch of other options."])
 		f.Desc2:SetText(L["SLE_Install_Text2"])
 		f.Desc3:SetText(L["Importance: |cffFF0000Low|r"])

-		InstallOption1Button:Show()
-		InstallOption1Button:SetScript('OnClick', function() DarthSetup() end)
-		InstallOption1Button:SetText(L["Darth's Config"])
+		SLEInstallOption1Button:Show()
+		SLEInstallOption1Button:SetScript('OnClick', function() DarthSetup() end)
+		SLEInstallOption1Button:SetText(L["Darth's Config"])

-		InstallOption2Button:Show()
-		InstallOption2Button:SetScript('OnClick', function() AffinitiiSetup() end)
-		InstallOption2Button:SetText(L["Affinitii's Config"])
+		SLEInstallOption2Button:Show()
+		SLEInstallOption2Button:SetScript('OnClick', function() AffinitiiSetup() end)
+		SLEInstallOption2Button:SetText(L["Affinitii's Config"])

-		InstallOption3Button:Show()
-		InstallOption3Button:SetScript('OnClick', function() RepoocSetup() end)
-		InstallOption3Button:SetText(L["Repooc's Config"])
+		SLEInstallOption3Button:Show()
+		SLEInstallOption3Button:SetScript('OnClick', function() RepoocSetup() end)
+		SLEInstallOption3Button:SetText(L["Repooc's Config"])
 	elseif PageNum == 5 then
 		f.SubTitle:SetText(L["Installation Complete"])
 		f.Desc1:SetText(L["You are now finished with the installation process. If you are in need of technical support please visit us at http://www.tukui.org."])
 		f.Desc2:SetText(L["Please click the button below so you can setup variables and ReloadUI."])
-		InstallOption1Button:Show()
-		InstallOption1Button:SetScript("OnClick", InstallComplete)
-		InstallOption1Button:SetText(L["Finished"])
+		SLEInstallOption1Button:Show()
+		SLEInstallOption1Button:SetScript("OnClick", InstallComplete)
+		SLEInstallOption1Button:SetText(L["Finished"])
 		SLEInstallFrame:Size(550, 350)
 	end
 end

-local function NextPage()
+local function NextPage()
 	if CURRENT_PAGE ~= MAX_PAGE then
 		CURRENT_PAGE = CURRENT_PAGE + 1
 		SetPage(CURRENT_PAGE)
@@ -1271,7 +1271,7 @@ function SLE:Install()
 		f.Title:Point("TOP", 0, -5)
 		f.Title:SetText(L["|cff1784d1Shadow & Light|r Installation"])

-		f.Next = CreateFrame("Button", "InstallNextButton", f, "UIPanelButtonTemplate")
+		f.Next = CreateFrame("Button", "SLEInstallNextButton", f, "UIPanelButtonTemplate")
 		f.Next:StripTextures()
 		f.Next:SetTemplate("Default", true)
 		f.Next:Size(110, 25)
@@ -1281,7 +1281,7 @@ function SLE:Install()
 		f.Next:SetScript("OnClick", NextPage)
 		E.Skins:HandleButton(f.Next, true)

-		f.Prev = CreateFrame("Button", "InstallPrevButton", f, "UIPanelButtonTemplate")
+		f.Prev = CreateFrame("Button", "SLEInstallPrevButton", f, "UIPanelButtonTemplate")
 		f.Prev:StripTextures()
 		f.Prev:SetTemplate("Default", true)
 		f.Prev:Size(110, 25)
@@ -1291,7 +1291,7 @@ function SLE:Install()
 		f.Prev:SetScript("OnClick", PreviousPage)
 		E.Skins:HandleButton(f.Prev, true)

-		f.Status = CreateFrame("StatusBar", "InstallStatus", f)
+		f.Status = CreateFrame("StatusBar", "SLEInstallStatus", f)
 		f.Status:SetFrameLevel(f.Status:GetFrameLevel() + 2)
 		f.Status:CreateBackdrop("Default")
 		f.Status:SetStatusBarTexture(E["media"].normTex)
@@ -1307,7 +1307,7 @@ function SLE:Install()
 			self.text:SetText(self:GetValue().." / "..MAX_PAGE)
 		end)

-		f.Option1 = CreateFrame("Button", "InstallOption1Button", f, "UIPanelButtonTemplate")
+		f.Option1 = CreateFrame("Button", "SLEInstallOption1Button", f, "UIPanelButtonTemplate")
 		f.Option1:StripTextures()
 		f.Option1:Size(160, 30)
 		f.Option1:Point("BOTTOM", 0, 45)
@@ -1315,7 +1315,7 @@ function SLE:Install()
 		f.Option1:Hide()
 		E.Skins:HandleButton(f.Option1, true)

-		f.Option2 = CreateFrame("Button", "InstallOption2Button", f, "UIPanelButtonTemplate")
+		f.Option2 = CreateFrame("Button", "SLEInstallOption2Button", f, "UIPanelButtonTemplate")
 		f.Option2:StripTextures()
 		f.Option2:Size(110, 30)
 		f.Option2:Point('BOTTOMLEFT', f, 'BOTTOM', 4, 45)
@@ -1325,7 +1325,7 @@ function SLE:Install()
 		f.Option2:SetScript('OnHide', function() f.Option1:SetWidth(160); f.Option1:ClearAllPoints(); f.Option1:Point("BOTTOM", 0, 45) end)
 		E.Skins:HandleButton(f.Option2, true)

-		f.Option3 = CreateFrame("Button", "InstallOption3Button", f, "UIPanelButtonTemplate")
+		f.Option3 = CreateFrame("Button", "SLEInstallOption3Button", f, "UIPanelButtonTemplate")
 		f.Option3:StripTextures()
 		f.Option3:Size(100, 30)
 		f.Option3:Point('LEFT', f.Option2, 'RIGHT', 4, 0)
@@ -1335,7 +1335,7 @@ function SLE:Install()
 		f.Option3:SetScript('OnHide', function() f.Option1:SetWidth(160); f.Option1:ClearAllPoints(); f.Option1:Point("BOTTOM", 0, 45); f.Option2:SetWidth(110); f.Option2:ClearAllPoints(); f.Option2:Point('BOTTOMLEFT', f, 'BOTTOM', 4, 45) end)
 		E.Skins:HandleButton(f.Option3, true)

-		f.Option4 = CreateFrame("Button", "InstallOption4Button", f, "UIPanelButtonTemplate")
+		f.Option4 = CreateFrame("Button", "SLEInstallOption4Button", f, "UIPanelButtonTemplate")
 		f.Option4:StripTextures()
 		f.Option4:Size(100, 30)
 		f.Option4:Point('LEFT', f.Option3, 'RIGHT', 4, 0)
@@ -1372,14 +1372,15 @@ function SLE:Install()
 		f.Desc3:Point("TOPLEFT", 20, -175)
 		f.Desc3:Width(f:GetWidth() - 40)

-		local close = CreateFrame("Button", "InstallCloseButton", f, "UIPanelCloseButton")
+		local close = CreateFrame("Button", "SLEInstallCloseButton", f, "UIPanelCloseButton")
 		close:SetPoint("TOPRIGHT", f, "TOPRIGHT")
 		close:SetScript("OnClick", function()
 			f:Hide()
+			CURRENT_PAGE = 0
 		end)
 		E.Skins:HandleCloseButton(close)

-		f.tutorialImage = f:CreateTexture('InstallTutorialImage', 'OVERLAY')
+		f.tutorialImage = f:CreateTexture('SLEInstallTutorialImage', 'OVERLAY')
 		f.tutorialImage:Size(256, 128)
 		f.tutorialImage:SetTexture('Interface\\AddOns\\ElvUI_SLE\\media\\textures\\SLE_Banner')
 		f.tutorialImage:Point('BOTTOM', 0, 70)