mirror of
https://github.com/MezzalunaWM/Mezzaluna.git
synced 2026-03-09 13:07:32 -04:00
viewById works again, layer still ontop of other things
This commit is contained in:
parent
3ccf47e0be
commit
9186aeecd3
23 changed files with 282 additions and 181 deletions
|
|
@ -1,28 +0,0 @@
|
|||
const Bridge = @This();
|
||||
|
||||
const std = @import("std");
|
||||
const Lua = @import("lua.zig");
|
||||
|
||||
const gpa = std.heap.c_allocator;
|
||||
|
||||
pub fn getNestedField(L: *Lua, path: []u8) bool {
|
||||
var tokens = std.mem.tokenizeScalar(u8, path, '.');
|
||||
var first = true;
|
||||
|
||||
while (tokens.next()) |token| {
|
||||
const tok = gpa.dupeZ(u8, token) catch return false;
|
||||
if (first) {
|
||||
_ = L.state.getGlobal(tok) catch return false;
|
||||
first = false;
|
||||
} else {
|
||||
_ = L.state.getField(-1, tok);
|
||||
L.state.remove(-2);
|
||||
}
|
||||
|
||||
if (L.state.isNil(-1)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue