Thread Tools Display Modes
Prev Previous Post   Next Post Next
Unread 10-18-11, 07:26 PM   #1
Lildry
Claw of Regulos
Join Date: Oct 2011
Posts: 13
Riftwindow problem

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.
Lildry is offline   Reply With Quote
 

Go BackRiftui » Developer Discussions » General Authoring Discussion » Riftwindow problem


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off