SetOnMenuCloseEventHandler

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

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

Syntax

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

Example

SetOnMenuCloseEventHandler OnMenuCloseUDF 1 1002

Sets the OnMenuCloseUDF script as a handler to be invoked when the Inventory Menu is closed.

SetOnMenuCloseEventHandler OnMenuCloseUDF 0 1002

Removes the OnMenuCloseUDF script as a handler of the above.

Handler Script

A skeleton handler script for this event:

scn	OnMenuCloseUDF

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