mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Basic partial replay support.
This commit is contained in:
@ -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()
|
||||
{
|
||||
}
|
||||
|
Reference in New Issue
Block a user