From 0e64ca99fa78897657fad62f420e92b19d22cf19 Mon Sep 17 00:00:00 2001 From: Nic Gaffney Date: Wed, 15 Oct 2025 01:52:18 -0500 Subject: Loading and saving rules now works --- src/imgui.zig | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/imgui.zig') diff --git a/src/imgui.zig b/src/imgui.zig index f086f2a..66bf41e 100644 --- a/src/imgui.zig +++ b/src/imgui.zig @@ -9,7 +9,7 @@ const c = @cImport({ @cInclude("rlImGui.h"); }); -pub fn update(alloc: std.mem.Allocator, buf: [:0]u8) !void { +pub fn update(buf: [:0]u8) !void { c.rlImGuiBegin(); defer c.rlImGuiEnd(); @@ -78,12 +78,16 @@ pub fn update(alloc: std.mem.Allocator, buf: [:0]u8) !void { _ = z.inputText("Save Path", .{ .buf = buf }); if (z.button("Save", .{})) { const path = buf; - _ = rul.saveRules(path) catch void; + rul.saveRules(path) catch |err| { + std.debug.print("Failed to save rule. Error: {}\n", .{err}); + }; } _ = z.inputText("Load Path", .{ .buf = buf }); if (z.button("Load", .{})) { const path = buf; - _ = rul.loadRules(alloc, path) catch void; + rul.loadRules(path) catch |err| { + std.debug.print("Failed to load rule. Error: {}\n", .{err}); + }; } } } -- cgit v1.2.3