No categories assigned

LUA:AddOptionWindowOption

Revision as of 02:18, 25 January 2013 by Jabantiz (talk | contribs)

LUA Functions: AddOptionWindowOption()

Adds an option to the given option window.


Syntax

AddOptionWindowOption(param1, param2, param3, param4, param5, [param6], [param7])

Parameters

Required - param1 (Option Window), param2 (String), param3 (String), param4 (int32), param5 (int16)
param1 The option window to add the option to
param2 The option title
param3 The option description
param4 The icon sheet to use
param5 The icon id
Optional - param6 (String), param7 (Sting)
param6 The lua function to call when this option is selected
param7 The title of the confirm window


Usage

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

Adds 2 options to the option window.

Notes

Icon sheets
0 - item icons     icon_is#.dds
1 - spell icons    icon_ss#.dds
2 - menu icons     icon_ms#.dds
3 - HO icons       icon_os#.dds
4 - map icons      icon_map#.dds
5 - AA icons       icon_as#.dds
6 - ???            icon_sw.dds