Skip to content

Commit

Permalink
allow for final "EventType" macros to be registered
Browse files Browse the repository at this point in the history
  • Loading branch information
ianharrigan committed Jan 22, 2024
1 parent ac3d4de commit 24951e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion haxe/ui/macros/Macros.hx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ class Macros {
#end

for (f in builder.fields) {
if (f.access.indexOf(AInline) != -1 && f.access.indexOf(AStatic) != -1) {
if ((f.access.indexOf(AInline) != -1 || f.access.indexOf(AFinal) != -1) && f.access.indexOf(AStatic) != -1) {
switch (f.kind) {
case FVar(t, e):
var eventName = ExprTools.toString(e);
eventName = StringTools.replace(eventName, "\"", "");
eventName = StringTools.replace(eventName, "'", "");
eventName = eventName.toLowerCase();
eventName = StringTools.replace(eventName, "eventtype.name(", "");
eventName = StringTools.replace(eventName, ")", "");
EventInfo.nameToType.set(eventName, builder.fullPath);
EventInfo.nameToType.set("on" + eventName, builder.fullPath);
case _:
Expand Down

0 comments on commit 24951e2

Please sign in to comment.