Fix test failures and rename configuration value to match better

This commit is contained in:
Dean Herbert
2022-11-02 18:14:20 +09:00
parent 71c507d80c
commit 3ec9686e58
6 changed files with 20 additions and 6 deletions

View File

@ -31,6 +31,8 @@ namespace osu.Game.Rulesets.Osu.Tests
{
config.BindWith(OsuSetting.BeatmapSkins, BeatmapSkins);
config.BindWith(OsuSetting.BeatmapColours, BeatmapColours);
config.SetValue(OsuSetting.ComboColourNormalisationAmount, 0f);
}
[TestCase(true, true)]

View File

@ -6,6 +6,7 @@
using System;
using System.Collections.Generic;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Audio.Sample;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
@ -13,6 +14,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Textures;
using osu.Framework.Testing;
using osu.Game.Audio;
using osu.Game.Configuration;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Objects.Legacy;
using osu.Game.Rulesets.Objects.Types;
@ -25,10 +27,20 @@ namespace osu.Game.Tests.Gameplay
[HeadlessTest]
public class TestSceneHitObjectAccentColour : OsuTestScene
{
[Resolved]
private OsuConfigManager config { get; set; }
private Container skinContainer;
[SetUp]
public void Setup() => Schedule(() => Child = skinContainer = new SkinProvidingContainer(new TestSkin()));
public void Setup()
{
Schedule(() =>
{
config.SetValue(OsuSetting.ComboColourNormalisationAmount, 0f);
Child = skinContainer = new SkinProvidingContainer(new TestSkin());
});
}
[Test]
public void TestChangeComboIndexBeforeLoad()

View File

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

View File

@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Settings.Sections.Gameplay
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
{
config.BindWith(OsuSetting.ComboColourNormalisation, comboColourNormalisation);
config.BindWith(OsuSetting.ComboColourNormalisationAmount, comboColourNormalisation);
Children = new Drawable[]
{

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.ComboColourNormalisation, comboColourBrightness);
config.BindWith(OsuSetting.ComboColourNormalisationAmount, comboColourBrightness);
// Explicit non-virtual function call in case a DrawableHitObject overrides AddInternal.
base.AddInternal(Samples = new PausableSkinnableSound());

View File

@ -51,7 +51,7 @@ namespace osu.Game.Screens.Play.PlayerSettings
showStoryboardToggle.Current = config.GetBindable<bool>(OsuSetting.ShowStoryboard);
beatmapSkinsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapSkins);
beatmapColorsToggle.Current = config.GetBindable<bool>(OsuSetting.BeatmapColours);
comboColourNormalisationSliderBar.Current = config.GetBindable<float>(OsuSetting.ComboColourNormalisation);
comboColourNormalisationSliderBar.Current = config.GetBindable<float>(OsuSetting.ComboColourNormalisationAmount);
}
}
}