mirror of
https://github.com/ppy/osu.git
synced 2025-02-20 05:03:20 +08:00
Avoid rendering more than one video at once
This commit is contained in:
parent
86423dce5f
commit
b5c2d94cc4
@ -5,13 +5,12 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Beatmaps.Legacy;
|
||||
using osu.Game.Screens;
|
||||
using osu.Game.Tournament.Components;
|
||||
using osu.Game.Tournament.IPC;
|
||||
|
||||
namespace osu.Game.Tournament.Screens
|
||||
{
|
||||
public abstract class BeatmapInfoScreen : OsuScreen
|
||||
public abstract class BeatmapInfoScreen : TournamentScreen
|
||||
{
|
||||
protected readonly SongBar SongBar;
|
||||
|
||||
|
9
osu.Game.Tournament/Screens/IProvideVideo.cs
Normal file
9
osu.Game.Tournament/Screens/IProvideVideo.cs
Normal file
@ -0,0 +1,9 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
namespace osu.Game.Tournament.Screens
|
||||
{
|
||||
public interface IProvideVideo
|
||||
{
|
||||
}
|
||||
}
|
@ -23,7 +23,7 @@ using SixLabors.Primitives;
|
||||
namespace osu.Game.Tournament.Screens.Ladder
|
||||
{
|
||||
[Cached]
|
||||
public class LadderManager : CompositeDrawable, IHasContextMenu
|
||||
public class LadderManager : TournamentScreen, IHasContextMenu
|
||||
{
|
||||
private Container<DrawableMatchPairing> pairingsContainer;
|
||||
private Container<Path> paths;
|
||||
|
@ -10,7 +10,6 @@ using osu.Framework.Input.Events;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Screens;
|
||||
using osu.Game.Tournament.Components;
|
||||
using osu.Game.Tournament.IPC;
|
||||
using osu.Game.Tournament.Screens.Gameplay;
|
||||
@ -21,7 +20,7 @@ using OpenTK.Input;
|
||||
|
||||
namespace osu.Game.Tournament.Screens.MapPool
|
||||
{
|
||||
public class MapPoolScreen : OsuScreen
|
||||
public class MapPoolScreen : TournamentScreen
|
||||
{
|
||||
private readonly FillFlowContainer<TournamentBeatmapPanel> maps;
|
||||
|
||||
|
@ -10,7 +10,6 @@ using osu.Framework.Graphics.Video;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Screens;
|
||||
using osu.Game.Tournament.Components;
|
||||
using osu.Game.Tournament.Screens.Ladder.Components;
|
||||
using OpenTK;
|
||||
@ -18,7 +17,7 @@ using OpenTK.Graphics;
|
||||
|
||||
namespace osu.Game.Tournament.Screens.TeamIntro
|
||||
{
|
||||
public class TeamIntroScreen : OsuScreen
|
||||
public class TeamIntroScreen : TournamentScreen, IProvideVideo
|
||||
{
|
||||
private Container mainContainer;
|
||||
|
||||
|
@ -29,6 +29,7 @@ namespace osu.Game.Tournament.Screens
|
||||
private DrawingsScreen drawings;
|
||||
private Container screens;
|
||||
private ShowcaseScreen showcase;
|
||||
private VideoSprite video;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(LadderInfo ladder, Storage storage)
|
||||
@ -76,7 +77,7 @@ namespace osu.Game.Tournament.Screens
|
||||
//Masking = true,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new VideoSprite(storage.GetStream("BG Logoless - OWC.m4v"))
|
||||
video = new VideoSprite(storage.GetStream("BG Logoless - OWC.m4v"))
|
||||
{
|
||||
Loop = true,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
@ -107,9 +108,15 @@ namespace osu.Game.Tournament.Screens
|
||||
foreach (var s in screens.Children)
|
||||
{
|
||||
if (s == screen)
|
||||
s.FadeIn(100);
|
||||
{
|
||||
s.Show();
|
||||
if (s is IProvideVideo)
|
||||
video.FadeOut(200);
|
||||
else
|
||||
video.Show();
|
||||
}
|
||||
else
|
||||
s.FadeOut(100);
|
||||
s.Hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
21
osu.Game.Tournament/Screens/TournamentScreen.cs
Normal file
21
osu.Game.Tournament/Screens/TournamentScreen.cs
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Game.Screens;
|
||||
|
||||
namespace osu.Game.Tournament.Screens
|
||||
{
|
||||
public class TournamentScreen : OsuScreen
|
||||
{
|
||||
public override void Hide()
|
||||
{
|
||||
this.FadeOut(200);
|
||||
}
|
||||
|
||||
public override void Show()
|
||||
{
|
||||
this.FadeIn(200);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user