Code:
print ("LilBag is loaded")
-- Create context for UIFrames
local context = UI.CreateContext("Lilbag")
local lilbagwindow = UI.CreateFrame("RiftWindow", "LilBag", context)
-- Sets frame position and size
local function init()
lilbagwindow:SetVisible(false)
lilbagwindow:SetWidth(800)
lilbagwindow:SetHeight(600)
lilbagwindow:SetPoint("CENTER", UIParent, "CENTER")
lilbagwindow:SetTitle("Lilbag")
lilbagwindow:SetLayer(1)
end
-- Shows the window
local function showlilbag()
lilbagwindow:SetVisible(true)
end
table.insert (Command.Slash.Register("lilbag"), {showlilbag, "LilBag", "Slash command"})
My problem is that the window that is created is open by default. I want to use the slash command /lilbag to open the window. I thought the
local function init()
lilbagwindow:SetVisible(false)
would make the window closed when rift starts up and then I would open it with the slash command. Anyone see what my problem is?
Note: I am using the code for LuaPad as a learning tool.