Difference between revisions of "SetOnMenuClickEventHandler"

From the Fallout3 GECK Wiki
Jump to navigation Jump to search
imported>Jazzisparis
(Created page with "{{Function |origin = JIP |summary = Sets/removes the specified '''UDF Script''' as a handler that will be invoked in the event the specified '''UI Element''' is clicked/pres...")
 
imported>Jazzisparis
Line 5: Line 5:
The '''elementPath''' argument may be the full-path of an element, as:
The '''elementPath''' argument may be the full-path of an element, as:
<pre>"InventoryMenu/GLOW_BRANCH/IM_Tabline/Apparel"
<pre>"InventoryMenu/GLOW_BRANCH/IM_Tabline/Apparel"
InventoryMenu/GLOW_BRANCH/IM_Tabline/Weapons
"InventoryMenu/GLOW_BRANCH/IM_Tabline/Weapons"
InventoryMenu/GLOW_BRANCH/IM_Tabline/Aid</pre>
"InventoryMenu/GLOW_BRANCH/IM_Tabline/Aid"</pre>
In which case the handler will be invoked only when the specific element is clicked.
In which case the handler will be invoked only when the specific element is clicked.



Revision as of 18:22, 24 January 2017

< [[::Category:Functions|Category:Functions]]

A function added by the JIP NVSE Plugin.

Description

Sets/removes the specified UDF Script as a handler that will be invoked in the event the specified UI Element is clicked/pressed.

The elementPath argument may be the full-path of an element, as:

"InventoryMenu/GLOW_BRANCH/IM_Tabline/Apparel"
"InventoryMenu/GLOW_BRANCH/IM_Tabline/Weapons"
"InventoryMenu/GLOW_BRANCH/IM_Tabline/Aid"

In which case the handler will be invoked only when the specific element is clicked.

It may be a partial path, as:

"InventoryMenu/GLOW_BRANCH/IM_Tabline"

In which case the handler will be invoked when ANY element beginning with that path is clicked.

Note that the path, either full or partial, must begin with a valid menu name.


When invoked, the script is passed with three arguments:

  • (int) Menu Mode ID - 1002/1009/1075 etc.
  • (int) Element ID - Only for elements with a <id> property. Otherwise -1 is passed.
  • (string_var) Element Name - Without the full path (for example: "Apparel"). For template ListBox elements, the name is suffixed with the element's index in the list (for example: "stats_list_template_item:26")

Syntax

[help]
SetOnMenuClickEventHandler handlerScript:ref setORremove:1/0 elementPath:string

Example

SetOnMenuClickEventHandler OnMenuClickUDF 1 "ContainerMenu/NOGLOW_BRANCH/CM_ButtonRect/CM_ExitButton"

Sets the OnMenuClickUDF script as a handler to be invoked when any UI Element(s) matching the string is clicked.

SetOnMenuClickEventHandler OnMenuClickUDF 0 "ContainerMenu/NOGLOW_BRANCH/CM_ButtonRect/CM_ExitButton"

Removes the OnMenuClickUDF script as a handler of the above.

Handler Script

A skeleton handler script for this event:

scn	OnMenuClickUDF

int	iMenuID
int	iElementID
string_var	sElementName

begin Function {iMenuID, iElementID, sElementName}

	(code)

	sv_Destruct sElementName

end

See Also