From 137b7e4706304a5a2d10ee56f41fcdb561a3c76b Mon Sep 17 00:00:00 2001 From: OneAvargeCoder193 Date: Tue, 14 Jan 2025 00:34:59 -0500 Subject: [PATCH] make / open chat --- src/main.zig | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.zig b/src/main.zig index 6976ae6f..1e340dbd 100644 --- a/src/main.zig +++ b/src/main.zig @@ -287,6 +287,11 @@ fn openChat() void { gui.openWindow("chat"); gui.windowlist.chat.input.select(); } +fn openCommand() void { + openChat(); + gui.windowlist.chat.input.clear(); + gui.windowlist.chat.input.inputCharacter('/'); +} fn takeBackgroundImageFn() void { if(game.world == null) return; renderer.MenuBackGround.takeBackgroundImage(); @@ -351,6 +356,7 @@ pub const KeyBoard = struct { // MARK: KeyBoard .{.name = "openInventory", .key = c.GLFW_KEY_E, .pressAction = &openInventory, .gamepadButton = c.GLFW_GAMEPAD_BUTTON_X}, .{.name = "openCreativeInventory(aka cheat inventory)", .key = c.GLFW_KEY_C, .pressAction = &openCreativeInventory, .gamepadButton = c.GLFW_GAMEPAD_BUTTON_Y}, .{.name = "openChat", .key = c.GLFW_KEY_T, .releaseAction = &openChat}, + .{.name = "openCommand", .key = c.GLFW_KEY_SLASH, .releaseAction = &openCommand}, .{.name = "mainGuiButton", .mouseButton = c.GLFW_MOUSE_BUTTON_LEFT, .pressAction = &gui.mainButtonPressed, .releaseAction = &gui.mainButtonReleased, .gamepadButton = c.GLFW_GAMEPAD_BUTTON_A}, .{.name = "secondaryGuiButton", .mouseButton = c.GLFW_MOUSE_BUTTON_RIGHT, .pressAction = &gui.secondaryButtonPressed, .releaseAction = &gui.secondaryButtonReleased, .gamepadButton = c.GLFW_GAMEPAD_BUTTON_Y}, // gamepad gui.