SetOnMenuOpenEventHandler

From GECK
Jump to: navigation, search


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 MenuMode is opened (MUST be a Specific menu, NOT a Menu Type). If the menuID parameter is omitted, the script will be invoked when ANY menu mode opens.

When invoked, the script is passed with a single argument: the Menu Mode ID.

Syntax

[help]
SetOnMenuOpenEventHandler handlerScript:ref setORremove:1/0 menuID:int

Example

SetOnMenuOpenEventHandler OnMenuOpenUDF 1 1061

Sets the OnMenuOpenUDF script as a handler to be invoked when the Item Mod Menu is opened.

SetOnMenuOpenEventHandler OnMenuOpenUDF 0 1061

Removes the OnMenuOpenUDF script as a handler of the above.

Notes

Handler Script

A skeleton handler script for this event:

scn	OnMenuOpenUDF

int	iMenuID

begin Function {iMenuID}

(code)

end

Warning

A specific MenuMode must be specified. For example, trying to pass the "main four (the character interface: stats, magic, inventory, quest log)" Menu Type will result in errors/crashes:

SetOnMenuOpenEventHandler OnMenuOpenUDF 1 1

See Also