mirror of
https://github.com/osukey/osukey.git
synced 2025-06-08 04:48:04 +09:00
Add a game setting to disable the layer
This commit is contained in:
parent
00c1ff993a
commit
3cae0cedee
@ -87,6 +87,7 @@ namespace osu.Game.Configuration
|
|||||||
Set(OsuSetting.ShowInterface, true);
|
Set(OsuSetting.ShowInterface, true);
|
||||||
Set(OsuSetting.ShowProgressGraph, true);
|
Set(OsuSetting.ShowProgressGraph, true);
|
||||||
Set(OsuSetting.ShowHealthDisplayWhenCantFail, true);
|
Set(OsuSetting.ShowHealthDisplayWhenCantFail, true);
|
||||||
|
Set(OsuSetting.FadePlayfieldWhenHealthLow, true);
|
||||||
Set(OsuSetting.KeyOverlay, false);
|
Set(OsuSetting.KeyOverlay, false);
|
||||||
Set(OsuSetting.ScoreMeter, ScoreMeterType.HitErrorBoth);
|
Set(OsuSetting.ScoreMeter, ScoreMeterType.HitErrorBoth);
|
||||||
|
|
||||||
@ -181,6 +182,7 @@ namespace osu.Game.Configuration
|
|||||||
ShowInterface,
|
ShowInterface,
|
||||||
ShowProgressGraph,
|
ShowProgressGraph,
|
||||||
ShowHealthDisplayWhenCantFail,
|
ShowHealthDisplayWhenCantFail,
|
||||||
|
FadePlayfieldWhenHealthLow,
|
||||||
MouseDisableButtons,
|
MouseDisableButtons,
|
||||||
MouseDisableWheel,
|
MouseDisableWheel,
|
||||||
AudioOffset,
|
AudioOffset,
|
||||||
|
@ -53,6 +53,12 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
|
|||||||
Keywords = new[] { "hp", "bar" }
|
Keywords = new[] { "hp", "bar" }
|
||||||
},
|
},
|
||||||
new SettingsCheckbox
|
new SettingsCheckbox
|
||||||
|
{
|
||||||
|
LabelText = "Fade playfield to red when health is low",
|
||||||
|
Bindable = config.GetBindable<bool>(OsuSetting.FadePlayfieldWhenHealthLow),
|
||||||
|
Keywords = new[] { "hp", "low", "playfield", "red" }
|
||||||
|
},
|
||||||
|
new SettingsCheckbox
|
||||||
{
|
{
|
||||||
LabelText = "Always show key overlay",
|
LabelText = "Always show key overlay",
|
||||||
Bindable = config.GetBindable<bool>(OsuSetting.KeyOverlay)
|
Bindable = config.GetBindable<bool>(OsuSetting.KeyOverlay)
|
||||||
|
@ -3,9 +3,11 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play.HUD
|
namespace osu.Game.Screens.Play.HUD
|
||||||
@ -21,6 +23,8 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
private readonly Box box;
|
private readonly Box box;
|
||||||
|
|
||||||
|
private Bindable<bool> enabled;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The threshold under which the current player life should be considered low and the layer should start fading in.
|
/// The threshold under which the current player life should be considered low and the layer should start fading in.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -37,9 +41,11 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour color)
|
private void load(OsuColour color, OsuConfigManager config)
|
||||||
{
|
{
|
||||||
box.Colour = color.Red;
|
box.Colour = color.Red;
|
||||||
|
enabled = config.GetBindable<bool>(OsuSetting.FadePlayfieldWhenHealthLow);
|
||||||
|
enabled.BindValueChanged(e => this.FadeTo(e.NewValue ? 1 : 0, fade_time, Easing.OutQuint), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user