Add gServerSettings.enableChat

This commit is contained in:
Agent X 2024-05-11 16:48:59 -04:00
parent ee1034a79b
commit c21c255241
6 changed files with 8 additions and 2 deletions

View file

@ -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

View file

@ -2514,6 +2514,7 @@
| ----- | ---- | ------ |
| bouncyLevelBounds | [enum BouncyLevelBounds](constants.md#enum-BouncyLevelBounds) | |
| bubbleDeath | `integer` | |
| enableChat | `integer` | |
| enablePlayerList | `integer` | |
| enablePlayersInLevelDisplay | `integer` | |
| headlessServer | `integer` | |

View file

@ -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; }

View file

@ -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 },

View file

@ -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;

View file

@ -79,6 +79,7 @@ struct ServerSettings {
u8 bubbleDeath;
u8 enablePlayersInLevelDisplay;
u8 enablePlayerList;
u8 enableChat;
u8 headlessServer;
u8 nametags;
u8 maxPlayers;