No categories assigned

LUA:AddOptionWindowOption


LUA:AllFunctions - AddOptionWindowOption

Return to: LUA:AllFunctions | Tutorials | Portal | Forum | Project Manager | Bug Tracker



Syntax

AddOptionWindowOption(param1, param2, param3, param4, param5, [opt param1], [opt param2])

Parameters

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

Example

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