mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
6626: Remove popup for unofficial servers r=Robyt3 a=def- Via https://github.com/ddnet/ddnet/pull/6618/files#r1199072246 Thoughts? ## Checklist - [ ] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test (especially base/) or added coverage to integration test - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) 6629: Remove unused `CMenus::DoToolTip` declaration r=def- a=Robyt3 ## Checklist - [ ] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test (especially base/) or added coverage to integration test - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: Dennis Felsing <dennis@felsin9.de> Co-authored-by: Robert Müller <robytemueller@gmail.com>
This commit is contained in:
commit
4ab55bd722
|
@ -7,7 +7,6 @@
|
|||
#include <base/vmath.h>
|
||||
|
||||
#include <chrono>
|
||||
#include <optional>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
|
@ -194,15 +193,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
|
||||
|
@ -563,7 +553,7 @@ protected:
|
|||
// found in menus_browser.cpp
|
||||
int m_SelectedIndex;
|
||||
void RenderServerbrowserServerList(CUIRect View);
|
||||
void Connect(const char *pAddress, std::optional<bool> Official = {});
|
||||
void Connect(const char *pAddress);
|
||||
void PopupConfirmSwitchServer();
|
||||
void RenderServerbrowserServerDetail(CUIRect View);
|
||||
void RenderServerbrowserFilters(CUIRect View);
|
||||
|
|
|
@ -585,14 +585,9 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
|
|||
}
|
||||
}
|
||||
|
||||
void CMenus::Connect(const char *pAddress, std::optional<bool> Official)
|
||||
void CMenus::Connect(const char *pAddress)
|
||||
{
|
||||
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);
|
||||
|
@ -1514,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue