1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 18:42:56 +08:00

Enable NRT in VolumeOverlay

This commit is contained in:
Salman Ahmed 2024-07-11 14:29:56 +03:00
parent 3190f8bb7e
commit bd44c17079

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Audio; using osu.Framework.Audio;
using osu.Framework.Bindables; using osu.Framework.Bindables;
@ -19,7 +17,6 @@ using osu.Game.Input.Bindings;
using osu.Game.Overlays.Volume; using osu.Game.Overlays.Volume;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
using osuTK.Input;
namespace osu.Game.Overlays namespace osu.Game.Overlays
{ {
@ -27,17 +24,17 @@ namespace osu.Game.Overlays
{ {
private const float offset = 10; private const float offset = 10;
private VolumeMeter volumeMeterMaster; private VolumeMeter volumeMeterMaster = null!;
private VolumeMeter volumeMeterEffect; private VolumeMeter volumeMeterEffect = null!;
private VolumeMeter volumeMeterMusic; private VolumeMeter volumeMeterMusic = null!;
private MuteButton muteButton; private MuteButton muteButton = null!;
private SelectionCycleFillFlowContainer<VolumeMeter> volumeMeters = null!;
private readonly BindableDouble muteAdjustment = new BindableDouble(); private readonly BindableDouble muteAdjustment = new BindableDouble();
public Bindable<bool> IsMuted { get; } = new Bindable<bool>(); public Bindable<bool> IsMuted { get; } = new Bindable<bool>();
private SelectionCycleFillFlowContainer<VolumeMeter> volumeMeters;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(AudioManager audio, OsuColour colours) private void load(AudioManager audio, OsuColour colours)
{ {
@ -140,8 +137,6 @@ namespace osu.Game.Overlays
return false; return false;
} }
private ScheduledDelegate popOutDelegate;
public void FocusMasterVolume() public void FocusMasterVolume()
{ {
volumeMeters.Select(volumeMeterMaster); volumeMeters.Select(volumeMeterMaster);
@ -191,6 +186,8 @@ namespace osu.Game.Overlays
base.OnHoverLost(e); base.OnHoverLost(e);
} }
private ScheduledDelegate? popOutDelegate;
private void schedulePopOut() private void schedulePopOut()
{ {
popOutDelegate?.Cancel(); popOutDelegate?.Cancel();