lua position, size, focus and z-index (not really)

This commit is contained in:
Harrison DiAmbrosio 2025-11-25 16:01:38 -05:00
parent b45544c97a
commit 1eda05b7b3
14 changed files with 236 additions and 98 deletions

View file

@ -8,6 +8,7 @@ const Bridge = @import("bridge.zig");
const Fs = @import("fs.zig");
const Input = @import("input.zig");
const Api = @import("api.zig");
const View = @import("view.zig");
const gpa = std.heap.c_allocator;
@ -69,6 +70,11 @@ pub fn init(self: *Lua) !void {
self.state.newLib(api_funcs);
self.state.setField(-2, "api");
}
{
const view_funcs = zlua.fnRegsFromType(View);
self.state.newLib(view_funcs);
self.state.setField(-2, "view");
}
}
loadRuntimeDir(self) catch |err| {
@ -76,6 +82,7 @@ pub fn init(self: *Lua) !void {
std.log.warn("{s}", .{try self.state.toString(-1)});
}
};
loadConfigDir(self) catch |err| {
if (err == error.LuaRuntime) {
std.log.warn("{s}", .{try self.state.toString(-1)});