mirror of
https://github.com/osukey/osukey.git
synced 2025-07-04 01:40:02 +09:00
Fix new mod select overlay dimming itself
This commit is contained in:
@ -35,6 +35,7 @@ using osu.Framework.Input.Bindings;
|
||||
using osu.Game.Collections;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using System.Diagnostics;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Skinning;
|
||||
@ -116,9 +117,15 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private double audioFeedbackLastPlaybackTime;
|
||||
|
||||
[CanBeNull]
|
||||
private IDisposable modSelectOverlayRegistration;
|
||||
|
||||
[Resolved]
|
||||
private MusicController music { get; set; }
|
||||
|
||||
[Resolved(CanBeNull = true)]
|
||||
private OsuGame game { get; set; }
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(AudioManager audio, IDialogOverlay dialog, OsuColour colours, ManageCollectionsDialog manageCollectionsDialog, DifficultyRecommender recommender)
|
||||
{
|
||||
@ -264,10 +271,13 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
},
|
||||
Footer = new Footer(),
|
||||
ModSelect = CreateModSelectOverlay()
|
||||
});
|
||||
}
|
||||
|
||||
// preload the mod select overlay for later use in `LoadComplete()`.
|
||||
// therein it will be registered at the `OsuGame` level to properly function as a blocking overlay.
|
||||
LoadComponent(ModSelect = CreateModSelectOverlay());
|
||||
|
||||
if (Footer != null)
|
||||
{
|
||||
foreach (var (button, overlay) in CreateFooterButtons())
|
||||
@ -301,6 +311,13 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
modSelectOverlayRegistration = game?.RegisterBlockingOverlay(ModSelect);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the buttons to be displayed in the footer.
|
||||
/// </summary>
|
||||
@ -700,6 +717,8 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
if (music != null)
|
||||
music.TrackChanged -= ensureTrackLooping;
|
||||
|
||||
modSelectOverlayRegistration?.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Reference in New Issue
Block a user