1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 01:46:05 +08:00

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
This commit is contained in:
smallketchup82 2024-12-16 11:33:45 -05:00
parent 09d55ed306
commit 7a5e613cf6
No known key found for this signature in database
GPG Key ID: A3D139FCF16859ED

View File

@ -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();