mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Cleanup
This commit is contained in:
parent
231fb6c75d
commit
e6bcb528cd
|
@ -216,10 +216,10 @@ MACRO_CONFIG_INT(SvAnnouncementRandom, sv_announcement_random, 1, 0, 1, CFGFLAG_
|
|||
MACRO_CONFIG_INT(SvOldLaser, sv_old_laser, 0, 0, 1, CFGFLAG_SERVER, "Whether lasers can hit you if you shot them and that they pull you towards the bounce origin (0 for DDRace Beta) or lasers can't hit you if you shot them, and they pull others towards the shooter")
|
||||
MACRO_CONFIG_INT(SvSlashMe, sv_slash_me, 0, 0, 1, CFGFLAG_SERVER, "Whether /me is active on the server or not")
|
||||
|
||||
MACRO_CONFIG_INT(ReconnectBanEnable, reconnect_ban, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Auto reconnect when banned")
|
||||
MACRO_CONFIG_INT(ReconnectFullEnable, reconnect_full, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Auto reconnect when server is full")
|
||||
MACRO_CONFIG_INT(ReconnectBanTimeout, reconnect_ban_timeout, 30, 5, 120, CFGFLAG_CLIENT | CFGFLAG_SAVE, "How many seconds to wait before reconnecting (when banned)")
|
||||
MACRO_CONFIG_INT(ReconnectFullTimeout, reconnect_full_timeout, 5, 1, 120, CFGFLAG_CLIENT | CFGFLAG_SAVE, "How many seconds to wait before reconnecting (when server is full)")
|
||||
MACRO_CONFIG_INT(ClReconnectBan, cl_reconnect_ban, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Auto reconnect when banned")
|
||||
MACRO_CONFIG_INT(ClReconnectFull, cl_reconnect_full, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Auto reconnect when server is full")
|
||||
MACRO_CONFIG_INT(ClReconnectBanTimeout, cl_reconnect_ban_timeout, 30, 5, 120, CFGFLAG_CLIENT | CFGFLAG_SAVE, "How many seconds to wait before reconnecting (when banned)")
|
||||
MACRO_CONFIG_INT(ClReconnectFullTimeout, cl_reconnect_full_timeout, 5, 1, 120, CFGFLAG_CLIENT | CFGFLAG_SAVE, "How many seconds to wait before reconnecting (when server is full)")
|
||||
|
||||
MACRO_CONFIG_INT(ConnTimeout, conn_timeout, 100, 5, 1000, CFGFLAG_SAVE|CFGFLAG_CLIENT|CFGFLAG_SERVER, "Network timeout")
|
||||
MACRO_CONFIG_INT(ClShowIDs, cl_show_ids, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Whether to show client ids in scoreboard")
|
||||
|
|
|
@ -979,11 +979,11 @@ int CMenus::Render()
|
|||
pButtonText = Localize("Ok");
|
||||
if ((str_find_nocase(Client()->ErrorString(), "full")) || (str_find_nocase(Client()->ErrorString(), "reserved")))
|
||||
{
|
||||
if (g_Config.m_ReconnectFullEnable)
|
||||
if (g_Config.m_ClReconnectFull)
|
||||
{
|
||||
if (_my_rtime == 0)
|
||||
_my_rtime = time_get();
|
||||
str_format(aBuf, sizeof(aBuf), Localize("\n\nReconnect in %d sec"), ((_my_rtime - time_get()) / time_freq() + g_Config.m_ReconnectFullTimeout));
|
||||
str_format(aBuf, sizeof(aBuf), Localize("\n\nReconnect in %d sec"), ((_my_rtime - time_get()) / time_freq() + g_Config.m_ClReconnectFullTimeout));
|
||||
pTitle = Client()->ErrorString();
|
||||
pExtraText = aBuf;
|
||||
pButtonText = Localize("Abort");
|
||||
|
@ -991,11 +991,11 @@ int CMenus::Render()
|
|||
}
|
||||
else if (str_find_nocase(Client()->ErrorString(), "ban"))
|
||||
{
|
||||
if (g_Config.m_ReconnectBanEnable)
|
||||
if (g_Config.m_ClReconnectBan)
|
||||
{
|
||||
if (_my_rtime == 0)
|
||||
_my_rtime = time_get();
|
||||
str_format(aBuf, sizeof(aBuf), Localize("\n\nReconnect in %d sec"), ((_my_rtime - time_get()) / time_freq() + g_Config.m_ReconnectBanTimeout));
|
||||
str_format(aBuf, sizeof(aBuf), Localize("\n\nReconnect in %d sec"), ((_my_rtime - time_get()) / time_freq() + g_Config.m_ClReconnectBanTimeout));
|
||||
pTitle = Client()->ErrorString();
|
||||
pExtraText = aBuf;
|
||||
pButtonText = Localize("Abort");
|
||||
|
@ -1532,16 +1532,16 @@ int CMenus::Render()
|
|||
UI()->SetActiveItem(0);
|
||||
}
|
||||
|
||||
if (m_Popup == POPUP_DISCONNECTED && ((g_Config.m_ReconnectFullEnable) || (g_Config.m_ReconnectBanEnable)))
|
||||
if (m_Popup == POPUP_DISCONNECTED)
|
||||
{
|
||||
if ((str_find_nocase(Client()->ErrorString(), "full")) || (str_find_nocase(Client()->ErrorString(), "reserved")))
|
||||
if (str_find_nocase(Client()->ErrorString(), "full") || str_find_nocase(Client()->ErrorString(), "reserved"))
|
||||
{
|
||||
if (time_get() > _my_rtime + time_freq() * g_Config.m_ReconnectFullTimeout)
|
||||
if (g_Config.m_ClReconnectFull && time_get() > _my_rtime + time_freq() * g_Config.m_ClReconnectFullTimeout)
|
||||
Client()->Connect(g_Config.m_UiServerAddress);
|
||||
}
|
||||
else if (str_find_nocase(Client()->ErrorString(), "ban"))
|
||||
else if (str_find_nocase(Client()->ErrorString(), "ban") || str_find_nocase(Client()->ErrorString(), "kick"))
|
||||
{
|
||||
if (time_get() > _my_rtime + time_freq() * g_Config.m_ReconnectBanTimeout)
|
||||
if (g_Config.m_ClReconnectBan && time_get() > _my_rtime + time_freq() * g_Config.m_ClReconnectBanTimeout)
|
||||
Client()->Connect(g_Config.m_UiServerAddress);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -221,7 +221,9 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
|
|||
View.y -= s_ScrollValue*ScrollNum*s_aCols[0].m_Rect.h;
|
||||
|
||||
int NewSelected = -1;
|
||||
#if defined(__ANDROID__)
|
||||
int DoubleClicked = 0;
|
||||
#endif
|
||||
int NumPlayers = 0;
|
||||
|
||||
m_SelectedIndex = -1;
|
||||
|
@ -290,8 +292,10 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
|
|||
if(UI()->DoButtonLogic(pItem, "", Selected, &SelectHitBox))
|
||||
{
|
||||
NewSelected = ItemIndex;
|
||||
#if defined(__ANDROID__)
|
||||
if(NewSelected == m_DoubleClickIndex)
|
||||
DoubleClicked = 1;
|
||||
#endif
|
||||
m_DoubleClickIndex = NewSelected;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1100,8 +1100,8 @@ void CMenus::RenderSettings(CUIRect MainView)
|
|||
Localize("Controls"),
|
||||
Localize("Graphics"),
|
||||
Localize("Sound"),
|
||||
Localize("DDNet 1/2"),
|
||||
Localize("DDNet 2/2")
|
||||
Localize("DDNet₁"),
|
||||
Localize("DDNet₂")
|
||||
};
|
||||
|
||||
int NumTabs = (int)(sizeof(aTabs)/sizeof(*aTabs));
|
||||
|
@ -1424,15 +1424,15 @@ void CMenus::RenderSettingsDDRaceTwo(CUIRect MainView)
|
|||
|
||||
{
|
||||
Right.HSplitTop(20.0f, &Button, &Right);
|
||||
if (DoButton_CheckBox(&g_Config.m_ReconnectFullEnable, Localize("Reconnect when server is full"), g_Config.m_ReconnectFullEnable, &Button))
|
||||
if (DoButton_CheckBox(&g_Config.m_ClReconnectFull, Localize("Reconnect when server is full"), g_Config.m_ClReconnectFull, &Button))
|
||||
{
|
||||
g_Config.m_ReconnectFullEnable ^= 1;
|
||||
g_Config.m_ClReconnectFull ^= 1;
|
||||
}
|
||||
|
||||
Left.HSplitTop(20.0f, &Button, &Left);
|
||||
if (DoButton_CheckBox(&g_Config.m_ReconnectBanEnable, Localize("Reconnect when you are banned"), g_Config.m_ReconnectBanEnable, &Button))
|
||||
if (DoButton_CheckBox(&g_Config.m_ClReconnectBan, Localize("Reconnect when you are banned"), g_Config.m_ClReconnectBan, &Button))
|
||||
{
|
||||
g_Config.m_ReconnectBanEnable ^= 1;
|
||||
g_Config.m_ClReconnectBan ^= 1;
|
||||
}
|
||||
|
||||
Left.HSplitTop(10.0f, 0, &Left);
|
||||
|
@ -1440,37 +1440,37 @@ void CMenus::RenderSettingsDDRaceTwo(CUIRect MainView)
|
|||
Left.HSplitTop(20.0f, &Label, &Left);
|
||||
Button.VSplitRight(20.0f, &Button, 0);
|
||||
char aBuf[64];
|
||||
if (g_Config.m_ReconnectBanTimeout == 1)
|
||||
if (g_Config.m_ClReconnectBanTimeout == 1)
|
||||
{
|
||||
str_format(aBuf, sizeof(aBuf), "%s: %i %s", Localize("Wait before try for"), g_Config.m_ReconnectBanTimeout, Localize("second"));
|
||||
str_format(aBuf, sizeof(aBuf), "%s %i %s", Localize("Wait before try for"), g_Config.m_ClReconnectBanTimeout, Localize("second"));
|
||||
}
|
||||
else
|
||||
{
|
||||
str_format(aBuf, sizeof(aBuf), "%s: %i %s", Localize("Wait before try for"), g_Config.m_ReconnectBanTimeout, Localize("seconds"));
|
||||
str_format(aBuf, sizeof(aBuf), "%s %i %s", Localize("Wait before try for"), g_Config.m_ClReconnectBanTimeout, Localize("seconds"));
|
||||
}
|
||||
UI()->DoLabelScaled(&Label, aBuf, 13.0f, -1);
|
||||
Left.HSplitTop(20.0f, &Button, 0);
|
||||
Button.HMargin(2.0f, &Button);
|
||||
g_Config.m_ReconnectBanTimeout = static_cast<int>(DoScrollbarH(&g_Config.m_ReconnectBanTimeout, &Button, g_Config.m_ReconnectBanTimeout / 120.0f) * 120.0f);
|
||||
if (g_Config.m_ReconnectBanTimeout < 5)
|
||||
g_Config.m_ReconnectBanTimeout = 5;
|
||||
g_Config.m_ClReconnectBanTimeout = static_cast<int>(DoScrollbarH(&g_Config.m_ClReconnectBanTimeout, &Button, g_Config.m_ClReconnectBanTimeout / 120.0f) * 120.0f);
|
||||
if (g_Config.m_ClReconnectBanTimeout < 5)
|
||||
g_Config.m_ClReconnectBanTimeout = 5;
|
||||
Right.HSplitTop(10.0f, 0, &Right);
|
||||
Right.VSplitLeft(20.0f, 0, &Right);
|
||||
Right.HSplitTop(20.0f, &Label, &Right);
|
||||
Button.VSplitRight(20.0f, &Button, 0);
|
||||
if (g_Config.m_ReconnectFullTimeout == 1)
|
||||
if (g_Config.m_ClReconnectFullTimeout == 1)
|
||||
{
|
||||
str_format(aBuf, sizeof(aBuf), "%s: %i %s", Localize("Wait before try for"), g_Config.m_ReconnectFullTimeout, Localize("second"));
|
||||
str_format(aBuf, sizeof(aBuf), "%s %i %s", Localize("Wait before try for"), g_Config.m_ClReconnectFullTimeout, Localize("second"));
|
||||
}
|
||||
else
|
||||
{
|
||||
str_format(aBuf, sizeof(aBuf), "%s: %i %s", Localize("Wait before try for"), g_Config.m_ReconnectFullTimeout, Localize("seconds"));
|
||||
str_format(aBuf, sizeof(aBuf), "%s %i %s", Localize("Wait before try for"), g_Config.m_ClReconnectFullTimeout, Localize("seconds"));
|
||||
}
|
||||
UI()->DoLabelScaled(&Label, aBuf, 13.0f, -1);
|
||||
Right.HSplitTop(20.0f, &Button, 0);
|
||||
Button.HMargin(2.0f, &Button);
|
||||
g_Config.m_ReconnectFullTimeout = static_cast<int>(DoScrollbarH(&g_Config.m_ReconnectFullTimeout, &Button, g_Config.m_ReconnectFullTimeout / 120.0f) * 120.0f);
|
||||
if (g_Config.m_ReconnectFullTimeout < 1)
|
||||
g_Config.m_ReconnectFullTimeout = 1;
|
||||
g_Config.m_ClReconnectFullTimeout = static_cast<int>(DoScrollbarH(&g_Config.m_ClReconnectFullTimeout, &Button, g_Config.m_ClReconnectFullTimeout / 120.0f) * 120.0f);
|
||||
if (g_Config.m_ClReconnectFullTimeout < 1)
|
||||
g_Config.m_ClReconnectFullTimeout = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue