1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-28 01:47:04 +08:00

Fix title overlap

Uses the same method of displaying the mod selection as the old song
select (as an overlay of the entire game).
This commit is contained in:
Dan Balasescu
2026-01-05 17:44:41 +09:00
Unverified
parent 593cc37ea6
commit 8b49572c44
2 changed files with 42 additions and 16 deletions
@@ -1,6 +1,7 @@
// 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 System;
using System.Collections.Generic;
using System.Linq;
using Humanizer;
@@ -31,12 +32,17 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
protected readonly Bindable<bool> Freestyle = new Bindable<bool>(true);
private readonly Bindable<IReadOnlyList<Mod>> freeMods = new Bindable<IReadOnlyList<Mod>>([]);
[Resolved]
private IOverlayManager? overlayManager { get; set; }
private readonly AddToPlaylistFooterButton addToPlaylistFooterButton;
private readonly Room room;
private ModSelectOverlay modSelect = null!;
private FreeModSelectOverlay freeModSelect = null!;
private IDisposable? modSelectOverlayRegistration;
public PlaylistsSongSelectV2(Room room)
{
this.room = room;
@@ -61,30 +67,30 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
[BackgroundDependencyLoader]
private void load()
{
AddRangeInternal(new Drawable[]
AddInternal(new PlaylistTray(room)
{
freeModSelect = new FreeModSelectOverlay
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight,
Margin = new MarginPadding
{
SelectedMods = { BindTarget = freeMods },
IsValidMod = isValidAllowedMod,
},
new PlaylistTray(room)
{
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight,
Margin = new MarginPadding
{
Bottom = ScreenFooterButton.HEIGHT,
Right = OsuGame.SCREEN_EDGE_MARGIN
}
Bottom = ScreenFooterButton.HEIGHT,
Right = OsuGame.SCREEN_EDGE_MARGIN
}
});
LoadComponent(freeModSelect = new FreeModSelectOverlay
{
SelectedMods = { BindTarget = freeMods },
IsValidMod = isValidAllowedMod,
});
}
protected override void LoadComplete()
{
base.LoadComplete();
modSelectOverlayRegistration = overlayManager?.RegisterBlockingOverlay(freeModSelect);
Mods.BindValueChanged(onGlobalModsChanged);
Ruleset.BindValueChanged(onRulesetChanged);
Freestyle.BindValueChanged(onFreestyleChanged);
@@ -250,5 +256,11 @@ namespace osu.Game.Screens.OnlinePlay.Playlists
&& Mods.Value.All(m => m.Acronym != mod.Acronym)
// Mod must be compatible with all the required mods.
&& ModUtils.CheckCompatibleSet(Mods.Value.Append(mod).ToArray());
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
modSelectOverlayRegistration?.Dispose();
}
}
}
+16 -2
View File
@@ -146,6 +146,9 @@ namespace osu.Game.Screens.SelectV2
[Resolved]
private IDialogOverlay? dialogOverlay { get; set; }
[Resolved]
private IOverlayManager? overlayManager { get; set; }
private InputManager inputManager = null!;
private readonly RealmPopulatingOnlineLookupSource onlineLookupSource = new RealmPopulatingOnlineLookupSource();
@@ -153,6 +156,8 @@ namespace osu.Game.Screens.SelectV2
private Bindable<bool> configBackgroundBlur = null!;
private Bindable<bool> showConvertedBeatmaps = null!;
private IDisposable? modSelectOverlayRegistration;
[BackgroundDependencyLoader]
private void load(AudioManager audio, OsuConfigManager config)
{
@@ -288,10 +293,11 @@ namespace osu.Game.Screens.SelectV2
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
},
modSpeedHotkeyHandler = new ModSpeedHotkeyHandler(),
modSelectOverlay = CreateModSelectOverlay(),
modSpeedHotkeyHandler = new ModSpeedHotkeyHandler()
});
LoadComponent(modSelectOverlay = CreateModSelectOverlay());
configBackgroundBlur = config.GetBindable<bool>(OsuSetting.SongSelectBackgroundBlur);
configBackgroundBlur.BindValueChanged(e =>
{
@@ -361,6 +367,8 @@ namespace osu.Game.Screens.SelectV2
{
base.LoadComplete();
modSelectOverlayRegistration = overlayManager?.RegisterBlockingOverlay(modSelectOverlay);
inputManager = GetContainingInputManager()!;
filterControl.CriteriaChanged += criteriaChanged;
@@ -1210,5 +1218,11 @@ namespace osu.Game.Screens.SelectV2
public Bindable<BeatmapSetInfo?> ScopedBeatmapSet => filterControl.ScopedBeatmapSet;
#endregion
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
modSelectOverlayRegistration?.Dispose();
}
}
}