Retry tutorial join after 5 seconds

This commit is contained in:
Dennis Felsing 2022-03-25 17:15:11 +01:00
parent 5fa9136af7
commit 939d5436b0
35 changed files with 121 additions and 6 deletions

View file

@ -1344,3 +1344,6 @@ https://ddnet.tw/discord
Tutorial
==
Can't find a Tutorial server
==

View file

@ -1264,6 +1264,9 @@ https://wiki.ddnet.tw/
Tutorial
==
Can't find a Tutorial server
==
Website
==

View file

@ -1309,6 +1309,9 @@ https://wiki.ddnet.tw/
Tutorial
==
Can't find a Tutorial server
==
Website
==

View file

@ -1364,3 +1364,6 @@ Chat command (e.g. showall 1)
Tutorial
==
Can't find a Tutorial server
==

View file

@ -1264,6 +1264,9 @@ https://wiki.ddnet.tw/
Tutorial
==
Can't find a Tutorial server
==
Website
==

View file

@ -1341,3 +1341,6 @@ Chat command (e.g. showall 1)
Tutorial
==
Can't find a Tutorial server
==

View file

@ -1264,6 +1264,9 @@ https://wiki.ddnet.tw/
Tutorial
==
Can't find a Tutorial server
==
Website
==

View file

@ -1351,3 +1351,6 @@ https://ddnet.tw/discord
Tutorial
==
Can't find a Tutorial server
==

View file

@ -1349,3 +1349,6 @@ https://ddnet.tw/discord
Tutorial
==
Can't find a Tutorial server
==

View file

@ -1332,6 +1332,9 @@ https://wiki.ddnet.tw/
Tutorial
==
Can't find a Tutorial server
==
Website
==

View file

@ -1337,6 +1337,9 @@ Assets directory
Tutorial
==
Can't find a Tutorial server
==
Server executable not found, can't run server
==

View file

@ -1377,3 +1377,6 @@ auto
Tutorial
==
Can't find a Tutorial server
==

View file

@ -1363,3 +1363,6 @@ auto
Tutorial
== Tutorial
Can't find a Tutorial server
== Tutorial-Server kann nicht gefunden werden

View file

@ -1264,6 +1264,9 @@ https://wiki.ddnet.tw/
Tutorial
==
Can't find a Tutorial server
==
Website
==

View file

@ -1348,3 +1348,6 @@ auto
Tutorial
==
Can't find a Tutorial server
==

View file

@ -1383,5 +1383,8 @@ https://ddnet.tw/discord
Tutorial
==
Can't find a Tutorial server
==
FPM
==

View file

@ -1348,3 +1348,6 @@ Chat command (e.g. showall 1)
Tutorial
==
Can't find a Tutorial server
==

View file

@ -1349,4 +1349,6 @@ auto
== 자동
Tutorial
== 튜토리얼
== 튜토리얼
Can't find a Tutorial server
==

View file

@ -1255,6 +1255,9 @@ https://wiki.ddnet.tw/
Tutorial
==
Can't find a Tutorial server
==
Website
==

View file

@ -1350,3 +1350,6 @@ https://ddnet.tw/discord
Tutorial
==
Can't find a Tutorial server
==

View file

@ -1187,6 +1187,9 @@ https://wiki.ddnet.tw/
Tutorial
==
Can't find a Tutorial server
==
Server executable not found, can't run server
==

View file

@ -1351,3 +1351,6 @@ https://ddnet.tw/discord
Tutorial
==
Can't find a Tutorial server
==

View file

@ -985,8 +985,6 @@ Editor
== Editor
[Start menu]
9+ new mentions
== 9+ novas menções
Successfully saved the replay!
==
@ -1297,6 +1295,9 @@ Assets directory
Tutorial
==
Can't find a Tutorial server
==
Run server
==
@ -1351,3 +1352,6 @@ Grabs
%d new mentions
==
9+ new mentions
==

View file

@ -1270,6 +1270,9 @@ https://wiki.ddnet.tw/
Tutorial
==
Can't find a Tutorial server
==
Website
==

View file

@ -1356,3 +1356,6 @@ Chat command (e.g. showall 1)
Tutorial
==
Can't find a Tutorial server
==

View file

@ -1265,6 +1265,9 @@ https://wiki.ddnet.tw/
Tutorial
==
Can't find a Tutorial server
==
Website
==

View file

@ -1348,3 +1348,6 @@ https://ddnet.tw/discord
Tutorial
==
Can't find a Tutorial server
==

View file

@ -1368,3 +1368,6 @@ auto
Tutorial
== 进入教学
Can't find a Tutorial server
==

View file

@ -1264,6 +1264,9 @@ https://wiki.ddnet.tw/
Tutorial
==
Can't find a Tutorial server
==
Website
==

View file

@ -1358,3 +1358,6 @@ auto
Tutorial
==
Can't find a Tutorial server
==

View file

@ -1350,3 +1350,6 @@ auto
Tutorial
==
Can't find a Tutorial server
==

View file

@ -1361,3 +1361,6 @@ auto
Tutorial
== 進入教學
Can't find a Tutorial server
==

View file

@ -1332,6 +1332,9 @@ https://wiki.ddnet.tw/
Tutorial
==
Can't find a Tutorial server
==
Website
==

View file

@ -1348,3 +1348,6 @@ Chat command (e.g. showall 1)
Tutorial
==
Can't find a Tutorial server
==

View file

@ -66,13 +66,26 @@ void CMenus::RenderStartMenu(CUIRect MainView)
ExtMenu.HSplitBottom(5.0f, &ExtMenu, 0); // little space
ExtMenu.HSplitBottom(20.0f, &ExtMenu, &Button);
static int s_TutorialButton;
if(DoButton_Menu(&s_TutorialButton, Localize("Tutorial"), 0, &Button, 0, CUI::CORNER_ALL, 5.0f, 0.0f, vec4(0.0f, 0.0f, 0.0f, 0.5f), vec4(0.0f, 0.0f, 0.0f, 0.25f)))
static float s_JoinTutorialTime = 0.0f;
if(DoButton_Menu(&s_TutorialButton, Localize("Tutorial"), 0, &Button, 0, CUI::CORNER_ALL, 5.0f, 0.0f, vec4(0.0f, 0.0f, 0.0f, 0.5f), vec4(0.0f, 0.0f, 0.0f, 0.25f)) ||
(s_JoinTutorialTime != 0.0f && Client()->LocalTime() >= s_JoinTutorialTime))
{
const char *pAddr = ServerBrowser()->GetTutorialServer();
if(pAddr)
{
Client()->Connect(pAddr);
s_JoinTutorialTime = 0.0f;
}
else if(s_JoinTutorialTime == 0.0f)
{
dbg_msg("menus", "couldn't find tutorial server, retrying in 5 seconds");
s_JoinTutorialTime = Client()->LocalTime() + 5.0f;
}
else
dbg_msg("menus", "couldn't find tutorial server");
{
PopupWarning(Localize("Warning"), Localize("Can't find a Tutorial server"), Localize("Ok"), 10000000);
s_JoinTutorialTime = 0.0f;
}
m_DoubleClickIndex = -1;
}
@ -145,7 +158,7 @@ void CMenus::RenderStartMenu(CUIRect MainView)
}
static bool EditorHotkeyWasPressed = true;
static float EditorHotKeyChecktime = 0;
static float EditorHotKeyChecktime = 0.0f;
Menu.HSplitBottom(5.0f, &Menu, 0); // little space
Menu.HSplitBottom(40.0f, &Menu, &Button);
static int s_MapEditorButton;