1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 00:02:54 +08:00

Change Box to EditorPlayfieldBorder

This commit is contained in:
Yao Chung Hu 2020-07-09 15:00:26 -05:00
parent 321815f535
commit 8121ccaad0

View File

@ -12,9 +12,8 @@ using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
using osuTK; using osuTK;
using osu.Framework.Graphics.Shapes;
using osuTK.Graphics;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Screens.Edit.Compose.Components;
namespace osu.Game.Rulesets.UI namespace osu.Game.Rulesets.UI
{ {
@ -56,7 +55,7 @@ namespace osu.Game.Rulesets.UI
private Bindable<bool> showPlayfieldArea; private Bindable<bool> showPlayfieldArea;
private Bindable<double> playfieldAreaDimLevel; private Bindable<double> playfieldAreaDimLevel;
private Box playfieldArea; private EditorPlayfieldBorder playfieldArea;
/// <summary> /// <summary>
/// Creates a new <see cref="Playfield"/>. /// Creates a new <see cref="Playfield"/>.
@ -90,16 +89,16 @@ namespace osu.Game.Rulesets.UI
playfieldAreaDimLevel.ValueChanged += _ => UpdateVisuals(); playfieldAreaDimLevel.ValueChanged += _ => UpdateVisuals();
UpdateVisuals(); UpdateVisuals();
} }
protected virtual void UpdateVisuals() protected virtual void UpdateVisuals()
{ {
if(playfieldArea == null) if (playfieldArea == null)
{ {
if (showPlayfieldArea.Value) if (showPlayfieldArea.Value)
{ {
AddInternal(playfieldArea = new Box AddInternal(playfieldArea = new EditorPlayfieldBorder
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = Color4.White,
Alpha = (float)playfieldAreaDimLevel.Value, Alpha = (float)playfieldAreaDimLevel.Value,
}); });
} }