1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:37:28 +08:00

Remove toggle and change method of application to blend with original colour

This commit is contained in:
Dean Herbert 2022-11-02 13:08:29 +09:00
parent a01602e63c
commit 2f3c80f884
3 changed files with 8 additions and 20 deletions

View File

@ -175,8 +175,7 @@ namespace osu.Game.Configuration
SetDefault(OsuSetting.LastProcessedMetadataId, -1);
SetDefault(OsuSetting.NormaliseComboColourBrightness, false);
SetDefault(OsuSetting.ComboColourBrightness, 0.7f, 0f, 1f);
SetDefault(OsuSetting.ComboColourBrightness, 0f, -1f, 1f, 1f);
}
protected override bool CheckLookupContainsPrivateInformation(OsuSetting lookup)
@ -367,7 +366,6 @@ namespace osu.Game.Configuration
AutomaticallyDownloadWhenSpectating,
ShowOnlineExplicitContent,
LastProcessedMetadataId,
NormaliseComboColourBrightness,
SafeAreaConsiderations,
ComboColourBrightness,
}

View File

@ -17,13 +17,11 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
protected override LocalisableString Header => GameplaySettingsStrings.BeatmapHeader;
private readonly BindableFloat comboColourBrightness = new BindableFloat();
private readonly BindableBool normaliseComboColourBrightness = new BindableBool();
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
config.BindWith(OsuSetting.ComboColourBrightness, comboColourBrightness);
config.BindWith(OsuSetting.NormaliseComboColourBrightness, normaliseComboColourBrightness);
Children = new Drawable[]
{
@ -47,11 +45,6 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
LabelText = GraphicsSettingsStrings.StoryboardVideo,
Current = config.GetBindable<bool>(OsuSetting.ShowStoryboard)
},
new SettingsCheckbox
{
LabelText = "Normalise combo colour brightness",
Current = normaliseComboColourBrightness
},
new SettingsSlider<float>
{
LabelText = "Combo colour brightness",
@ -60,12 +53,5 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
}
};
}
protected override void LoadComplete()
{
base.LoadComplete();
normaliseComboColourBrightness.BindValueChanged(normalise => comboColourBrightness.Disabled = !normalise.NewValue, true);
}
}
}

View File

@ -15,6 +15,7 @@ using osu.Framework.Extensions.TypeExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Threading;
using osu.Framework.Utils;
using osu.Game.Audio;
using osu.Game.Configuration;
using osu.Game.Graphics;
@ -174,7 +175,6 @@ namespace osu.Game.Rulesets.Objects.Drawables
private void load(OsuConfigManager config, ISkinSource skinSource)
{
config.BindWith(OsuSetting.PositionalHitsoundsLevel, positionalHitsoundsLevel);
config.BindWith(OsuSetting.NormaliseComboColourBrightness, normaliseComboColourBrightness);
config.BindWith(OsuSetting.ComboColourBrightness, comboColourBrightness);
// Explicit non-virtual function call in case a DrawableHitObject overrides AddInternal.
@ -522,8 +522,12 @@ namespace osu.Game.Rulesets.Objects.Drawables
Color4 colour = combo.GetComboColour(CurrentSkin);
// Normalise the combo colour to the given brightness level.
if (normaliseComboColourBrightness.Value)
colour = new HSPAColour(colour) { P = comboColourBrightness.Value }.ToColor4();
if (comboColourBrightness.Value != 0)
{
float pAdjust = 0.6f + 0.4f * comboColourBrightness.Value;
colour = Interpolation.ValueAt(Math.Abs(comboColourBrightness.Value), colour, new HSPAColour(colour) { P = pAdjust }.ToColor4(), 0, 1, Easing.Out);
}
AccentColour.Value = colour;
}