diff --git a/autogen/lua_definitions/structs.lua b/autogen/lua_definitions/structs.lua index 3eb27ce40..f12facabd 100644 --- a/autogen/lua_definitions/structs.lua +++ b/autogen/lua_definitions/structs.lua @@ -2001,6 +2001,7 @@ --- @class ServerSettings --- @field public bouncyLevelBounds BouncyLevelBounds --- @field public bubbleDeath integer +--- @field public enableChat integer --- @field public enableCheats integer --- @field public enablePlayerList integer --- @field public enablePlayersInLevelDisplay integer diff --git a/docs/lua/structs.md b/docs/lua/structs.md index d6f62fe7b..8388c8932 100644 --- a/docs/lua/structs.md +++ b/docs/lua/structs.md @@ -2514,6 +2514,7 @@ | ----- | ---- | ------ | | bouncyLevelBounds | [enum BouncyLevelBounds](constants.md#enum-BouncyLevelBounds) | | | bubbleDeath | `integer` | | +| enableChat | `integer` | | | enablePlayerList | `integer` | | | enablePlayersInLevelDisplay | `integer` | | | headlessServer | `integer` | | diff --git a/src/pc/djui/djui_interactable.c b/src/pc/djui/djui_interactable.c index 0a971125e..c17b7ba07 100644 --- a/src/pc/djui/djui_interactable.c +++ b/src/pc/djui/djui_interactable.c @@ -223,7 +223,7 @@ bool djui_interactable_on_key_down(int scancode) { return true; } - if (gDjuiChatBox != NULL && !gDjuiChatBoxFocus) { + if (gDjuiChatBox != NULL && !gDjuiChatBoxFocus && gServerSettings.enableChat) { bool pressChat = false; for (int i = 0; i < MAX_BINDS; i++) { if (scancode == (int)configKeyChat[i]) { pressChat = true; } diff --git a/src/pc/lua/smlua_cobject_autogen.c b/src/pc/lua/smlua_cobject_autogen.c index ac929ca04..677892592 100644 --- a/src/pc/lua/smlua_cobject_autogen.c +++ b/src/pc/lua/smlua_cobject_autogen.c @@ -2195,10 +2195,11 @@ static struct LuaObjectField sRayIntersectionInfoFields[LUA_RAY_INTERSECTION_INF { "surface", LVT_COBJECT_P, offsetof(struct RayIntersectionInfo, surface), false, LOT_SURFACE }, }; -#define LUA_SERVER_SETTINGS_FIELD_COUNT 13 +#define LUA_SERVER_SETTINGS_FIELD_COUNT 14 static struct LuaObjectField sServerSettingsFields[LUA_SERVER_SETTINGS_FIELD_COUNT] = { { "bouncyLevelBounds", LVT_S32, offsetof(struct ServerSettings, bouncyLevelBounds), false, LOT_NONE }, { "bubbleDeath", LVT_U8, offsetof(struct ServerSettings, bubbleDeath), false, LOT_NONE }, + { "enableChat", LVT_U8, offsetof(struct ServerSettings, enableChat), false, LOT_NONE }, { "enableCheats", LVT_U8, offsetof(struct ServerSettings, enableCheats), false, LOT_NONE }, { "enablePlayerList", LVT_U8, offsetof(struct ServerSettings, enablePlayerList), false, LOT_NONE }, { "enablePlayersInLevelDisplay", LVT_U8, offsetof(struct ServerSettings, enablePlayersInLevelDisplay), false, LOT_NONE }, diff --git a/src/pc/network/network.c b/src/pc/network/network.c index 1b3f530b8..7f6f504cf 100644 --- a/src/pc/network/network.c +++ b/src/pc/network/network.c @@ -76,6 +76,7 @@ struct ServerSettings gServerSettings = { .bubbleDeath = TRUE, .enablePlayersInLevelDisplay = TRUE, .enablePlayerList = TRUE, + .enableChat = TRUE, .headlessServer = FALSE, .nametags = TRUE, .maxPlayers = MAX_PLAYERS, @@ -124,6 +125,7 @@ bool network_init(enum NetworkType inNetworkType, bool reconnecting) { gServerSettings.bubbleDeath = configBubbleDeath; gServerSettings.enablePlayersInLevelDisplay = TRUE; gServerSettings.enablePlayerList = TRUE; + gServerSettings.enableChat = TRUE; gServerSettings.nametags = configNametags; gServerSettings.maxPlayers = configAmountofPlayers; gServerSettings.pauseAnywhere = configPauseAnywhere; diff --git a/src/pc/network/network.h b/src/pc/network/network.h index 80703f886..56cbc5d9b 100644 --- a/src/pc/network/network.h +++ b/src/pc/network/network.h @@ -79,6 +79,7 @@ struct ServerSettings { u8 bubbleDeath; u8 enablePlayersInLevelDisplay; u8 enablePlayerList; + u8 enableChat; u8 headlessServer; u8 nametags; u8 maxPlayers;