mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 15:47:26 +08:00
Rename and Move EditorPlayfieldBorder to PlayfieldBorder for general purpose
This commit is contained in:
parent
8121ccaad0
commit
0d95b768aa
@ -20,6 +20,7 @@ using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Rulesets.UI.Scrolling;
|
||||
using osu.Game.Screens;
|
||||
using osu.Game.Screens.Edit;
|
||||
using osu.Game.Screens.Edit.Components.RadioButtons;
|
||||
using osu.Game.Screens.Edit.Compose;
|
||||
@ -108,7 +109,7 @@ namespace osu.Game.Rulesets.Edit
|
||||
drawableRulesetWrapper.CreatePlayfieldAdjustmentContainer().WithChildren(new Drawable[]
|
||||
{
|
||||
LayerBelowRuleset,
|
||||
new EditorPlayfieldBorder { RelativeSizeAxes = Axes.Both }
|
||||
new PlayfieldBorder { RelativeSizeAxes = Axes.Both }
|
||||
}),
|
||||
drawableRulesetWrapper,
|
||||
// layers above playfield
|
||||
|
@ -12,8 +12,6 @@ using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Rulesets.Mods;
|
||||
using osuTK;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Screens.Edit.Compose.Components;
|
||||
|
||||
namespace osu.Game.Rulesets.UI
|
||||
{
|
||||
@ -53,10 +51,6 @@ namespace osu.Game.Rulesets.UI
|
||||
/// </summary>
|
||||
public readonly BindableBool DisplayJudgements = new BindableBool(true);
|
||||
|
||||
private Bindable<bool> showPlayfieldArea;
|
||||
private Bindable<double> playfieldAreaDimLevel;
|
||||
private EditorPlayfieldBorder playfieldArea;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Playfield"/>.
|
||||
/// </summary>
|
||||
@ -71,7 +65,7 @@ namespace osu.Game.Rulesets.UI
|
||||
private IReadOnlyList<Mod> mods { get; set; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config)
|
||||
private void load()
|
||||
{
|
||||
Cursor = CreateCursor();
|
||||
|
||||
@ -82,38 +76,6 @@ namespace osu.Game.Rulesets.UI
|
||||
|
||||
AddInternal(Cursor);
|
||||
}
|
||||
|
||||
showPlayfieldArea = config.GetBindable<bool>(OsuSetting.ShowPlayfieldArea);
|
||||
playfieldAreaDimLevel = config.GetBindable<double>(OsuSetting.PlayfieldAreaDimLevel);
|
||||
showPlayfieldArea.ValueChanged += _ => UpdateVisuals();
|
||||
playfieldAreaDimLevel.ValueChanged += _ => UpdateVisuals();
|
||||
UpdateVisuals();
|
||||
}
|
||||
|
||||
protected virtual void UpdateVisuals()
|
||||
{
|
||||
if (playfieldArea == null)
|
||||
{
|
||||
if (showPlayfieldArea.Value)
|
||||
{
|
||||
AddInternal(playfieldArea = new EditorPlayfieldBorder
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Alpha = (float)playfieldAreaDimLevel.Value,
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (showPlayfieldArea.Value)
|
||||
{
|
||||
playfieldArea.Alpha = (float)playfieldAreaDimLevel.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
playfieldArea.Alpha = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -6,14 +6,14 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Screens.Edit.Compose.Components
|
||||
namespace osu.Game.Screens
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides a border around the playfield.
|
||||
/// </summary>
|
||||
public class EditorPlayfieldBorder : CompositeDrawable
|
||||
public class PlayfieldBorder : CompositeDrawable
|
||||
{
|
||||
public EditorPlayfieldBorder()
|
||||
public PlayfieldBorder()
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
|
Loading…
Reference in New Issue
Block a user