Setting Order directly (while the event handler is registered) will result in all sorts of broken behavior. Made readonly.

This commit is contained in:
ZZYZX 2017-02-03 20:44:27 +02:00
parent 03f7c39ea7
commit f816537992
2 changed files with 14 additions and 1 deletions

View File

@ -468,6 +468,18 @@ DEFINE_FIELD_X(InputEvent, DInputEvent, KeyChar);
DEFINE_FIELD_X(InputEvent, DInputEvent, MouseX); DEFINE_FIELD_X(InputEvent, DInputEvent, MouseX);
DEFINE_FIELD_X(InputEvent, DInputEvent, MouseY); 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) DEFINE_ACTION_FUNCTION(DEventHandler, Create)
{ {
PARAM_PROLOGUE; PARAM_PROLOGUE;

View File

@ -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 value will be queried on Register() to decide the relative order of this handler to every other.
// this is most useful in UI systems. // this is most useful in UI systems.
// default is 0. // 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. // this value will be queried on user input to decide whether to send UiProcess to this handler.
native bool IsUiProcessor; native bool IsUiProcessor;
// this value determines whether mouse input is required. // this value determines whether mouse input is required.