1
0
mirror of https://github.com/ppy/osu synced 2024-12-22 06:50:42 +00:00

Merge branch 'master' into use-modelbackeddrawable

This commit is contained in:
Dean Herbert 2019-06-19 06:27:36 +09:00 committed by GitHub
commit bc8ce5d188
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 40 deletions
osu.Game.Tests/Visual/SongSelect
osu.Game
osu.iOS.props

View File

@ -214,37 +214,6 @@ namespace osu.Game.Tests.Visual.SongSelect
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]
public void TestHideSetSelectsCorrectBeatmap()
{

View File

@ -17,11 +17,11 @@ namespace osu.Game.Graphics.UserInterface
/// <summary>
/// A button with added default sound effects.
/// </summary>
public abstract class OsuButton : Button
public class OsuButton : Button
{
private Box hover;
protected OsuButton()
public OsuButton()
{
Height = 40;

View File

@ -181,7 +181,7 @@ namespace osu.Game
configSkin.ValueChanged += skinId => SkinManager.CurrentSkinInfo.Value = SkinManager.Query(s => s.ID == skinId.NewValue) ?? SkinInfo.Default;
configSkin.TriggerChange();
LocalConfig.BindWith(OsuSetting.VolumeInactive, inactiveVolumeAdjust);
LocalConfig.BindWith(OsuSetting.VolumeInactive, userInactiveVolume);
IsActive.BindValueChanged(active => updateActiveState(active.NewValue), true);
}
@ -686,16 +686,28 @@ namespace osu.Game
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)
{
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
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;
private Container overlayContent;

View File

@ -15,7 +15,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.4" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<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="NUnit" Version="3.12.0" />
<PackageReference Include="SharpRaven" Version="2.4.0" />

View File

@ -105,8 +105,8 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.609.0" />
<PackageReference Include="ppy.osu.Framework" Version="2019.615.0" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.615.0" />
<PackageReference Include="ppy.osu.Framework" Version="2019.618.0" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.618.0" />
<PackageReference Include="SharpCompress" Version="0.22.0" />
<PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="SharpRaven" Version="2.4.0" />