mirror of
https://github.com/MezzalunaWM/Mezzaluna.git
synced 2026-03-07 19:49:53 -05:00
rename mez.hook.add_hook -> mez.hook.add
This commit is contained in:
parent
4fff609df9
commit
f9b9d41402
2 changed files with 4 additions and 4 deletions
|
|
@ -50,7 +50,7 @@ end
|
||||||
-- end
|
-- end
|
||||||
-- })
|
-- })
|
||||||
|
|
||||||
mez.hook.add_hook("ViewMapPre", {
|
mez.hook.add("ViewMapPre", {
|
||||||
callback = function()
|
callback = function()
|
||||||
print("hello world")
|
print("hello world")
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue