mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 23:52:57 +08:00
Merge pull request #4494 from Joehuu/clean-overlays-code-1
Remove specified depths of overlays
This commit is contained in:
commit
fc59e6dec5
@ -390,11 +390,9 @@ namespace osu.Game
|
|||||||
logoContainer = new Container { RelativeSizeAxes = Axes.Both },
|
logoContainer = new Container { RelativeSizeAxes = Axes.Both },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
overlayContent = new Container
|
overlayContent = new Container { RelativeSizeAxes = Axes.Both },
|
||||||
{
|
floatingOverlayContent = new Container { RelativeSizeAxes = Axes.Both },
|
||||||
RelativeSizeAxes = Axes.Both,
|
topMostOverlayContent = new Container { RelativeSizeAxes = Axes.Both },
|
||||||
},
|
|
||||||
floatingOverlayContent = new Container { RelativeSizeAxes = Axes.Both, Depth = float.MinValue },
|
|
||||||
idleTracker = new GameIdleTracker(6000)
|
idleTracker = new GameIdleTracker(6000)
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -414,13 +412,12 @@ namespace osu.Game
|
|||||||
|
|
||||||
loadComponentSingleFile(Toolbar = new Toolbar
|
loadComponentSingleFile(Toolbar = new Toolbar
|
||||||
{
|
{
|
||||||
Depth = -5,
|
|
||||||
OnHome = delegate
|
OnHome = delegate
|
||||||
{
|
{
|
||||||
CloseAllOverlays(false);
|
CloseAllOverlays(false);
|
||||||
menuScreen?.MakeCurrent();
|
menuScreen?.MakeCurrent();
|
||||||
},
|
},
|
||||||
}, floatingOverlayContent.Add);
|
}, topMostOverlayContent.Add);
|
||||||
|
|
||||||
loadComponentSingleFile(volume = new VolumeOverlay(), floatingOverlayContent.Add);
|
loadComponentSingleFile(volume = new VolumeOverlay(), floatingOverlayContent.Add);
|
||||||
loadComponentSingleFile(onscreenDisplay = new OnScreenDisplay(), Add);
|
loadComponentSingleFile(onscreenDisplay = new OnScreenDisplay(), Add);
|
||||||
@ -428,47 +425,32 @@ namespace osu.Game
|
|||||||
loadComponentSingleFile(screenshotManager, Add);
|
loadComponentSingleFile(screenshotManager, Add);
|
||||||
|
|
||||||
//overlay elements
|
//overlay elements
|
||||||
loadComponentSingleFile(direct = new DirectOverlay { Depth = -1 }, overlayContent.Add);
|
loadComponentSingleFile(direct = new DirectOverlay(), overlayContent.Add);
|
||||||
loadComponentSingleFile(social = new SocialOverlay { Depth = -1 }, overlayContent.Add);
|
loadComponentSingleFile(social = new SocialOverlay(), overlayContent.Add);
|
||||||
loadComponentSingleFile(channelManager = new ChannelManager(), AddInternal);
|
loadComponentSingleFile(channelManager = new ChannelManager(), AddInternal);
|
||||||
loadComponentSingleFile(chatOverlay = new ChatOverlay { Depth = -1 }, overlayContent.Add);
|
loadComponentSingleFile(chatOverlay = new ChatOverlay(), overlayContent.Add);
|
||||||
loadComponentSingleFile(settings = new MainSettings
|
loadComponentSingleFile(settings = new MainSettings { GetToolbarHeight = () => ToolbarOffset }, floatingOverlayContent.Add);
|
||||||
|
loadComponentSingleFile(userProfile = new UserProfileOverlay(), overlayContent.Add);
|
||||||
|
loadComponentSingleFile(beatmapSetOverlay = new BeatmapSetOverlay(), overlayContent.Add);
|
||||||
|
loadComponentSingleFile(notifications = new NotificationOverlay
|
||||||
{
|
{
|
||||||
GetToolbarHeight = () => ToolbarOffset,
|
GetToolbarHeight = () => ToolbarOffset,
|
||||||
Depth = -1
|
Anchor = Anchor.TopRight,
|
||||||
|
Origin = Anchor.TopRight,
|
||||||
}, floatingOverlayContent.Add);
|
}, floatingOverlayContent.Add);
|
||||||
loadComponentSingleFile(userProfile = new UserProfileOverlay { Depth = -2 }, overlayContent.Add);
|
|
||||||
loadComponentSingleFile(beatmapSetOverlay = new BeatmapSetOverlay { Depth = -3 }, overlayContent.Add);
|
|
||||||
loadComponentSingleFile(musicController = new MusicController
|
loadComponentSingleFile(musicController = new MusicController
|
||||||
{
|
{
|
||||||
Depth = -5,
|
|
||||||
Position = new Vector2(0, Toolbar.HEIGHT),
|
Position = new Vector2(0, Toolbar.HEIGHT),
|
||||||
Anchor = Anchor.TopRight,
|
Anchor = Anchor.TopRight,
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
}, floatingOverlayContent.Add);
|
}, floatingOverlayContent.Add);
|
||||||
|
|
||||||
loadComponentSingleFile(notifications = new NotificationOverlay
|
loadComponentSingleFile(accountCreation = new AccountCreationOverlay(), topMostOverlayContent.Add);
|
||||||
{
|
|
||||||
GetToolbarHeight = () => ToolbarOffset,
|
|
||||||
Depth = -4,
|
|
||||||
Anchor = Anchor.TopRight,
|
|
||||||
Origin = Anchor.TopRight,
|
|
||||||
}, floatingOverlayContent.Add);
|
|
||||||
|
|
||||||
loadComponentSingleFile(accountCreation = new AccountCreationOverlay
|
loadComponentSingleFile(dialogOverlay = new DialogOverlay(), topMostOverlayContent.Add);
|
||||||
{
|
|
||||||
Depth = -6,
|
|
||||||
}, floatingOverlayContent.Add);
|
|
||||||
|
|
||||||
loadComponentSingleFile(dialogOverlay = new DialogOverlay
|
loadComponentSingleFile(externalLinkOpener = new ExternalLinkOpener(), topMostOverlayContent.Add);
|
||||||
{
|
|
||||||
Depth = -7,
|
|
||||||
}, floatingOverlayContent.Add);
|
|
||||||
|
|
||||||
loadComponentSingleFile(externalLinkOpener = new ExternalLinkOpener
|
|
||||||
{
|
|
||||||
Depth = -8,
|
|
||||||
}, floatingOverlayContent.Add);
|
|
||||||
|
|
||||||
dependencies.CacheAs(idleTracker);
|
dependencies.CacheAs(idleTracker);
|
||||||
dependencies.Cache(settings);
|
dependencies.Cache(settings);
|
||||||
@ -714,6 +696,8 @@ namespace osu.Game
|
|||||||
|
|
||||||
private Container floatingOverlayContent;
|
private Container floatingOverlayContent;
|
||||||
|
|
||||||
|
private Container topMostOverlayContent;
|
||||||
|
|
||||||
private FrameworkConfigManager frameworkConfig;
|
private FrameworkConfigManager frameworkConfig;
|
||||||
private ScalingContainer screenContainer;
|
private ScalingContainer screenContainer;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user