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:
bors[bot] 2023-05-19 18:55:32 +00:00 committed by GitHub
commit 4ab55bd722
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 19 deletions

View file

@ -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);

View file

@ -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);
}
}
}