Event name constants, and aliases for 'on_' events
tracked
WolfGang Senizen
Constants
It might be good to have constants for the event names
LLEvents:on(EVENT_TOUCH_START, handler)
or
LLEvents:on(TOUCH_START_EVENT, handler)
Though the latter does break the general convention LSL has of prefixing constants, so may be less desirable.
Aliases
While at that, as mentioned here some aliases would be nice, to allow for nicer code read, constants could be used or true aliases could be provided, but that may not be worth it.
LLEvents:on("on_rez", handler)
-- to
LLEvents:on("rez", handler)
-- or
LLEvents:on(EVENT_REZ, handler)
Log In
Nexii Malthus
LSL has a mix e.g.
PUBLIC_CHANNEL
, COMBAT_CHANNEL
vs TEXTURE_BLANK
, TEXTURE_TRANSPARENT
-- so it's not the best reference of any sort of convention. There are also many early constants without any prefix or suffix such as the sensor flags (I had a feedback request for aliases that had a SENSOR_ prefix for those while keeping the old ones for compatibility)In that case, *
EVENT_
is actually preferable*, because the major usecase for the constants is autocomplete and that would work best with EVENT_
to see all the event related constants.M
Mercury Linden
marked this post as
tracked
Thanks we're taking a look at how this might be implemented in the future.