mirror of https://github.com/ppy/osu
Define toolbarElements
This commit is contained in:
parent
a0c03d7fc3
commit
ec5b024fa6
|
@ -99,6 +99,8 @@ public class OsuGame : OsuGameBase, IKeyBindingHandler<GlobalAction>
|
||||||
|
|
||||||
private readonly List<OverlayContainer> overlays = new List<OverlayContainer>();
|
private readonly List<OverlayContainer> overlays = new List<OverlayContainer>();
|
||||||
|
|
||||||
|
private readonly List<OverlayContainer> toolbarElements = new List<OverlayContainer>();
|
||||||
|
|
||||||
private readonly List<OverlayContainer> visibleBlockingOverlays = new List<OverlayContainer>();
|
private readonly List<OverlayContainer> visibleBlockingOverlays = new List<OverlayContainer>();
|
||||||
|
|
||||||
// todo: move this to SongSelect once Screen has the ability to unsuspend.
|
// todo: move this to SongSelect once Screen has the ability to unsuspend.
|
||||||
|
@ -142,8 +144,8 @@ public void CloseAllOverlays(bool hideToolbarElements = true)
|
||||||
|
|
||||||
if (hideToolbarElements)
|
if (hideToolbarElements)
|
||||||
{
|
{
|
||||||
Toolbar.State = Visibility.Hidden;
|
foreach (var overlay in toolbarElements)
|
||||||
musicController.State = Visibility.Hidden;
|
overlay.State = Visibility.Hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -420,7 +422,11 @@ protected override void LoadComplete()
|
||||||
CloseAllOverlays(false);
|
CloseAllOverlays(false);
|
||||||
menuScreen?.MakeCurrent();
|
menuScreen?.MakeCurrent();
|
||||||
},
|
},
|
||||||
}, topMostOverlayContent.Add);
|
}, d =>
|
||||||
|
{
|
||||||
|
topMostOverlayContent.Add(d);
|
||||||
|
toolbarElements.Add(d);
|
||||||
|
});
|
||||||
|
|
||||||
loadComponentSingleFile(volume = new VolumeOverlay(), leftFloatingOverlayContent.Add);
|
loadComponentSingleFile(volume = new VolumeOverlay(), leftFloatingOverlayContent.Add);
|
||||||
loadComponentSingleFile(new OnScreenDisplay(), Add, true);
|
loadComponentSingleFile(new OnScreenDisplay(), Add, true);
|
||||||
|
@ -455,7 +461,11 @@ protected override void LoadComplete()
|
||||||
GetToolbarHeight = () => ToolbarOffset,
|
GetToolbarHeight = () => ToolbarOffset,
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
}, rightFloatingOverlayContent.Add, true);
|
}, d =>
|
||||||
|
{
|
||||||
|
rightFloatingOverlayContent.Add(d);
|
||||||
|
toolbarElements.Add(d);
|
||||||
|
}, true);
|
||||||
|
|
||||||
loadComponentSingleFile(new AccountCreationOverlay(), topMostOverlayContent.Add, true);
|
loadComponentSingleFile(new AccountCreationOverlay(), topMostOverlayContent.Add, true);
|
||||||
loadComponentSingleFile(new DialogOverlay(), topMostOverlayContent.Add, true);
|
loadComponentSingleFile(new DialogOverlay(), topMostOverlayContent.Add, true);
|
||||||
|
|
Loading…
Reference in New Issue