== New Script Functions ==
DispatchEventAltDescription: An alternate way to dispatch User-Defined Events. Args are passed using the same syntax for Call, and are all optional.
Return true if no errors were encountered.
Syntax:
GetEventHandlersDescription: Same as DumpEventHandlers, but dumps the information into a multidimensional array instead.
If unfiltered, returns a stringmap array where each key is the name of an event, and each value is an array containing arrays with 2 elements. Those 2 elements are 1) the script handler and 2) a stringmap of filters ("1"::SomeFilter, etc.).
If filtered by eventName, then it will return the same as (DumpEventHandlers)["myEventName"].
Fixed TestExpr not returning 0 (false) if an NVSE error occured in one of its nested child expressions (error is now propagated up to TestExpr's ExpressionEvaluator).
Fixed ProcessEventHandler not restoring the removed : character from the eventName string if the event isn't an LN event.
Fixed a previous issue with SetEventHandler + LN events (caused by me) - the event filters were being type-validated before determining if the event was an LN event (LN events don't have types to check).
== Codebase changes ==
Moved filter type-checking for SetEventHandler outside of ExtractEventCallback, into its own function that is called by SetEventHandler.
To support DumpEventHandlers being able to ouput all handlers for a script callback consecutively, the callbacks list in EventInfo is now an std::multimap, where the keys are callbacks (1 callback can have multiple associated handlers).
Added a flag to identify User-Defined Events - it is set when they are being registered via SetEventHandler.
For the new event handler filtering system, made SetEventHandler remove all minimally matching handlers, similar to how JG's events do it.
For unit tests, added "nvseTestEvent" event that uses almost all paramTypes (debug mode only).
Added support for multiple Unit Test script files (they go in data/nvse/unit_tests/..).
Also wrote unit tests for the event handler functions, in event_handler_functions.txt.
Renamed ArrayElement::SetForm to ArrayElement::SetTESForm, since it was accidentally using the SetForm windows macro.
Added ArrayElement::Equals because I felt it was missing, unused.
== New Script Functions ==
DispatchEventAlt
Description: An alternate way to dispatch User-Defined Events. Args are passed using the same syntax forCall
, and are all optional. Return true if no errors were encountered. Syntax:DumpEventHandlers
Description: Outputs to console all event handlers currently set, optionally filtered byeventName
andscriptHandler
. Syntax:GetEventHandlers
Description: Same as DumpEventHandlers, but dumps the information into a multidimensional array instead. If unfiltered, returns a stringmap array where each key is the name of an event, and each value is an array containing arrays with 2 elements. Those 2 elements are 1) the script handler and 2) a stringmap of filters ("1"::SomeFilter, etc.). If filtered byeventName
, then it will return the same as(DumpEventHandlers)["myEventName"]
.Mostly meant for Asserts and debugging. Syntax:
== Bug Fixes ==
Fixed
TestExpr
not returning 0 (false) if an NVSE error occured in one of its nested child expressions (error is now propagated up toTestExpr
'sExpressionEvaluator
).Fixed
ProcessEventHandler
not restoring the removed:
character from the eventName string if the event isn't an LN event.Fixed a previous issue with SetEventHandler + LN events (caused by me) - the event filters were being type-validated before determining if the event was an LN event (LN events don't have types to check).
== Codebase changes ==
Moved filter type-checking for SetEventHandler outside of
ExtractEventCallback
, into its own function that is called bySetEventHandler
.To support
DumpEventHandlers
being able to ouput all handlers for a script callback consecutively, thecallbacks
list inEventInfo
is now an std::multimap, where the keys are callbacks (1 callback can have multiple associated handlers).Added a flag to identify User-Defined Events - it is set when they are being registered via SetEventHandler.
For the new event handler filtering system, made
SetEventHandler
remove all minimally matching handlers, similar to how JG's events do it.For unit tests, added
"nvseTestEvent"
event that uses almost all paramTypes (debug mode only).Added support for multiple Unit Test script files (they go in
data/nvse/unit_tests/..
). Also wrote unit tests for the event handler functions, inevent_handler_functions.txt
.Renamed
ArrayElement::SetForm
toArrayElement::SetTESForm
, since it was accidentally using theSetForm
windows macro. AddedArrayElement::Equals
because I felt it was missing, unused.