mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 06:36:31 +09:00
Allow toggling border on & off during gameplay
This commit is contained in:
@ -27,6 +27,7 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
{
|
||||
public class OsuPlayfield : Playfield
|
||||
{
|
||||
private readonly PlayfieldBorder playfieldBorder;
|
||||
private readonly ProxyContainer approachCircles;
|
||||
private readonly ProxyContainer spinnerProxies;
|
||||
private readonly JudgementContainer<DrawableOsuJudgement> judgementLayer;
|
||||
@ -45,6 +46,11 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
{
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
playfieldBorder = new PlayfieldBorder
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Depth = 3
|
||||
},
|
||||
spinnerProxies = new ProxyContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both
|
||||
@ -86,16 +92,12 @@ namespace osu.Game.Rulesets.Osu.UI
|
||||
private void load(OsuConfigManager config)
|
||||
{
|
||||
showPlayfieldBorder = config.GetBindable<bool>(OsuSetting.ShowPlayfieldBorder);
|
||||
|
||||
if (showPlayfieldBorder.Value)
|
||||
{
|
||||
AddInternal(new PlayfieldBorder
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both
|
||||
});
|
||||
}
|
||||
showPlayfieldBorder.BindValueChanged(updateBorderVisibility, true);
|
||||
}
|
||||
|
||||
private void updateBorderVisibility(ValueChangedEvent<bool> settingChange)
|
||||
=> playfieldBorder.State.Value = settingChange.NewValue ? Visibility.Visible : Visibility.Hidden;
|
||||
|
||||
public override void Add(DrawableHitObject h)
|
||||
{
|
||||
h.OnNewResult += onNewResult;
|
||||
|
Reference in New Issue
Block a user