From 4b4d78d5c5475538860a6e514ba747dfe7064f84 Mon Sep 17 00:00:00 2001 From: Ibra Date: Tue, 7 Apr 2026 00:10:26 +0300 Subject: [PATCH] feat(lobby): Add setting to disable alternate colors in lobby list --- .../Source/GameNetwork/GameSpy/LobbyUtils.cpp | 5 ++++- .../GeneralsOnline/GeneralsOnline_Settings.h | 3 +++ .../GeneralsOnline/GeneralsOnline_Settings.cpp | 18 ++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Core/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp b/Core/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp index 8641689e4cb..8701b6a70c8 100644 --- a/Core/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp +++ b/Core/GameEngine/Source/GameNetwork/GameSpy/LobbyUtils.cpp @@ -892,7 +892,10 @@ static Int insertGame(GameWindow* win, LobbyEntry& lobbyInfo, Bool showMap) bool bAlternate = (rowCount % 2 == 0); if (bAlternate && gameColor == GameSpyColor[GSCOLOR_GAME]) { - gameColor = GameMakeColor(191, 198, 201, 255); + if (NGMP_OnlineServicesManager::Settings.LobbyList_AlternateColors()) + { + gameColor = GameMakeColor(191, 198, 201, 255); + } } Int index = GadgetListBoxAddEntryText(win, gameName, gameColor, -1, COLUMN_NAME); GadgetListBoxSetItemData(win, (void*)gameID, index); diff --git a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/GeneralsOnline_Settings.h b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/GeneralsOnline_Settings.h index 267cb6684bf..c16fe64730a 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/GeneralsOnline_Settings.h +++ b/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/GeneralsOnline_Settings.h @@ -39,6 +39,7 @@ class GenOnlineSettings bool Graphics_DrawStatsOverlay() const { return m_Render_DrawStatsOverlay; } bool Graphics_LimitFramerate() const { return m_Render_LimitFramerate; } + bool LobbyList_AlternateColors() const { return m_LobbyList_AlternateColors; } int Graphics_GetFPSLimit() const { if (!m_Render_LimitFramerate) @@ -136,6 +137,8 @@ class GenOnlineSettings bool m_Social_Notification_PlayerSendsRequest_Menus = true; bool m_Social_Notification_PlayerSendsRequest_Gameplay = true; + bool m_LobbyList_AlternateColors = true; + EHTTPVersion m_Network_HTTPVersion = EHTTPVersion::HTTP_VERSION_AUTO; bool m_Network_UseAlternativeEndpoint = false; }; diff --git a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/GeneralsOnline_Settings.cpp b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/GeneralsOnline_Settings.cpp index 68f6756f6ba..2730f9aa875 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/GeneralsOnline_Settings.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/GeneralsOnline_Settings.cpp @@ -26,6 +26,9 @@ #define SETTINGS_KEY_SOCIAL_NOTIFICATIONS_PLAYER_SENDS_REQUEST_MENUS "notification_player_sends_request_menus" #define SETTINGS_KEY_SOCIAL_NOTIFICATIONS_PLAYER_SENDS_REQUEST_GAMEPLAY "notification_player_sends_request_gameplay" +#define SETTINGS_KEY_LOBBY_LIST "lobby_list" +#define SETTINGS_KEY_LOBBY_LIST_ALTERNATE_COLORS "alternate_lobby_colors" + #define SETTINGS_KEY_DEBUG "debug" #define SETTINGS_KEY_DEBUG_VERBOSE_LOGGING "verbose_logging" @@ -245,6 +248,14 @@ void GenOnlineSettings::Load(void) m_Social_Notification_PlayerSendsRequest_Gameplay = socialSettings[SETTINGS_KEY_SOCIAL_NOTIFICATIONS_PLAYER_SENDS_REQUEST_GAMEPLAY]; } } + + if (jsonSettings.contains(SETTINGS_KEY_LOBBY_LIST)) + { + auto lobbyListSettings = jsonSettings[SETTINGS_KEY_LOBBY_LIST]; + + if (lobbyListSettings.contains(SETTINGS_KEY_LOBBY_LIST_ALTERNATE_COLORS)) + m_LobbyList_AlternateColors = lobbyListSettings[SETTINGS_KEY_LOBBY_LIST_ALTERNATE_COLORS]; + } } } @@ -334,6 +345,13 @@ void GenOnlineSettings::Save() {SETTINGS_KEY_SOCIAL_NOTIFICATIONS_PLAYER_SENDS_REQUEST_GAMEPLAY, m_Social_Notification_PlayerSendsRequest_Gameplay}, } }, + + { + SETTINGS_KEY_LOBBY_LIST, + { + {SETTINGS_KEY_LOBBY_LIST_ALTERNATE_COLORS, m_LobbyList_AlternateColors}, + } + }, }; std::string strData = root.dump(1);