From 5907e0d1eb590dfbd55f79843dd31a041d78f3c0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 5 Jul 2024 18:38:24 +0900 Subject: [PATCH] Make `DuckDuration` non-zero by default --- osu.Game.Tests/Visual/Menus/TestAudioDucking.cs | 5 +---- osu.Game/Collections/ManageCollectionsDialog.cs | 2 +- osu.Game/Overlays/DialogOverlay.cs | 2 +- osu.Game/Overlays/MusicController.cs | 4 ++-- osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs | 2 +- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/osu.Game.Tests/Visual/Menus/TestAudioDucking.cs b/osu.Game.Tests/Visual/Menus/TestAudioDucking.cs index e704fc0e83..459bdd3e2e 100644 --- a/osu.Game.Tests/Visual/Menus/TestAudioDucking.cs +++ b/osu.Game.Tests/Visual/Menus/TestAudioDucking.cs @@ -13,10 +13,7 @@ namespace osu.Game.Tests.Visual.Menus [Test] public void TestMomentaryDuck() { - AddStep("duck momentarily", () => Game.MusicController.DuckMomentarily(1000, new DuckParameters - { - DuckDuration = 300, - })); + AddStep("duck momentarily", () => Game.MusicController.DuckMomentarily(1000)); } [Test] diff --git a/osu.Game/Collections/ManageCollectionsDialog.cs b/osu.Game/Collections/ManageCollectionsDialog.cs index 11d50f3ce4..9f8158af53 100644 --- a/osu.Game/Collections/ManageCollectionsDialog.cs +++ b/osu.Game/Collections/ManageCollectionsDialog.cs @@ -127,8 +127,8 @@ namespace osu.Game.Collections { duckOperation = musicController?.Duck(new DuckParameters { - DuckDuration = 100, DuckVolumeTo = 1, + DuckDuration = 100, RestoreDuration = 100, }); diff --git a/osu.Game/Overlays/DialogOverlay.cs b/osu.Game/Overlays/DialogOverlay.cs index 97d77ae2d3..4e7aff84bc 100644 --- a/osu.Game/Overlays/DialogOverlay.cs +++ b/osu.Game/Overlays/DialogOverlay.cs @@ -108,8 +108,8 @@ namespace osu.Game.Overlays { duckOperation = musicController?.Duck(new DuckParameters { - DuckDuration = 100, DuckVolumeTo = 1, + DuckDuration = 100, RestoreDuration = 100, }); } diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 8fa77b6153..c4817a8f26 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -486,9 +486,9 @@ namespace osu.Game.Overlays { /// /// The duration of the ducking transition in milliseconds. - /// Defaults to no duration (immediate ducking). + /// Defaults to 100 ms. /// - public double DuckDuration = 0; + public double DuckDuration = 100; /// /// The final volume which should be reached during ducking, when 0 is silent and 1 is original volume. diff --git a/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs index 796477f9f6..05ab505417 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarRulesetSelector.cs @@ -122,7 +122,7 @@ namespace osu.Game.Overlays.Toolbar rulesetSelectionChannel[r.NewValue] = channel; channel.Play(); - musicController?.DuckMomentarily(500); + musicController?.DuckMomentarily(500, new DuckParameters { DuckDuration = 0 }); } public override bool HandleNonPositionalInput => !Current.Disabled && base.HandleNonPositionalInput;