Change range to 0-100% and rename to "normalisation"

This commit is contained in:
Dean Herbert 2022-11-02 13:46:50 +09:00
parent 2f3c80f884
commit 99ba7c29dd
3 changed files with 8 additions and 10 deletions

View File

@ -175,7 +175,7 @@ namespace osu.Game.Configuration
SetDefault(OsuSetting.LastProcessedMetadataId, -1);
SetDefault(OsuSetting.ComboColourBrightness, 0f, -1f, 1f, 1f);
SetDefault(OsuSetting.ComboColourNormalisation, 0.2f, 0f, 1f, 0.01f);
}
protected override bool CheckLookupContainsPrivateInformation(OsuSetting lookup)
@ -367,6 +367,6 @@ namespace osu.Game.Configuration
ShowOnlineExplicitContent,
LastProcessedMetadataId,
SafeAreaConsiderations,
ComboColourBrightness,
ComboColourNormalisation,
}
}

View File

@ -16,12 +16,12 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
{
protected override LocalisableString Header => GameplaySettingsStrings.BeatmapHeader;
private readonly BindableFloat comboColourBrightness = new BindableFloat();
private readonly BindableFloat comboColourNormalisation = new BindableFloat();
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
config.BindWith(OsuSetting.ComboColourBrightness, comboColourBrightness);
config.BindWith(OsuSetting.ComboColourNormalisation, comboColourNormalisation);
Children = new Drawable[]
{
@ -47,8 +47,8 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
},
new SettingsSlider<float>
{
LabelText = "Combo colour brightness",
Current = comboColourBrightness,
LabelText = "Combo colour normalisation",
Current = comboColourNormalisation,
DisplayAsPercentage = true,
}
};

View File

@ -175,7 +175,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
private void load(OsuConfigManager config, ISkinSource skinSource)
{
config.BindWith(OsuSetting.PositionalHitsoundsLevel, positionalHitsoundsLevel);
config.BindWith(OsuSetting.ComboColourBrightness, comboColourBrightness);
config.BindWith(OsuSetting.ComboColourNormalisation, comboColourBrightness);
// Explicit non-virtual function call in case a DrawableHitObject overrides AddInternal.
base.AddInternal(Samples = new PausableSkinnableSound());
@ -524,9 +524,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
// Normalise the combo colour to the given brightness level.
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);
colour = Interpolation.ValueAt(Math.Abs(comboColourBrightness.Value), colour, new HSPAColour(colour) { P = 0.6f }.ToColor4(), 0, 1);
}
AccentColour.Value = colour;