Add overlay/underlay

This commit is contained in:
smoogipoo 2017-11-30 21:56:12 +09:00
parent 89772f4efd
commit e8cbde3ae1
5 changed files with 62 additions and 9 deletions

View File

@ -22,6 +22,8 @@ namespace osu.Game.Rulesets.Edit
{
private readonly Ruleset ruleset;
protected ICompositionTool CurrentTool { get; private set; }
protected HitObjectComposer(Ruleset ruleset)
{
this.ruleset = ruleset;
@ -75,7 +77,9 @@ namespace osu.Game.Rulesets.Edit
Alpha = 0,
AlwaysPresent = true,
},
rulesetContainer
CreateUnderlay(rulesetContainer.Playfield),
rulesetContainer,
CreateOverlay(rulesetContainer.Playfield)
}
}
},
@ -98,12 +102,14 @@ namespace osu.Game.Rulesets.Edit
toolboxCollection.Items[0].Select();
}
private void setCompositionTool(ICompositionTool tool)
{
}
private void setCompositionTool(ICompositionTool tool) => CurrentTool = tool;
protected virtual RulesetContainer CreateRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap) => ruleset.CreateRulesetContainerWith(beatmap, true);
protected virtual PlayfieldUnderlay CreateUnderlay(Playfield playfield) => new PlayfieldUnderlay(playfield);
protected virtual PlayfieldOverlay CreateOverlay(Playfield playfield) => new PlayfieldOverlay(playfield);
protected abstract IReadOnlyList<ICompositionTool> CompositionTools { get; }
}
}

View File

@ -0,0 +1,24 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.UI;
namespace osu.Game.Rulesets.Edit
{
public class PlayfieldOverlay : CompositeDrawable
{
private Playfield playfield;
public PlayfieldOverlay(Playfield playfield)
{
this.playfield = playfield;
RelativeSizeAxes = Axes.Both;
}
}
}

View File

@ -0,0 +1,21 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.UI;
namespace osu.Game.Rulesets.Edit
{
public class PlayfieldUnderlay : CompositeDrawable
{
private readonly Playfield playfield;
public PlayfieldUnderlay(Playfield playfield)
{
this.playfield = playfield;
RelativeSizeAxes = Axes.Both;
}
}
}

View File

@ -55,6 +55,11 @@ namespace osu.Game.Rulesets.UI
public abstract IEnumerable<HitObject> Objects { get; }
/// <summary>
/// The playfield.
/// </summary>
public Playfield Playfield { get; protected set; }
protected readonly Ruleset Ruleset;
/// <summary>
@ -135,11 +140,6 @@ namespace osu.Game.Rulesets.UI
public override ScoreProcessor CreateScoreProcessor() => new ScoreProcessor<TObject>(this);
/// <summary>
/// The playfield.
/// </summary>
public Playfield Playfield { get; private set; }
protected override Container<Drawable> Content => content;
private Container content;

View File

@ -302,6 +302,8 @@
<Compile Include="Overlays\Profile\Sections\Ranks\DrawableTotalScore.cs" />
<Compile Include="Overlays\Profile\Sections\Ranks\ScoreModsContainer.cs" />
<Compile Include="Overlays\Settings\SettingsButton.cs" />
<Compile Include="Rulesets\Edit\PlayfieldOverlay.cs" />
<Compile Include="Rulesets\Edit\PlayfieldUnderlay.cs" />
<Compile Include="Screens\Edit\Components\BottomBarContainer.cs" />
<Compile Include="Screens\Edit\Components\PlaybackControl.cs" />
<Compile Include="Screens\Edit\Components\TimeInfoContainer.cs" />