mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-03 19:28:49 -04:00
Don't send empty chat messages(which currently crashes) and display the correct name in the change name gui.
This commit is contained in:
parent
950933b03f
commit
50c20aa28f
@ -43,7 +43,7 @@ pub fn onOpen() void {
|
||||
list.add(Label.init(.{0, 0}, width, "\\**italic*\\* \\*\\***bold**\\*\\* \\__underlined_\\_ \\_\\___strike-through__\\_\\_", .center));
|
||||
list.add(Label.init(.{0, 0}, width, "Even colors are possible, using the hexadecimal color code:", .center));
|
||||
list.add(Label.init(.{0, 0}, width, "\\##ff0000ff#ffffff00#ffffff00#ff0000red#ffffff \\##ff0000ff#00770077#ffffff00#ff7700orange#ffffff \\##ffffff00#00ff00ff#ffffff00#00ff00green#ffffff \\##ffffff00#ffffff00#0000ffff#0000ffblue", .center));
|
||||
textComponent = TextInput.init(.{0, 0}, width, 32, "quanturmdoelvloper", .{.callback = &apply});
|
||||
textComponent = TextInput.init(.{0, 0}, width, 32, settings.playerName, .{.callback = &apply});
|
||||
list.add(textComponent);
|
||||
list.add(Button.initText(.{0, 0}, 100, "Apply", .{.callback = &apply}));
|
||||
list.finish(.center);
|
||||
|
@ -125,6 +125,8 @@ pub fn addMessage(message: []const u8) void {
|
||||
}
|
||||
|
||||
pub fn sendMessage(_: usize) void {
|
||||
main.network.Protocols.chat.send(main.game.world.?.conn, input.currentString.items);
|
||||
input.clear();
|
||||
if(input.currentString.items.len != 0) {
|
||||
main.network.Protocols.chat.send(main.game.world.?.conn, input.currentString.items);
|
||||
input.clear();
|
||||
}
|
||||
}
|
@ -28,7 +28,7 @@ pub var bloom: bool = true;
|
||||
|
||||
pub var vsync: bool = true;
|
||||
|
||||
pub var playerName: []const u8 = "";
|
||||
pub var playerName: []const u8 = "quanturmdoelvloper";
|
||||
|
||||
pub var lastUsedIPAddress: []const u8 = "127.0.0.1";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user