1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-16 13:02:55 +08:00

Merge pull request #20041 from peppy/tournament-auto-progress-toggle

Add toggle for tournament client "auto progression" behaviour
This commit is contained in:
Dan Balasescu 2022-08-31 15:55:19 +09:00 committed by GitHub
commit 0e4411a2fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 12 deletions

View File

@ -40,5 +40,7 @@ namespace osu.Game.Tournament.Models
MinValue = 3, MinValue = 3,
MaxValue = 4, MaxValue = 4,
}; };
public Bindable<bool> AutoProgressScreens = new BindableBool(true);
} }
} }

View File

@ -199,16 +199,19 @@ namespace osu.Game.Tournament.Screens.Gameplay
case TourneyState.Idle: case TourneyState.Idle:
contract(); contract();
const float delay_before_progression = 4000; if (LadderInfo.AutoProgressScreens.Value)
// if we've returned to idle and the last screen was ranking
// we should automatically proceed after a short delay
if (lastState == TourneyState.Ranking && !warmup.Value)
{ {
if (CurrentMatch.Value?.Completed.Value == true) const float delay_before_progression = 4000;
scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(TeamWinScreen)); }, delay_before_progression);
else if (CurrentMatch.Value?.Completed.Value == false) // if we've returned to idle and the last screen was ranking
scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(MapPoolScreen)); }, delay_before_progression); // we should automatically proceed after a short delay
if (lastState == TourneyState.Ranking && !warmup.Value)
{
if (CurrentMatch.Value?.Completed.Value == true)
scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(TeamWinScreen)); }, delay_before_progression);
else if (CurrentMatch.Value?.Completed.Value == false)
scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(MapPoolScreen)); }, delay_before_progression);
}
} }
break; break;

View File

@ -197,10 +197,13 @@ namespace osu.Game.Tournament.Screens.MapPool
setNextMode(); setNextMode();
if (pickType == ChoiceType.Pick && CurrentMatch.Value.PicksBans.Any(i => i.Type == ChoiceType.Pick)) if (LadderInfo.AutoProgressScreens.Value)
{ {
scheduledChange?.Cancel(); if (pickType == ChoiceType.Pick && CurrentMatch.Value.PicksBans.Any(i => i.Type == ChoiceType.Pick))
scheduledChange = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(GameplayScreen)); }, 10000); {
scheduledChange?.Cancel();
scheduledChange = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(GameplayScreen)); }, 10000);
}
} }
} }

View File

@ -131,6 +131,12 @@ namespace osu.Game.Tournament.Screens.Setup
windowSize.Value = new Size((int)(height * aspect_ratio / TournamentSceneManager.STREAM_AREA_WIDTH * TournamentSceneManager.REQUIRED_WIDTH), height); windowSize.Value = new Size((int)(height * aspect_ratio / TournamentSceneManager.STREAM_AREA_WIDTH * TournamentSceneManager.REQUIRED_WIDTH), height);
} }
}, },
new LabelledSwitchButton
{
Label = "Auto advance screens",
Description = "Screens will progress automatically from gameplay -> results -> map pool",
Current = LadderInfo.AutoProgressScreens,
},
}; };
} }