module: expose Module.GlobalEvent type

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2024-03-25 10:30:13 -07:00 committed by Stephen Gutekanst
parent f3f4524f1b
commit 38e0d576cc
2 changed files with 10 additions and 7 deletions

View file

@ -74,7 +74,7 @@ pub fn World(comptime mods: anytype) type {
world.modules.sendToModule(module_tag, event_name, args);
}
pub inline fn sendGlobal(m: *@This(), comptime event_name: anytype, args: anytype) void {
pub inline fn sendGlobal(m: *@This(), event_name: Modules.GlobalEvent, args: anytype) void {
const mod_ptr: *Mods = @alignCast(@fieldParentPtr(Mods, @tagName(module_tag), m));
const world = @fieldParentPtr(WorldT, "mod", mod_ptr);
world.modules.send(event_name, args);