Page 1 of 1

New Lua Functions: Option windows

Posted: Tue Jan 08, 2013 10:02 pm
by Jabantiz
CreateOptionWindow
AddOptionWindowOption
SendOptionWindow

These lua functions are used to create an option window like this
Image
Detailed info for each function is on the wiki but here is a quick sample script

Code: Select all

function hailed(NPC, Spawn)
	window = CreateOptionWindow();
	AddOptionWindowOption(window, "Test 1", "Test 1 description", 0, 0, "Test1")
	AddOptionWindowOption(window, "Test 2", "Test 2 description", 0, 1, "Test2")
	SendOptionWindow(window, Spawn, "Option Window Test", "TestCancel")
end

function Test1(NPC, Spawn)
	Shout(Spawn, "Test 1")
end

function Test2(NPC, Spawn)
	Shout(Spawn, "Test 2")
end

function TestCancel(NPC, Spawn)
	Shout(Spawn, "Test cancel")
end

Re: New Lua Functions: Option windows

Posted: Wed Jan 09, 2013 11:47 am
by John Adams
Great work. I love seeing new UI's :)