mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-04 03:37:59 -04:00
parent
c5a9ea53cd
commit
f9079be9ca
@ -134,6 +134,14 @@ pub fn mainButtonReleased(self: *TextInput, mousePosition: Vec2f) void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn select(self: *TextInput) void {
|
||||||
|
gui.setSelectedTextInput(self);
|
||||||
|
self.pressed = false;
|
||||||
|
self.selectionStart = null;
|
||||||
|
if(self.cursor == null)
|
||||||
|
self.cursor = @intCast(self.currentString.items.len);
|
||||||
|
}
|
||||||
|
|
||||||
pub fn deselect(self: *TextInput) void {
|
pub fn deselect(self: *TextInput) void {
|
||||||
self.cursor = null;
|
self.cursor = null;
|
||||||
self.selectionStart = null;
|
self.selectionStart = null;
|
||||||
|
@ -36,7 +36,7 @@ var messageQueue: main.List([]const u8) = undefined;
|
|||||||
var expirationTime: main.List(i32) = undefined;
|
var expirationTime: main.List(i32) = undefined;
|
||||||
var historyStart: u32 = 0;
|
var historyStart: u32 = 0;
|
||||||
var fadeOutEnd: u32 = 0;
|
var fadeOutEnd: u32 = 0;
|
||||||
var input: *TextInput = undefined;
|
pub var input: *TextInput = undefined;
|
||||||
var hideInput: bool = true;
|
var hideInput: bool = true;
|
||||||
|
|
||||||
fn refresh() void {
|
fn refresh() void {
|
||||||
|
@ -268,6 +268,12 @@ fn openCreativeInventory() void {
|
|||||||
gui.toggleGameMenu();
|
gui.toggleGameMenu();
|
||||||
gui.openWindow("creative_inventory");
|
gui.openWindow("creative_inventory");
|
||||||
}
|
}
|
||||||
|
fn openChat() void {
|
||||||
|
if(game.world == null) return;
|
||||||
|
ungrabMouse();
|
||||||
|
gui.openWindow("chat");
|
||||||
|
gui.windowlist.chat.input.select();
|
||||||
|
}
|
||||||
fn takeBackgroundImageFn() void {
|
fn takeBackgroundImageFn() void {
|
||||||
if(game.world == null) return;
|
if(game.world == null) return;
|
||||||
renderer.MenuBackGround.takeBackgroundImage();
|
renderer.MenuBackGround.takeBackgroundImage();
|
||||||
@ -324,6 +330,7 @@ pub const KeyBoard = struct { // MARK: KeyBoard
|
|||||||
.{.name = "escape", .key = c.GLFW_KEY_ESCAPE, .releaseAction = &escape},
|
.{.name = "escape", .key = c.GLFW_KEY_ESCAPE, .releaseAction = &escape},
|
||||||
.{.name = "openInventory", .key = c.GLFW_KEY_E, .releaseAction = &openInventory},
|
.{.name = "openInventory", .key = c.GLFW_KEY_E, .releaseAction = &openInventory},
|
||||||
.{.name = "openCreativeInventory(aka cheat inventory)", .key = c.GLFW_KEY_C, .releaseAction = &openCreativeInventory},
|
.{.name = "openCreativeInventory(aka cheat inventory)", .key = c.GLFW_KEY_C, .releaseAction = &openCreativeInventory},
|
||||||
|
.{.name = "openChat", .key = c.GLFW_KEY_T, .releaseAction = &openChat},
|
||||||
.{.name = "mainGuiButton", .mouseButton = c.GLFW_MOUSE_BUTTON_LEFT, .pressAction = &gui.mainButtonPressed, .releaseAction = &gui.mainButtonReleased},
|
.{.name = "mainGuiButton", .mouseButton = c.GLFW_MOUSE_BUTTON_LEFT, .pressAction = &gui.mainButtonPressed, .releaseAction = &gui.mainButtonReleased},
|
||||||
.{.name = "secondaryGuiButton", .mouseButton = c.GLFW_MOUSE_BUTTON_RIGHT, .pressAction = &gui.secondaryButtonPressed, .releaseAction = &gui.secondaryButtonReleased},
|
.{.name = "secondaryGuiButton", .mouseButton = c.GLFW_MOUSE_BUTTON_RIGHT, .pressAction = &gui.secondaryButtonPressed, .releaseAction = &gui.secondaryButtonReleased},
|
||||||
// text:
|
// text:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user