add ability to change the S_AllowCam7DuringWaitingScreen value during the Waiting Screen

This commit is contained in:
Beu 2021-11-01 11:05:09 +01:00
parent c2f2381112
commit 014a25d303

View File

@ -193,11 +193,8 @@ if (Map_Starts.count > 0) {
MB_StopMap(); MB_StopMap();
} }
// We use `>= 0` and not `> 0` here because the waiting screen // Waiting screen
// has two steps. First waiting for the presence of at least one player. declare Integer WaitingScreenDuration = 0;
// Then waiting the desired amount of time. With `>= 0` we can have
// the first step without the second.
declare Integer WaitingScreenDuration = S_RoundWaitingScreenDuration;
if (WaitingScreenDuration >= 0) { if (WaitingScreenDuration >= 0) {
if (S_AllowCam7DuringWaitingScreen) ModeUtils::PushAndApplyUISequence(UIManager.UIAll, CUIConfig::EUISequence::Playing); if (S_AllowCam7DuringWaitingScreen) ModeUtils::PushAndApplyUISequence(UIManager.UIAll, CUIConfig::EUISequence::Playing);
else ModeUtils::PushAndApplyUISequence(UIManager.UIAll, CUIConfig::EUISequence::RollingBackgroundIntro); else ModeUtils::PushAndApplyUISequence(UIManager.UIAll, CUIConfig::EUISequence::RollingBackgroundIntro);
@ -210,14 +207,14 @@ if (WaitingScreenDuration >= 0) {
// If all players are connected before the end of the countdown start immediatly // If all players are connected before the end of the countdown start immediatly
declare Integer WaitEndTime = Now + (WaitingScreenDuration * 1000); declare Integer WaitEndTime = Now + (WaitingScreenDuration * 1000);
while (WaitingScreenDuration > 0) { while (S_RoundWaitingScreenDuration - WaitingScreenDuration > 0) {
if (WaitingScreenDuration > 3) { if (S_RoundWaitingScreenDuration - WaitingScreenDuration > 3) {
UIModules_BigMessage::SetMessage("""The map starts in {{{WaitingScreenDuration}}} seconds"""); UIModules_BigMessage::SetMessage("""The map starts in {{{S_RoundWaitingScreenDuration - WaitingScreenDuration}}} seconds""");
} else { } else {
UIModules_BigMessage::SetMessage(""); UIModules_BigMessage::SetMessage("");
UIManager.UIAll.BigMessage = """The map starts in {{{WaitingScreenDuration}}} seconds"""; UIManager.UIAll.BigMessage = """The map starts in {{{S_RoundWaitingScreenDuration - WaitingScreenDuration}}} seconds""";
} }
WaitingScreenDuration = WaitingScreenDuration - 1; WaitingScreenDuration = WaitingScreenDuration + 1;
MB_Sleep(1000); MB_Sleep(1000);
} }
UIManager.UIAll.BigMessage = ""; UIManager.UIAll.BigMessage = "";