make / open chat

This commit is contained in:
OneAvargeCoder193 2025-01-14 00:34:59 -05:00 committed by IntegratedQuantum
parent d47a4ab62a
commit 137b7e4706

View File

@ -287,6 +287,11 @@ fn openChat() void {
gui.openWindow("chat"); gui.openWindow("chat");
gui.windowlist.chat.input.select(); gui.windowlist.chat.input.select();
} }
fn openCommand() void {
openChat();
gui.windowlist.chat.input.clear();
gui.windowlist.chat.input.inputCharacter('/');
}
fn takeBackgroundImageFn() void { fn takeBackgroundImageFn() void {
if(game.world == null) return; if(game.world == null) return;
renderer.MenuBackGround.takeBackgroundImage(); 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 = "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 = "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 = "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 = "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}, .{.name = "secondaryGuiButton", .mouseButton = c.GLFW_MOUSE_BUTTON_RIGHT, .pressAction = &gui.secondaryButtonPressed, .releaseAction = &gui.secondaryButtonReleased, .gamepadButton = c.GLFW_GAMEPAD_BUTTON_Y},
// gamepad gui. // gamepad gui.