From f9b9d4140214fab4781dd899bc90049d091df984 Mon Sep 17 00:00:00 2001 From: Squibid Date: Sun, 23 Nov 2025 21:05:29 -0500 Subject: [PATCH] rename mez.hook.add_hook -> mez.hook.add --- runtime/share/mezzaluna/init.lua | 2 +- src/lua/hook.zig | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/share/mezzaluna/init.lua b/runtime/share/mezzaluna/init.lua index f55ff0b..019861e 100644 --- a/runtime/share/mezzaluna/init.lua +++ b/runtime/share/mezzaluna/init.lua @@ -50,7 +50,7 @@ end -- end -- }) -mez.hook.add_hook("ViewMapPre", { +mez.hook.add("ViewMapPre", { callback = function() print("hello world") end diff --git a/src/lua/hook.zig b/src/lua/hook.zig index cf26c57..6273f2f 100644 --- a/src/lua/hook.zig +++ b/src/lua/hook.zig @@ -9,7 +9,7 @@ const zlua = @import("zlua"); const gpa = std.heap.c_allocator; const server = &@import("../main.zig").server; -pub fn add_hook(L: *zlua.Lua) i32 { +pub fn add(L: *zlua.Lua) i32 { L.checkType(2, .table); var hook: *THook = gpa.create(THook) catch { @@ -22,7 +22,7 @@ pub fn add_hook(L: *zlua.Lua) i32 { }; // We support both a string and a table of strings as the first value of - // add_hook. Regardless of which type is passed in we create an arraylist of + // add. Regardless of which type is passed in we create an arraylist of // []const u8's if (L.isTable(1)) { L.pushNil(); @@ -74,7 +74,7 @@ pub fn add_hook(L: *zlua.Lua) i32 { return 0; } -pub fn del_hook(L: *zlua.Lua) i32 { +pub fn del(L: *zlua.Lua) i32 { // TODO: impl _ = L; return 0;