Skip to content

Commit

Permalink
fix: max width
Browse files Browse the repository at this point in the history
  • Loading branch information
somanshurath committed Dec 5, 2024
1 parent 6a5d650 commit f253377
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/gui/windows/multiplayer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@ fn join(_: usize) void {
std.log.info("Connecting to server: {s}", .{ipAddressEntry.currentString.items});
main.game.testWorld.init(ipAddressEntry.currentString.items, _connection) catch |err| {
std.log.err("Encountered error while opening world: {s}", .{@errorName(err)});
gui.windowlist.notification.text = std.fmt.allocPrint(main.globalAllocator.allocator, "Encountered error while opening world: {}", .{err}) catch unreachable;
gui.openWindow("notification");
};
connection = null;
} else {
std.log.err("No connection found. Cannot connect.", .{});
gui.windowlist.notification.text = "No connection found. Cannot connect.";
gui.openWindow("notification");
}
for(gui.openWindows.items) |openWindow| {
gui.closeWindowFromRef(openWindow);
Expand Down
2 changes: 1 addition & 1 deletion src/gui/windows/notification.zig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub var window: GuiWindow = GuiWindow {
pub var text: []const u8 = "";

const padding: f32 = 16;
const width: f32 = 128;
const width: f32 = 256;

fn ack(_: usize) void {
gui.closeWindowFromRef(&window);
Expand Down

0 comments on commit f253377

Please sign in to comment.