Difference between revisions of "LUA:AddOptionWindowOption"
| Line 1: | Line 1: | ||
| − | = | + | {{LUAFunction |
| − | + | |Name = AddOptionWindowOption | |
| − | + | |Description = | |
| − | + | |Param1 = Option Window | |
| − | = | + | |Param1Desc = is the option window to add the option to |
| − | + | |Param2 = Srting | |
| − | + | |Param2Desc = is the option title | |
| − | = | + | |Param3 = String |
| − | + | |Param3Desc = is the option description | |
| − | + | |Param4 = int32 | |
| − | + | |Param4Desc = is the icon sheet to use | |
| − | + | |Param5 = int16 | |
| − | + | |Param5Desc = is the icon id | |
| − | + | |OptionalParam1 = sint32 | |
| − | + | |OptionalParam1Desc = is the lua function to call when this option is selected | |
| − | + | |OptionalParam2 = sint32 | |
| − | + | |OptionalParam2Desc = title of the confirm window | |
| − | + | |Example = | |
| − | |||
| − | |||
<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> | |
| − | ==== | + | 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 | |
| − | + | </pre> | |
| − | + | }} | |
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