mirror of
https://github.com/osukey/osukey.git
synced 2025-06-22 19:57:56 +09:00
Autoscroll playlist on song change
This commit is contained in:
parent
8c3caed2e0
commit
bdea75b995
@ -117,6 +117,8 @@ namespace osu.Game.Configuration
|
|||||||
Set(OsuSetting.UIHoldActivationDelay, 200f, 0f, 500f, 50f);
|
Set(OsuSetting.UIHoldActivationDelay, 200f, 0f, 500f, 50f);
|
||||||
|
|
||||||
Set(OsuSetting.IntroSequence, IntroSequence.Triangles);
|
Set(OsuSetting.IntroSequence, IntroSequence.Triangles);
|
||||||
|
|
||||||
|
Set(OsuSetting.FollowPlayback, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public OsuConfigManager(Storage storage)
|
public OsuConfigManager(Storage storage)
|
||||||
@ -186,6 +188,7 @@ namespace osu.Game.Configuration
|
|||||||
UIScale,
|
UIScale,
|
||||||
IntroSequence,
|
IntroSequence,
|
||||||
UIHoldActivationDelay,
|
UIHoldActivationDelay,
|
||||||
HitLighting
|
HitLighting,
|
||||||
|
FollowPlayback
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
@ -52,6 +53,8 @@ namespace osu.Game.Overlays.Music
|
|||||||
|
|
||||||
private IBindableList<BeatmapSetInfo> beatmaps;
|
private IBindableList<BeatmapSetInfo> beatmaps;
|
||||||
|
|
||||||
|
private IBindable<bool> followPlayback;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private MusicController musicController { get; set; }
|
private MusicController musicController { get; set; }
|
||||||
|
|
||||||
@ -76,8 +79,10 @@ namespace osu.Game.Overlays.Music
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(IBindable<WorkingBeatmap> beatmap)
|
private void load(IBindable<WorkingBeatmap> beatmap, OsuConfigManager configManager)
|
||||||
{
|
{
|
||||||
|
followPlayback = configManager.GetBindable<bool>(OsuSetting.FollowPlayback);
|
||||||
|
|
||||||
beatmaps = musicController.BeatmapSets.GetBoundCopy();
|
beatmaps = musicController.BeatmapSets.GetBoundCopy();
|
||||||
beatmaps.ItemsAdded += i => i.ForEach(addBeatmapSet);
|
beatmaps.ItemsAdded += i => i.ForEach(addBeatmapSet);
|
||||||
beatmaps.ItemsRemoved += i => i.ForEach(removeBeatmapSet);
|
beatmaps.ItemsRemoved += i => i.ForEach(removeBeatmapSet);
|
||||||
@ -109,7 +114,11 @@ namespace osu.Game.Overlays.Music
|
|||||||
private void updateSelectedSet()
|
private void updateSelectedSet()
|
||||||
{
|
{
|
||||||
foreach (PlaylistItem s in items.Children)
|
foreach (PlaylistItem s in items.Children)
|
||||||
|
{
|
||||||
s.Selected = s.BeatmapSetInfo.ID == beatmapBacking.Value.BeatmapSetInfo?.ID;
|
s.Selected = s.BeatmapSetInfo.ID == beatmapBacking.Value.BeatmapSetInfo?.ID;
|
||||||
|
if (s.Selected && followPlayback.Value)
|
||||||
|
ScrollIntoView(s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string SearchTerm
|
public string SearchTerm
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Game.Configuration;
|
||||||
|
|
||||||
|
namespace osu.Game.Overlays.Settings.Sections.Audio
|
||||||
|
{
|
||||||
|
public class PlaylistSettings : SettingsSubsection
|
||||||
|
{
|
||||||
|
protected override string Header => "Playlist";
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuConfigManager config)
|
||||||
|
{
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new SettingsCheckbox
|
||||||
|
{
|
||||||
|
LabelText = "Follow playback",
|
||||||
|
Bindable = config.GetBindable<bool>(OsuSetting.FollowPlayback)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -20,6 +20,7 @@ namespace osu.Game.Overlays.Settings.Sections
|
|||||||
new VolumeSettings(),
|
new VolumeSettings(),
|
||||||
new OffsetSettings(),
|
new OffsetSettings(),
|
||||||
new MainMenuSettings(),
|
new MainMenuSettings(),
|
||||||
|
new PlaylistSettings()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user