Difference between revisions of "LUA:AddOptionWindowOption"

 
Line 1: Line 1:
= LUA Functions: AddOptionWindowOption() =
+
{{LUAFunction
Adds an option to the given option window.
+
|Name = AddOptionWindowOption
 
+
|Description =  
 
+
|Param1 = Option Window
==== Syntax ====
+
|Param1Desc = is the option window to add the option to
AddOptionWindowOption(param1, param2, param3, param4, param5, [param6], [param7])
+
|Param2 = Srting
 
+
|Param2Desc = is the option title
==== Parameters ====
+
|Param3 = String
; Required - ''param1'' (Option Window), ''param2'' (String), ''param3'' (String), ''param4'' (int32), ''param5'' (int16)
+
|Param3Desc = is the option description
: ''param1'' The option window to add the option to
+
|Param4 = int32
: ''param2'' The option title
+
|Param4Desc = is the icon sheet to use
: ''param3'' The option description
+
|Param5 = int16
: ''param4'' The icon sheet to use
+
|Param5Desc = is the icon id
: ''param5'' The icon id
+
|OptionalParam1 = sint32
; Optional - ''param6'' (String), ''param7'' (Sting)
+
|OptionalParam1Desc = is the lua function to call when this option is selected
: ''param6'' The lua function to call when this option is selected
+
|OptionalParam2 = sint32
: ''param7'' The title of the confirm window
+
|OptionalParam2Desc = title of the confirm window
 
+
|Example =
 
 
==== Usage ====
 
 
<pre>
 
<pre>
 
function hailed(NPC, Spawn)
 
function hailed(NPC, Spawn)
Line 39: Line 37:
 
end
 
end
 
</pre>
 
</pre>
 
+
|ExampleDesc = Adds 2 options to the option window.
Adds 2 options to the option window.
+
|Notes = === Icon Sheets ===
 
+
<pre>
==== Notes ====
+
0 - item icons    icon_is#.dds
Icon sheets
+
1 - spell icons    icon_ss#.dds
0 - item icons    icon_is#.dds
+
2 - menu icons    icon_ms#.dds
1 - spell icons    icon_ss#.dds
+
3 - HO icons      icon_os#.dds
2 - menu icons    icon_ms#.dds
+
4 - map icons      icon_map#.dds
3 - HO icons      icon_os#.dds
+
5 - AA icons      icon_as#.dds
4 - map icons      icon_map#.dds
+
6 - ???            icon_sw.dds
5 - AA icons      icon_as#.dds
+
</pre>
6 - ???            icon_sw.dds
+
}}

Latest revision as of 12:02, 30 January 2021


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