mirror of
https://github.com/ppy/osu
synced 2025-01-12 00:59:35 +00:00
Implement ISamplePlaybackDisabler
in mod select
This commit is contained in:
parent
cbd1169495
commit
81ca534f87
@ -15,6 +15,7 @@ using osu.Framework.Input.Events;
|
||||
using osu.Framework.Layout;
|
||||
using osu.Framework.Lists;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Audio;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
@ -27,7 +28,7 @@ using osuTK.Input;
|
||||
|
||||
namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
public abstract class ModSelectScreen : ShearedOverlayContainer
|
||||
public abstract class ModSelectScreen : ShearedOverlayContainer, ISamplePlaybackDisabler
|
||||
{
|
||||
protected const int BUTTON_WIDTH = 200;
|
||||
|
||||
@ -188,6 +189,8 @@ namespace osu.Game.Overlays.Mods
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
State.BindValueChanged(_ => samplePlaybackDisabled.Value = State.Value == Visibility.Hidden, true);
|
||||
|
||||
((IBindable<IReadOnlyList<Mod>>)modSettingsArea.SelectedMods).BindTo(SelectedMods);
|
||||
|
||||
SelectedMods.BindValueChanged(val =>
|
||||
@ -430,6 +433,13 @@ namespace osu.Game.Overlays.Mods
|
||||
|
||||
#endregion
|
||||
|
||||
#region Sample playback control
|
||||
|
||||
private readonly Bindable<bool> samplePlaybackDisabled = new BindableBool(true);
|
||||
IBindable<bool> ISamplePlaybackDisabler.SamplePlaybackDisabled => samplePlaybackDisabled;
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Manages horizontal scrolling of mod columns, along with the "active" states of each column based on visibility.
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user