This is what i got so far... sadly the Setup Window doesn't even show up now
hopefully you find the error.
Code:
local xanuisetup = (...)
local function DoStuffOnFirstLogin()
local bgtexture = "Interface\\AddOns\\XanUI\\Media\\Textures\\fer2.tga"
local font = "Interface\\AddOns\\XanUI\\Media\\Fonts\\font.ttf"
local border = "Interface\\AddOns\\XanUI\\Media\\Textures\\Caith.tga"
local backdrop = {
bgFile = bgtexture,
edgeFile = border,
edgeSize = 16,
insets = {
left = 2,
right = 2,
top = 2,
bottom = 2,
}
}
--local frame = CreateFrame("frame", nil, UIParent)
frame:SetFrameStrata("TOOLTIP")
frame:SetPoint("CENTER")
frame:SetSize(400, 500)
frame:SetBackdrop(backdrop)
frame:SetBackdropColor(0,0,0,0.7)
local HeaderText = frame:CreateFontString()
HeaderText:SetPoint("TOP",0 , 70)
HeaderText:SetSize(350,200)
HeaderText:SetFont(font, 32)
HeaderText:SetTextColor(0.5, 0, 1)
HeaderText:SetText("Xan's UI")
local WText = frame:CreateFontString()
WText:SetPoint("TOP")
WText:SetSize(350,200)
WText:SetFont(font, 16)
WText:SetTextColor(0.5, 0.5, 0.5)
WText:SetWordWrap(true)
WText:SetNonSpaceWrap(false)
WText:SetText("Welcome to XanUI!")
local GText = frame:CreateFontString()
GText:SetPoint("Bottom", 0, -10)
GText:SetSize(350, 200)
GText:SetFont(font, 16)
GText:SetWordWrap(true)
GText:SetNonSpaceWrap(false)
GText:SetText(" |cffc0c0c0 WARNING: Please ensure you have correctly named the folders inside the WTF folder")
local FText = frame:CreateFontString()
FText:SetPoint("BOTTOM", -85, -80)
FText:SetSize(350,200)
FText:SetFont(font, 12)
FText:SetTextColor(0.5, 0, 1)
FText:SetText("Xan (EU - Blackhand)")
--XanUI
local button1 = CreateFrame("Button", nil, frame)
button1:SetFrameStrata("TOOLTIP")
button1:SetPoint("CENTER", 0, 60)
button1:SetSize(350, 50)
button1:SetBackdrop(backdrop)
button1:SetBackdropColor(.07,.07,.07,1)
button1:SetHighlightTexture("Interface\\AddOns\\XanUI\\Media\\Textures\\fer2.tga")
button1:GetHighlightTexture() :SetVertexColor(0.5, 0, 1);
button1:SetScript("OnClick", function (self, button, down)
-- This is where the Stuff happens
TidyPlates:ActivateTheme("Threat Plates")
TidyPlatesOptions.primary = "Threat Plates"
TidyPlatesOptions.secondary = "Threat Plates"
Gnosis:LoadConfig("XanUI", false, true, true, true)
MovAny:ChangeProfile("XanUI")
SlashCmdList["REFLUX"]("switch XanUI")
--DisableAddOn(xanuisetup)
DisableAddOn (xanuisetup,UnitName("player"))
end)
local b1t = button1:CreateFontString()
b1t:SetPoint("CENTER")
b1t:SetSize(350, 50)
b1t:SetFont(font, 16)
b1t:SetTextColor(1, 1, 1)
b1t:SetText("Standard Layout")
--XanUIHeal
local button2 = CreateFrame("Button", nil, frame)
button2:SetFrameStrata("TOOLTIP")
button2:SetPoint("CENTER")
button2:SetSize(350, 50)
button2:SetBackdrop(backdrop)
button2:SetBackdropColor(.07,.07,.07,1)
button2:SetHighlightTexture("Interface\\AddOns\\XanUI\\Media\\Textures\\fer2.tga")
button2:GetHighlightTexture() :SetVertexColor(0.5, 0, 1);
button2:SetScript("OnClick", function (self, button, down)
-- This is where the Stuff happens
Gnosis:LoadConfig("XanUIHeal", false, true, true, true)
TidyPlates:ActivateTheme("Threat Plates")
TidyPlatesOptions.primary = "Threat Plates"
TidyPlatesOptions.secondary = "Threat Plates"
MovAny:ChangeProfile("XanUIHeal")
SlashCmdList["REFLUX"]("switch XanUIHeal")
--DisableAddOn(xanuisetup)
DisableAddOn (xanuisetup,UnitName("player"))
end)
local b2t = button2:CreateFontString()
b2t:SetPoint("Center")
b2t:SetSize(350, 50)
b2t:SetFont(font, 16)
b2t:SetTextColor(1, 1, 1)
b2t:SetText("Healing Layout")
--Disable
local button3 = CreateFrame("Button", nil, frame)
button3:SetFrameStrata("TOOLTIP")
button3:SetPoint("CENTER", 0, -60)
button3:SetSize(350, 50)
button3:SetBackdrop(backdrop)
button3:SetBackdropColor(.07,.07,.07,1)
button3:SetHighlightTexture("Interface\\AddOns\\XanUI\\Media\\Textures\\fer2.tga")
button3:GetHighlightTexture() :SetVertexColor(0.5, 0, 1);
button3:SetScript("OnClick", function (self, button, down)
DisableAddOn (xanuisetup,UnitName("player"))
--DisableAddOn(xanuisetup)
ReloadUI()
end)
local b3t = button3:CreateFontString()
b3t:SetPoint("CENTER")
b3t:SetSize(350, 50)
b3t:SetFont(font, 16)
b3t:SetTextColor(1, 1, 1)
b3t:SetText("Disable This Window")
end
local frame = CreateFrame("frame", nil, UIParent) --local install = CreateFrame("Frame")
frame:RegisterEvent("ADDON_LOADED")
frame:SetScript("OnEvent",function(self,event,...)
if ... == "XanUI Setup" then
if XanuiSetupDB then
return
else
XanuiSetupDB = true
DoStuffOnFirstLogin()
end
end
end)
toc file:
Code:
## Interface: 60200
## Title: XanUI Setup
## Notes: Setup Box for inital Config. Enable on first use!
## SavedVariablesPerCharacter: XanuiSetupDB
XanUISetup.lua