1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-19 23:22:56 +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,6 +199,8 @@ namespace osu.Game.Tournament.Screens.Gameplay
case TourneyState.Idle: case TourneyState.Idle:
contract(); contract();
if (LadderInfo.AutoProgressScreens.Value)
{
const float delay_before_progression = 4000; const float delay_before_progression = 4000;
// if we've returned to idle and the last screen was ranking // if we've returned to idle and the last screen was ranking
@ -210,6 +212,7 @@ namespace osu.Game.Tournament.Screens.Gameplay
else if (CurrentMatch.Value?.Completed.Value == false) else if (CurrentMatch.Value?.Completed.Value == false)
scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(MapPoolScreen)); }, delay_before_progression); scheduledOperation = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(MapPoolScreen)); }, delay_before_progression);
} }
}
break; break;

View File

@ -197,12 +197,15 @@ namespace osu.Game.Tournament.Screens.MapPool
setNextMode(); setNextMode();
if (LadderInfo.AutoProgressScreens.Value)
{
if (pickType == ChoiceType.Pick && CurrentMatch.Value.PicksBans.Any(i => i.Type == ChoiceType.Pick)) if (pickType == ChoiceType.Pick && CurrentMatch.Value.PicksBans.Any(i => i.Type == ChoiceType.Pick))
{ {
scheduledChange?.Cancel(); scheduledChange?.Cancel();
scheduledChange = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(GameplayScreen)); }, 10000); scheduledChange = Scheduler.AddDelayed(() => { sceneManager?.SetScreen(typeof(GameplayScreen)); }, 10000);
} }
} }
}
protected override void CurrentMatchChanged(ValueChangedEvent<TournamentMatch> match) protected override void CurrentMatchChanged(ValueChangedEvent<TournamentMatch> match)
{ {

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,
},
}; };
} }