From d8b768de67f0cd989040a0eb7efd7995695042ac Mon Sep 17 00:00:00 2001 From: Tater Date: Sun, 11 Aug 2024 23:22:59 -0500 Subject: [PATCH] Show login required servers by default with key icon --- src/engine/shared/config_variables.h | 2 +- src/engine/textrender.h | 1 + src/game/client/components/menus_browser.cpp | 7 ++++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/engine/shared/config_variables.h b/src/engine/shared/config_variables.h index c9aef7b1796..d4245991670 100644 --- a/src/engine/shared/config_variables.h +++ b/src/engine/shared/config_variables.h @@ -330,7 +330,7 @@ MACRO_CONFIG_INT(BrFilterGametypeStrict, br_filter_gametype_strict, 0, 0, 1, CFG MACRO_CONFIG_INT(BrFilterConnectingPlayers, br_filter_connecting_players, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Filter connecting players") MACRO_CONFIG_STR(BrFilterServerAddress, br_filter_serveraddress, 128, "", CFGFLAG_SAVE | CFGFLAG_CLIENT, "Server address to filter") MACRO_CONFIG_INT(BrFilterUnfinishedMap, br_filter_unfinished_map, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Show only servers with unfinished maps") -MACRO_CONFIG_INT(BrFilterLogin, br_filter_login, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Filter out servers that require login") +MACRO_CONFIG_INT(BrFilterLogin, br_filter_login, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Filter out servers that require login") MACRO_CONFIG_INT(BrIndicateFinished, br_indicate_finished, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Show whether you have finished a DDNet map (transmits your player name to info.ddnet.org/info)") MACRO_CONFIG_STR(BrLocation, br_location, 16, "auto", CFGFLAG_SAVE | CFGFLAG_CLIENT, "Override location for ping estimation, available: auto, af, as, as:cn, eu, na, oc, sa (Automatic, Africa, Asia, China, Europe, North America, Oceania/Australia, South America") diff --git a/src/engine/textrender.h b/src/engine/textrender.h index 06f950ded38..38e6df46c2f 100644 --- a/src/engine/textrender.h +++ b/src/engine/textrender.h @@ -78,6 +78,7 @@ MAYBE_UNUSED static const char *FONT_ICON_ARROW_ROTATE_RIGHT = "\xEF\x80\x9E"; MAYBE_UNUSED static const char *FONT_ICON_FLAG_CHECKERED = "\xEF\x84\x9E"; MAYBE_UNUSED static const char *FONT_ICON_BAN = "\xEF\x81\x9E"; MAYBE_UNUSED static const char *FONT_ICON_CIRCLE_CHEVRON_DOWN = "\xEF\x84\xBA"; +MAYBE_UNUSED static const char *FONT_ICON_KEY = "\xEF\x82\x84"; MAYBE_UNUSED static const char *FONT_ICON_SQUARE_MINUS = "\xEF\x85\x86"; MAYBE_UNUSED static const char *FONT_ICON_SQUARE_PLUS = "\xEF\x83\xBE"; MAYBE_UNUSED static const char *FONT_ICON_SORT_UP = "\xEF\x83\x9E"; diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index 1aac045d6d8..c03c8460c9b 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -125,6 +125,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View, bool &WasListboxItemAct UI_ELEM_PLAYERS, UI_ELEM_FRIEND_ICON, UI_ELEM_PING, + UI_ELEM_KEY_ICON, NUM_UI_ELEMS, }; @@ -302,6 +303,10 @@ void CMenus::RenderServerbrowserServerList(CUIRect View, bool &WasListboxItemAct { RenderBrowserIcons(*pUiElement->Rect(UI_ELEM_LOCK_ICON), &Button, ColorRGBA(0.75f, 0.75f, 0.75f, 1.0f), TextRender()->DefaultTextOutlineColor(), FONT_ICON_LOCK, TEXTALIGN_MC); } + else if(pItem->m_RequiresLogin) + { + RenderBrowserIcons(*pUiElement->Rect(UI_ELEM_KEY_ICON), &Button, ColorRGBA(1.0f, 0.6f, 0.55f, 1.0f), TextRender()->DefaultTextOutlineColor(), FONT_ICON_KEY, TEXTALIGN_MC); + } } else if(Id == COL_FLAG_FAV) { @@ -830,7 +835,7 @@ void CMenus::ResetServerbrowserFilters() g_Config.m_BrFilterGametypeStrict = 0; g_Config.m_BrFilterConnectingPlayers = 1; g_Config.m_BrFilterServerAddress[0] = '\0'; - g_Config.m_BrFilterLogin = true; + g_Config.m_BrFilterLogin = false; if(g_Config.m_UiPage != PAGE_LAN) {