mirror of
https://github.com/ppy/osu
synced 2025-01-03 12:52:10 +00:00
Merge branch 'master' into use-modelbackeddrawable
This commit is contained in:
commit
bc8ce5d188
@ -214,37 +214,6 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
AddAssert("start not requested", () => !startRequested);
|
AddAssert("start not requested", () => !startRequested);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void TestAddNewBeatmapWhileSelectingRandom()
|
|
||||||
{
|
|
||||||
const int test_count = 10;
|
|
||||||
int beatmapChangedCount = 0;
|
|
||||||
int debounceCount = 0;
|
|
||||||
createSongSelect();
|
|
||||||
AddStep("Setup counters", () =>
|
|
||||||
{
|
|
||||||
beatmapChangedCount = 0;
|
|
||||||
debounceCount = 0;
|
|
||||||
songSelect.Carousel.SelectionChanged += _ => beatmapChangedCount++;
|
|
||||||
});
|
|
||||||
AddRepeatStep($"Create beatmaps {test_count} times", () =>
|
|
||||||
{
|
|
||||||
importForRuleset(0);
|
|
||||||
|
|
||||||
Scheduler.AddDelayed(() =>
|
|
||||||
{
|
|
||||||
// Wait for debounce
|
|
||||||
songSelect.Carousel.SelectNextRandom();
|
|
||||||
++debounceCount;
|
|
||||||
}, 400);
|
|
||||||
}, test_count);
|
|
||||||
|
|
||||||
AddUntilStep("Debounce limit reached", () => debounceCount == test_count);
|
|
||||||
|
|
||||||
// The selected beatmap should have changed an additional 2 times since both initially loading songselect and the first import also triggers selectionChanged
|
|
||||||
AddAssert($"Beatmap changed {test_count + 2} times", () => beatmapChangedCount == test_count + 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestHideSetSelectsCorrectBeatmap()
|
public void TestHideSetSelectsCorrectBeatmap()
|
||||||
{
|
{
|
||||||
|
@ -17,11 +17,11 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A button with added default sound effects.
|
/// A button with added default sound effects.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class OsuButton : Button
|
public class OsuButton : Button
|
||||||
{
|
{
|
||||||
private Box hover;
|
private Box hover;
|
||||||
|
|
||||||
protected OsuButton()
|
public OsuButton()
|
||||||
{
|
{
|
||||||
Height = 40;
|
Height = 40;
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ namespace osu.Game
|
|||||||
configSkin.ValueChanged += skinId => SkinManager.CurrentSkinInfo.Value = SkinManager.Query(s => s.ID == skinId.NewValue) ?? SkinInfo.Default;
|
configSkin.ValueChanged += skinId => SkinManager.CurrentSkinInfo.Value = SkinManager.Query(s => s.ID == skinId.NewValue) ?? SkinInfo.Default;
|
||||||
configSkin.TriggerChange();
|
configSkin.TriggerChange();
|
||||||
|
|
||||||
LocalConfig.BindWith(OsuSetting.VolumeInactive, inactiveVolumeAdjust);
|
LocalConfig.BindWith(OsuSetting.VolumeInactive, userInactiveVolume);
|
||||||
|
|
||||||
IsActive.BindValueChanged(active => updateActiveState(active.NewValue), true);
|
IsActive.BindValueChanged(active => updateActiveState(active.NewValue), true);
|
||||||
}
|
}
|
||||||
@ -686,16 +686,28 @@ namespace osu.Game
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly BindableDouble inactiveVolumeAdjust = new BindableDouble();
|
#region Inactive audio dimming
|
||||||
|
|
||||||
|
private readonly BindableDouble userInactiveVolume = new BindableDouble();
|
||||||
|
|
||||||
|
private readonly BindableDouble inactiveVolumeFade = new BindableDouble();
|
||||||
|
|
||||||
private void updateActiveState(bool isActive)
|
private void updateActiveState(bool isActive)
|
||||||
{
|
{
|
||||||
if (isActive)
|
if (isActive)
|
||||||
Audio.RemoveAdjustment(AdjustableProperty.Volume, inactiveVolumeAdjust);
|
{
|
||||||
|
this.TransformBindableTo(inactiveVolumeFade, 1, 500, Easing.OutQuint)
|
||||||
|
.Finally(_ => Audio.RemoveAdjustment(AdjustableProperty.Volume, inactiveVolumeFade)); //wait for the transition to finish to remove the inactive audio adjustment
|
||||||
|
}
|
||||||
else
|
else
|
||||||
Audio.AddAdjustment(AdjustableProperty.Volume, inactiveVolumeAdjust);
|
{
|
||||||
|
Audio.AddAdjustment(AdjustableProperty.Volume, inactiveVolumeFade);
|
||||||
|
this.TransformBindableTo(inactiveVolumeFade, userInactiveVolume.Value, 1500, Easing.OutSine);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
public bool OnReleased(GlobalAction action) => false;
|
public bool OnReleased(GlobalAction action) => false;
|
||||||
|
|
||||||
private Container overlayContent;
|
private Container overlayContent;
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.4" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.4" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.609.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.609.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2019.615.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2019.618.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.23.0" />
|
<PackageReference Include="SharpCompress" Version="0.23.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.12.0" />
|
<PackageReference Include="NUnit" Version="3.12.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
@ -105,8 +105,8 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||||
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.609.0" />
|
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.609.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework" Version="2019.615.0" />
|
<PackageReference Include="ppy.osu.Framework" Version="2019.618.0" />
|
||||||
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.615.0" />
|
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.618.0" />
|
||||||
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
<PackageReference Include="SharpCompress" Version="0.22.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.11.0" />
|
<PackageReference Include="NUnit" Version="3.11.0" />
|
||||||
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
<PackageReference Include="SharpRaven" Version="2.4.0" />
|
||||||
|
Loading…
Reference in New Issue
Block a user