aboutsummaryrefslogtreecommitdiff
path: root/src/imgui.zig
diff options
context:
space:
mode:
authorNic Gaffney <gaffney_nic@protonmail.com>2025-10-15 01:52:18 -0500
committerNic Gaffney <gaffney_nic@protonmail.com>2025-10-15 01:52:18 -0500
commit0e64ca99fa78897657fad62f420e92b19d22cf19 (patch)
treea4862b97d4c6b1f0db3512839ab42953ab3747d8 /src/imgui.zig
parenta6b7451d7f144fc0658354e3dbd297cb9aeb9e6c (diff)
downloadparticle-sim-0e64ca99fa78897657fad62f420e92b19d22cf19.tar.gz
Loading and saving rules now works
Diffstat (limited to 'src/imgui.zig')
-rw-r--r--src/imgui.zig10
1 files changed, 7 insertions, 3 deletions
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});
+ };
}
}
}