mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 09:27:29 +08:00
Find video by recursive check rather than marker interface
Seems a lot more reliable, and allows falling back to the "main" video in cases which didn't support this previously. A next step may be to allow every screen to support a video based on its screen name, rather than specifying the local `TourneyVideo` every time.
This commit is contained in:
parent
00c7101f54
commit
73e924479f
@ -22,6 +22,8 @@ namespace osu.Game.Tournament.Components
|
||||
private Video video;
|
||||
private ManualClock manualClock;
|
||||
|
||||
public bool VideoAvailable => video != null;
|
||||
|
||||
public TourneyVideo(string filename, bool drawFallbackGradient = false)
|
||||
{
|
||||
this.filename = filename;
|
||||
|
@ -24,7 +24,7 @@ using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Tournament.Screens.Drawings
|
||||
{
|
||||
public class DrawingsScreen : TournamentScreen, IProvideVideo
|
||||
public class DrawingsScreen : TournamentScreen
|
||||
{
|
||||
private const string results_filename = "drawings_results.txt";
|
||||
|
||||
|
@ -20,7 +20,7 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Tournament.Screens.Editors
|
||||
{
|
||||
public abstract class TournamentEditorScreen<TDrawable, TModel> : TournamentScreen, IProvideVideo
|
||||
public abstract class TournamentEditorScreen<TDrawable, TModel> : TournamentScreen
|
||||
where TDrawable : Drawable, IModelBacked<TModel>
|
||||
where TModel : class, new()
|
||||
{
|
||||
|
@ -21,7 +21,7 @@ using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Tournament.Screens.Gameplay
|
||||
{
|
||||
public class GameplayScreen : BeatmapInfoScreen, IProvideVideo
|
||||
public class GameplayScreen : BeatmapInfoScreen
|
||||
{
|
||||
private readonly BindableBool warmup = new BindableBool();
|
||||
|
||||
|
@ -1,14 +0,0 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace osu.Game.Tournament.Screens
|
||||
{
|
||||
/// <summary>
|
||||
/// Marker interface for a screen which provides its own local video background.
|
||||
/// </summary>
|
||||
public interface IProvideVideo
|
||||
{
|
||||
}
|
||||
}
|
@ -19,7 +19,7 @@ using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Tournament.Screens.Ladder
|
||||
{
|
||||
public class LadderScreen : TournamentScreen, IProvideVideo
|
||||
public class LadderScreen : TournamentScreen
|
||||
{
|
||||
protected Container<DrawableTournamentMatch> MatchesContainer;
|
||||
private Container<Path> paths;
|
||||
|
@ -19,7 +19,7 @@ using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Tournament.Screens.Schedule
|
||||
{
|
||||
public class ScheduleScreen : TournamentScreen // IProvidesVideo
|
||||
public class ScheduleScreen : TournamentScreen
|
||||
{
|
||||
private readonly Bindable<TournamentMatch> currentMatch = new Bindable<TournamentMatch>();
|
||||
private Container mainContainer;
|
||||
|
@ -19,7 +19,7 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Tournament.Screens.Setup
|
||||
{
|
||||
public class SetupScreen : TournamentScreen, IProvideVideo
|
||||
public class SetupScreen : TournamentScreen
|
||||
{
|
||||
private FillFlowContainer fillFlow;
|
||||
|
||||
|
@ -14,7 +14,7 @@ using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Tournament.Screens.Showcase
|
||||
{
|
||||
public class ShowcaseScreen : BeatmapInfoScreen // IProvideVideo
|
||||
public class ShowcaseScreen : BeatmapInfoScreen
|
||||
{
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
|
@ -19,7 +19,7 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Tournament.Screens.TeamIntro
|
||||
{
|
||||
public class SeedingScreen : TournamentMatchScreen, IProvideVideo
|
||||
public class SeedingScreen : TournamentMatchScreen
|
||||
{
|
||||
private Container mainContainer;
|
||||
|
||||
|
@ -13,7 +13,7 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Tournament.Screens.TeamIntro
|
||||
{
|
||||
public class TeamIntroScreen : TournamentMatchScreen, IProvideVideo
|
||||
public class TeamIntroScreen : TournamentMatchScreen
|
||||
{
|
||||
private Container mainContainer;
|
||||
|
||||
|
@ -14,7 +14,7 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Tournament.Screens.TeamWin
|
||||
{
|
||||
public class TeamWinScreen : TournamentMatchScreen, IProvideVideo
|
||||
public class TeamWinScreen : TournamentMatchScreen
|
||||
{
|
||||
private Container mainContainer;
|
||||
|
||||
|
@ -10,6 +10,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Testing;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
@ -186,7 +187,7 @@ namespace osu.Game.Tournament
|
||||
var lastScreen = currentScreen;
|
||||
currentScreen = target;
|
||||
|
||||
if (currentScreen is IProvideVideo)
|
||||
if (currentScreen.ChildrenOfType<TourneyVideo>().FirstOrDefault()?.VideoAvailable == true)
|
||||
{
|
||||
video.FadeOut(200);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user