1
0
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:
Yao Chung Hu 2020-07-10 07:34:48 -05:00
parent 8121ccaad0
commit 0d95b768aa
3 changed files with 6 additions and 43 deletions

View File

@ -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

View File

@ -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>

View File

@ -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;