From 7a5e613cf68484876bbf0c4f6580b29127adb83b Mon Sep 17 00:00:00 2001 From: smallketchup82 Date: Mon, 16 Dec 2024 11:33:45 -0500 Subject: [PATCH] Disallow opening settings menu when external edit ovelay is open Also disallows using the random skin keybind when the external edit overlay is open. SkinEditor should already be disabling it, but I figured we might as well add this in for redundancy --- osu.Game/OsuGame.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 39c5fd842c..fda6c553ac 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -127,6 +127,8 @@ namespace osu.Game private SkinEditorOverlay skinEditor; + private ExternalEditOverlay externalEditOverlay; + private Container overlayContent; private Container rightFloatingOverlayContent; @@ -1125,7 +1127,7 @@ namespace osu.Game loadComponentSingleFile(beatmapSetOverlay = new BeatmapSetOverlay(), overlayContent.Add, true); loadComponentSingleFile(wikiOverlay = new WikiOverlay(), overlayContent.Add, true); loadComponentSingleFile(skinEditor = new SkinEditorOverlay(ScreenContainer), overlayContent.Add, true); - loadComponentSingleFile(new ExternalEditOverlay(), overlayContent.Add, true); + loadComponentSingleFile(externalEditOverlay = new ExternalEditOverlay(), overlayContent.Add, true); loadComponentSingleFile(new LoginOverlay { @@ -1175,6 +1177,17 @@ namespace osu.Game }; } + Settings.State.ValueChanged += state => + { + if (state.NewValue == Visibility.Hidden) + return; + + if (externalEditOverlay.State.Value == Visibility.Visible) + { + Scheduler.Add(() => Settings.Hide()); + } + }; + // ensure only one of these overlays are open at once. var singleDisplayOverlays = new OverlayContainer[] { chatOverlay, news, dashboard, beatmapListing, changelogOverlay, rankingsOverlay, wikiOverlay }; @@ -1462,7 +1475,7 @@ namespace osu.Game // Don't allow random skin selection while in the skin editor. // This is mainly to stop many "osu! default (modified)" skins being created via the SkinManager.EnsureMutableSkin() path. // If people want this to work we can potentially avoid selecting default skins when the editor is open, or allow a maximum of one mutable skin somehow. - if (skinEditor.State.Value == Visibility.Visible) + if (skinEditor.State.Value == Visibility.Visible || externalEditOverlay.State.Value == Visibility.Visible) return false; SkinManager.SelectRandomSkin();