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

Move Playfield Border to OsuPlayfield Ruleset

This commit is contained in:
Yao Chung Hu 2020-07-10 07:36:21 -05:00
parent 0d95b768aa
commit d40f209f4b
4 changed files with 25 additions and 28 deletions

View File

@ -12,6 +12,10 @@ using osu.Game.Rulesets.UI;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Osu.UI.Cursor;
using osu.Game.Skinning;
using osu.Framework.Allocation;
using osu.Game.Configuration;
using osu.Framework.Bindables;
using osu.Game.Screens;
namespace osu.Game.Rulesets.Osu.UI
{
@ -26,6 +30,8 @@ namespace osu.Game.Rulesets.Osu.UI
protected override GameplayCursorContainer CreateCursor() => new OsuCursorContainer();
private Bindable<bool> showPlayfieldBorder;
public OsuPlayfield()
{
InternalChildren = new Drawable[]
@ -56,6 +62,19 @@ namespace osu.Game.Rulesets.Osu.UI
hitPolicy = new OrderedHitPolicy(HitObjectContainer);
}
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
showPlayfieldBorder = config.GetBindable<bool>(OsuSetting.ShowPlayfieldBorder);
if (showPlayfieldBorder.Value)
{
AddInternal(new PlayfieldBorder
{
RelativeSizeAxes = Axes.Both
});
}
}
public override void Add(DrawableHitObject h)
{
h.OnNewResult += onNewResult;

View File

@ -99,8 +99,7 @@ namespace osu.Game.Configuration
Set(OsuSetting.IncreaseFirstObjectVisibility, true);
Set(OsuSetting.ShowPlayfieldArea, false);
Set(OsuSetting.PlayfieldAreaDimLevel, 0.1, 0, 1, 0.01);
Set(OsuSetting.ShowPlayfieldBorder, false);
// Update
Set(OsuSetting.ReleaseStream, ReleaseStream.Lazer);
@ -231,7 +230,6 @@ namespace osu.Game.Configuration
UIHoldActivationDelay,
HitLighting,
MenuBackgroundSource,
ShowPlayfieldArea,
PlayfieldAreaDimLevel
ShowPlayfieldBorder
}
}

View File

@ -79,16 +79,9 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
},
new SettingsCheckbox
{
LabelText = "Show playfield area",
Bindable = config.GetBindable<bool>(OsuSetting.ShowPlayfieldArea)
},
new SettingsSlider<double>
{
LabelText = "Playfield area dim",
Bindable = config.GetBindable<double>(OsuSetting.PlayfieldAreaDimLevel),
KeyboardStep = 0.01f,
DisplayAsPercentage = true
},
LabelText = "Show playfield border",
Bindable = config.GetBindable<bool>(OsuSetting.ShowPlayfieldBorder)
}
};
}
}

View File

@ -14,11 +14,9 @@ namespace osu.Game.Screens.Play.PlayerSettings
private readonly PlayerSliderBar<double> dimSliderBar;
private readonly PlayerSliderBar<double> blurSliderBar;
private readonly PlayerSliderBar<double> playfieldAreaDimSliderBar;
private readonly PlayerCheckbox showStoryboardToggle;
private readonly PlayerCheckbox beatmapSkinsToggle;
private readonly PlayerCheckbox beatmapHitsoundsToggle;
private readonly PlayerCheckbox showPlayfieldAreaToggle;
public VisualSettings()
{
@ -41,21 +39,12 @@ namespace osu.Game.Screens.Play.PlayerSettings
DisplayAsPercentage = true
},
new OsuSpriteText
{
Text = "Playfieldd area dim:"
},
playfieldAreaDimSliderBar = new PlayerSliderBar<double>
{
DisplayAsPercentage = true
},
new OsuSpriteText
{
Text = "Toggles:"
},
showStoryboardToggle = new PlayerCheckbox { LabelText = "Storyboard / Video" },
beatmapSkinsToggle = new PlayerCheckbox { LabelText = "Beatmap skins" },
beatmapHitsoundsToggle = new PlayerCheckbox { LabelText = "Beatmap hitsounds" },
showPlayfieldAreaToggle = new PlayerCheckbox { LabelText = "Show playfield area" }
beatmapHitsoundsToggle = new PlayerCheckbox { LabelText = "Beatmap hitsounds" }
};
}
@ -64,11 +53,9 @@ namespace osu.Game.Screens.Play.PlayerSettings
{
dimSliderBar.Bindable = config.GetBindable<double>(OsuSetting.DimLevel);
blurSliderBar.Bindable = config.GetBindable<double>(OsuSetting.BlurLevel);
playfieldAreaDimSliderBar.Bindable = config.GetBindable<double>(OsuSetting.PlayfieldAreaDimLevel);
showStoryboardToggle.Current = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
beatmapSkinsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapSkins);
beatmapHitsoundsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapHitsounds);
showPlayfieldAreaToggle.Current = config.GetBindable<bool>(OsuSetting.ShowPlayfieldArea);
}
}
}