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 --- @class ServerSettings
--- @field public bouncyLevelBounds BouncyLevelBounds --- @field public bouncyLevelBounds BouncyLevelBounds
--- @field public bubbleDeath integer --- @field public bubbleDeath integer
--- @field public enableChat integer
--- @field public enableCheats integer --- @field public enableCheats integer
--- @field public enablePlayerList integer --- @field public enablePlayerList integer
--- @field public enablePlayersInLevelDisplay integer --- @field public enablePlayersInLevelDisplay integer

View File

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

View File

@ -223,7 +223,7 @@ bool djui_interactable_on_key_down(int scancode) {
return true; return true;
} }
if (gDjuiChatBox != NULL && !gDjuiChatBoxFocus) { if (gDjuiChatBox != NULL && !gDjuiChatBoxFocus && gServerSettings.enableChat) {
bool pressChat = false; bool pressChat = false;
for (int i = 0; i < MAX_BINDS; i++) { for (int i = 0; i < MAX_BINDS; i++) {
if (scancode == (int)configKeyChat[i]) { pressChat = true; } 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 }, { "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] = { static struct LuaObjectField sServerSettingsFields[LUA_SERVER_SETTINGS_FIELD_COUNT] = {
{ "bouncyLevelBounds", LVT_S32, offsetof(struct ServerSettings, bouncyLevelBounds), false, LOT_NONE }, { "bouncyLevelBounds", LVT_S32, offsetof(struct ServerSettings, bouncyLevelBounds), false, LOT_NONE },
{ "bubbleDeath", LVT_U8, offsetof(struct ServerSettings, bubbleDeath), 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 }, { "enableCheats", LVT_U8, offsetof(struct ServerSettings, enableCheats), false, LOT_NONE },
{ "enablePlayerList", LVT_U8, offsetof(struct ServerSettings, enablePlayerList), false, LOT_NONE }, { "enablePlayerList", LVT_U8, offsetof(struct ServerSettings, enablePlayerList), false, LOT_NONE },
{ "enablePlayersInLevelDisplay", LVT_U8, offsetof(struct ServerSettings, enablePlayersInLevelDisplay), false, LOT_NONE }, { "enablePlayersInLevelDisplay", LVT_U8, offsetof(struct ServerSettings, enablePlayersInLevelDisplay), false, LOT_NONE },

View File

@ -76,6 +76,7 @@ struct ServerSettings gServerSettings = {
.bubbleDeath = TRUE, .bubbleDeath = TRUE,
.enablePlayersInLevelDisplay = TRUE, .enablePlayersInLevelDisplay = TRUE,
.enablePlayerList = TRUE, .enablePlayerList = TRUE,
.enableChat = TRUE,
.headlessServer = FALSE, .headlessServer = FALSE,
.nametags = TRUE, .nametags = TRUE,
.maxPlayers = MAX_PLAYERS, .maxPlayers = MAX_PLAYERS,
@ -124,6 +125,7 @@ bool network_init(enum NetworkType inNetworkType, bool reconnecting) {
gServerSettings.bubbleDeath = configBubbleDeath; gServerSettings.bubbleDeath = configBubbleDeath;
gServerSettings.enablePlayersInLevelDisplay = TRUE; gServerSettings.enablePlayersInLevelDisplay = TRUE;
gServerSettings.enablePlayerList = TRUE; gServerSettings.enablePlayerList = TRUE;
gServerSettings.enableChat = TRUE;
gServerSettings.nametags = configNametags; gServerSettings.nametags = configNametags;
gServerSettings.maxPlayers = configAmountofPlayers; gServerSettings.maxPlayers = configAmountofPlayers;
gServerSettings.pauseAnywhere = configPauseAnywhere; gServerSettings.pauseAnywhere = configPauseAnywhere;

View File

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