Basic partial replay support.

This commit is contained in:
Dean Herbert
2017-02-28 20:14:48 +09:00
parent 327300e9a7
commit 58ae9e888d
19 changed files with 984 additions and 40 deletions

View File

@ -1,9 +1,11 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using OpenTK;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input;
using osu.Game.Modes.Objects.Drawables;
namespace osu.Game.Modes.UI
@ -11,7 +13,7 @@ namespace osu.Game.Modes.UI
public abstract class Playfield : Container
{
public HitObjectContainer HitObjects;
private Container<Drawable> content;
private Container<Drawable> scaledContent;
public virtual void Add(DrawableHitObject h) => HitObjects.Add(h);
@ -19,11 +21,20 @@ namespace osu.Game.Modes.UI
protected override Container<Drawable> Content => content;
private Container content;
public Playfield()
{
AddInternal(content = new ScaledContainer()
AddInternal(scaledContent = new ScaledContainer
{
RelativeSizeAxes = Axes.Both,
Children = new[]
{
content = new Container
{
RelativeSizeAxes = Axes.Both,
}
}
});
Add(HitObjects = new HitObjectContainer
@ -32,6 +43,23 @@ namespace osu.Game.Modes.UI
});
}
/// <summary>
/// An optional inputManager to provide interactivity etc.
/// </summary>
public InputManager InputManager;
[BackgroundDependencyLoader]
private void load()
{
if (InputManager != null)
{
//if we've been provided an InputManager, we want it to sit inside the scaledcontainer
scaledContent.Remove(content);
scaledContent.Add(InputManager);
InputManager.Add(content);
}
}
public virtual void PostProcess()
{
}