rename mez.hook.add_hook -> mez.hook.add

This commit is contained in:
Squibid 2025-11-23 21:05:29 -05:00
parent d255f63ac7
commit 91578d583a
Signed by: squibid
GPG key ID: BECE5684D3C4005D
2 changed files with 4 additions and 4 deletions

View file

@ -58,7 +58,7 @@ end
-- end -- end
-- }) -- })
mez.hook.add_hook("ViewMapPre", { mez.hook.add("ViewMapPre", {
callback = function(a) callback = function(a)
print(a) print(a)
print("hello world") print("hello world")

View file

@ -9,7 +9,7 @@ const zlua = @import("zlua");
const gpa = std.heap.c_allocator; const gpa = std.heap.c_allocator;
const server = &@import("../main.zig").server; 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); L.checkType(2, .table);
var hook: *THook = gpa.create(THook) catch { 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 // 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 // []const u8's
if (L.isTable(1)) { if (L.isTable(1)) {
L.pushNil(); L.pushNil();
@ -74,7 +74,7 @@ pub fn add_hook(L: *zlua.Lua) i32 {
return 0; return 0;
} }
pub fn del_hook(L: *zlua.Lua) i32 { pub fn del(L: *zlua.Lua) i32 {
// TODO: impl // TODO: impl
_ = L; _ = L;
return 0; return 0;