From cca040274f51ee47ab0c1a9984f1a65c9e4981ce Mon Sep 17 00:00:00 2001 From: Dennis Felsing Date: Fri, 19 May 2023 17:08:51 +0200 Subject: [PATCH 1/3] Remove popup for unofficial servers Via https://github.com/ddnet/ddnet/pull/6618/files#r1199072246 Thoughts? --- src/game/client/components/menus_browser.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index d9ba4c2e3..45169a663 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -587,12 +587,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View) void CMenus::Connect(const char *pAddress, std::optional Official) { - if(Official.has_value() && !Official.value()) - { - str_copy(m_aNextServer, pAddress); - PopupConfirm(Localize("Non-official server"), Localize("Are you sure that you want to connect to a non-official server?"), Localize("Yes"), Localize("No"), &CMenus::PopupConfirmSwitchServer); - } - else if(Client()->State() == IClient::STATE_ONLINE && Client()->GetCurrentRaceTime() / 60 >= g_Config.m_ClConfirmDisconnectTime && g_Config.m_ClConfirmDisconnectTime >= 0) + if(Client()->State() == IClient::STATE_ONLINE && Client()->GetCurrentRaceTime() / 60 >= g_Config.m_ClConfirmDisconnectTime && g_Config.m_ClConfirmDisconnectTime >= 0) { str_copy(m_aNextServer, pAddress); PopupConfirm(Localize("Disconnect"), Localize("Are you sure that you want to disconnect and switch to a different server?"), Localize("Yes"), Localize("No"), &CMenus::PopupConfirmSwitchServer); From 3d9d18c51119585251596fc89fb82447cffd8e17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Fri, 19 May 2023 19:40:46 +0200 Subject: [PATCH 2/3] Remove unused `CMenus::DoToolTip` declaration --- src/game/client/components/menus.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index 69a7b1f92..45cac3222 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -194,15 +194,6 @@ class CMenus : public CComponent return UI()->DoButtonLogic(pID, Checked, pRect); } - /** - * Places and renders a tooltip near pNearRect. - * For now only works correctly with single line tooltips, since Text width calculation gets broken when there are multiple lines. - * - * @param pID The ID of the tooltip. Usually a reference to some g_Config value. - * @param pNearTo Place the tooltip near this rect. - * @param pText The text to display in the tooltip - */ - void DoToolTip(const void *pID, const CUIRect *pNearRect, const char *pText, float WidthHint = -1.0f); // menus_settings_assets.cpp public: struct SCustomItem From 3593cce9b4b8dc75cb41f498166d7ef2762efa8d Mon Sep 17 00:00:00 2001 From: Dennis Felsing Date: Fri, 19 May 2023 20:31:59 +0200 Subject: [PATCH 3/3] Revert "Add popup to confirm connecting to friend on non-official server" This reverts commit 2e46460302681cf6290d048b66dd9d935feba174. --- src/game/client/components/menus.h | 3 +-- src/game/client/components/menus_browser.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/game/client/components/menus.h b/src/game/client/components/menus.h index 69a7b1f92..ca024ba3e 100644 --- a/src/game/client/components/menus.h +++ b/src/game/client/components/menus.h @@ -7,7 +7,6 @@ #include #include -#include #include #include @@ -563,7 +562,7 @@ protected: // found in menus_browser.cpp int m_SelectedIndex; void RenderServerbrowserServerList(CUIRect View); - void Connect(const char *pAddress, std::optional Official = {}); + void Connect(const char *pAddress); void PopupConfirmSwitchServer(); void RenderServerbrowserServerDetail(CUIRect View); void RenderServerbrowserFilters(CUIRect View); diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index 45169a663..5dd302f3e 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -585,7 +585,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View) } } -void CMenus::Connect(const char *pAddress, std::optional Official) +void CMenus::Connect(const char *pAddress) { if(Client()->State() == IClient::STATE_ONLINE && Client()->GetCurrentRaceTime() / 60 >= g_Config.m_ClConfirmDisconnectTime && g_Config.m_ClConfirmDisconnectTime >= 0) { @@ -1509,7 +1509,7 @@ void CMenus::RenderServerbrowserFriends(CUIRect View) str_copy(g_Config.m_UiServerAddress, Friend.ServerInfo()->m_aAddress); if(Input()->MouseDoubleClick()) { - Connect(g_Config.m_UiServerAddress, Friend.ServerInfo()->m_Official); + Connect(g_Config.m_UiServerAddress); } } }