diff --git a/src/events.cpp b/src/events.cpp index fe081f6c2..7102ef3b8 100755 --- a/src/events.cpp +++ b/src/events.cpp @@ -468,6 +468,18 @@ DEFINE_FIELD_X(InputEvent, DInputEvent, KeyChar); DEFINE_FIELD_X(InputEvent, DInputEvent, MouseX); DEFINE_FIELD_X(InputEvent, DInputEvent, MouseY); +DEFINE_ACTION_FUNCTION(DStaticEventHandler, SetOrder) +{ + PARAM_SELF_PROLOGUE(DStaticEventHandler); + PARAM_INT(order); + + if (E_CheckHandler(self)) + return 0; + + self->Order = order; + return 0; +} + DEFINE_ACTION_FUNCTION(DEventHandler, Create) { PARAM_PROLOGUE; diff --git a/wadsrc/static/zscript/events.txt b/wadsrc/static/zscript/events.txt index 690b1a6da..fe0d45e7d 100755 --- a/wadsrc/static/zscript/events.txt +++ b/wadsrc/static/zscript/events.txt @@ -314,7 +314,8 @@ class StaticEventHandler : Object native // this value will be queried on Register() to decide the relative order of this handler to every other. // this is most useful in UI systems. // default is 0. - native int Order; + native readonly int Order; + native void SetOrder(int order); // this value will be queried on user input to decide whether to send UiProcess to this handler. native bool IsUiProcessor; // this value determines whether mouse input is required.