mirror of
https://github.com/ppy/osu.git
synced 2025-02-16 16:23:16 +08:00
Add overlay/underlay
This commit is contained in:
parent
89772f4efd
commit
e8cbde3ae1
@ -22,6 +22,8 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
{
|
{
|
||||||
private readonly Ruleset ruleset;
|
private readonly Ruleset ruleset;
|
||||||
|
|
||||||
|
protected ICompositionTool CurrentTool { get; private set; }
|
||||||
|
|
||||||
protected HitObjectComposer(Ruleset ruleset)
|
protected HitObjectComposer(Ruleset ruleset)
|
||||||
{
|
{
|
||||||
this.ruleset = ruleset;
|
this.ruleset = ruleset;
|
||||||
@ -75,7 +77,9 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
Alpha = 0,
|
Alpha = 0,
|
||||||
AlwaysPresent = true,
|
AlwaysPresent = true,
|
||||||
},
|
},
|
||||||
rulesetContainer
|
CreateUnderlay(rulesetContainer.Playfield),
|
||||||
|
rulesetContainer,
|
||||||
|
CreateOverlay(rulesetContainer.Playfield)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -98,12 +102,14 @@ namespace osu.Game.Rulesets.Edit
|
|||||||
toolboxCollection.Items[0].Select();
|
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 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; }
|
protected abstract IReadOnlyList<ICompositionTool> CompositionTools { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
24
osu.Game/Rulesets/Edit/PlayfieldOverlay.cs
Normal file
24
osu.Game/Rulesets/Edit/PlayfieldOverlay.cs
Normal 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;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
21
osu.Game/Rulesets/Edit/PlayfieldUnderlay.cs
Normal file
21
osu.Game/Rulesets/Edit/PlayfieldUnderlay.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -55,6 +55,11 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
public abstract IEnumerable<HitObject> Objects { get; }
|
public abstract IEnumerable<HitObject> Objects { get; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The playfield.
|
||||||
|
/// </summary>
|
||||||
|
public Playfield Playfield { get; protected set; }
|
||||||
|
|
||||||
protected readonly Ruleset Ruleset;
|
protected readonly Ruleset Ruleset;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -135,11 +140,6 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
public override ScoreProcessor CreateScoreProcessor() => new ScoreProcessor<TObject>(this);
|
public override ScoreProcessor CreateScoreProcessor() => new ScoreProcessor<TObject>(this);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The playfield.
|
|
||||||
/// </summary>
|
|
||||||
public Playfield Playfield { get; private set; }
|
|
||||||
|
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
private Container content;
|
private Container content;
|
||||||
|
|
||||||
|
@ -302,6 +302,8 @@
|
|||||||
<Compile Include="Overlays\Profile\Sections\Ranks\DrawableTotalScore.cs" />
|
<Compile Include="Overlays\Profile\Sections\Ranks\DrawableTotalScore.cs" />
|
||||||
<Compile Include="Overlays\Profile\Sections\Ranks\ScoreModsContainer.cs" />
|
<Compile Include="Overlays\Profile\Sections\Ranks\ScoreModsContainer.cs" />
|
||||||
<Compile Include="Overlays\Settings\SettingsButton.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\BottomBarContainer.cs" />
|
||||||
<Compile Include="Screens\Edit\Components\PlaybackControl.cs" />
|
<Compile Include="Screens\Edit\Components\PlaybackControl.cs" />
|
||||||
<Compile Include="Screens\Edit\Components\TimeInfoContainer.cs" />
|
<Compile Include="Screens\Edit\Components\TimeInfoContainer.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user