1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-06 08:22:56 +08:00

Fix overlays not being correctly offset by toolbar padding

This commit is contained in:
Dean Herbert 2019-01-21 19:34:35 +09:00
parent 161d0f0564
commit 4eb5e67075

View File

@ -359,11 +359,11 @@ namespace osu.Game
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
}, },
mainContent = new Container overlayContent = new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
}, },
overlayContent = new Container { RelativeSizeAxes = Axes.Both, Depth = float.MinValue }, floatingOverlayContent = new Container { RelativeSizeAxes = Axes.Both, Depth = float.MinValue },
idleTracker = new IdleTracker(6000) idleTracker = new IdleTracker(6000)
}); });
@ -382,32 +382,32 @@ namespace osu.Game
CloseAllOverlays(false); CloseAllOverlays(false);
intro?.ChildScreen?.MakeCurrent(); intro?.ChildScreen?.MakeCurrent();
}, },
}, overlayContent.Add); }, floatingOverlayContent.Add);
loadComponentSingleFile(volume = new VolumeOverlay(), overlayContent.Add); loadComponentSingleFile(volume = new VolumeOverlay(), floatingOverlayContent.Add);
loadComponentSingleFile(onscreenDisplay = new OnScreenDisplay(), Add); loadComponentSingleFile(onscreenDisplay = new OnScreenDisplay(), Add);
loadComponentSingleFile(screenshotManager, Add); loadComponentSingleFile(screenshotManager, Add);
//overlay elements //overlay elements
loadComponentSingleFile(direct = new DirectOverlay { Depth = -1 }, mainContent.Add); loadComponentSingleFile(direct = new DirectOverlay { Depth = -1 }, overlayContent.Add);
loadComponentSingleFile(social = new SocialOverlay { Depth = -1 }, mainContent.Add); loadComponentSingleFile(social = new SocialOverlay { Depth = -1 }, overlayContent.Add);
loadComponentSingleFile(channelManager = new ChannelManager(), AddInternal); loadComponentSingleFile(channelManager = new ChannelManager(), AddInternal);
loadComponentSingleFile(chatOverlay = new ChatOverlay { Depth = -1 }, mainContent.Add); loadComponentSingleFile(chatOverlay = new ChatOverlay { Depth = -1 }, overlayContent.Add);
loadComponentSingleFile(settings = new MainSettings loadComponentSingleFile(settings = new MainSettings
{ {
GetToolbarHeight = () => ToolbarOffset, GetToolbarHeight = () => ToolbarOffset,
Depth = -1 Depth = -1
}, overlayContent.Add); }, floatingOverlayContent.Add);
loadComponentSingleFile(userProfile = new UserProfileOverlay { Depth = -2 }, mainContent.Add); loadComponentSingleFile(userProfile = new UserProfileOverlay { Depth = -2 }, overlayContent.Add);
loadComponentSingleFile(beatmapSetOverlay = new BeatmapSetOverlay { Depth = -3 }, mainContent.Add); loadComponentSingleFile(beatmapSetOverlay = new BeatmapSetOverlay { Depth = -3 }, overlayContent.Add);
loadComponentSingleFile(musicController = new MusicController loadComponentSingleFile(musicController = new MusicController
{ {
Depth = -5, 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,
}, overlayContent.Add); }, floatingOverlayContent.Add);
loadComponentSingleFile(notifications = new NotificationOverlay loadComponentSingleFile(notifications = new NotificationOverlay
{ {
@ -415,22 +415,22 @@ namespace osu.Game
Depth = -4, Depth = -4,
Anchor = Anchor.TopRight, Anchor = Anchor.TopRight,
Origin = Anchor.TopRight, Origin = Anchor.TopRight,
}, overlayContent.Add); }, floatingOverlayContent.Add);
loadComponentSingleFile(accountCreation = new AccountCreationOverlay loadComponentSingleFile(accountCreation = new AccountCreationOverlay
{ {
Depth = -6, Depth = -6,
}, overlayContent.Add); }, floatingOverlayContent.Add);
loadComponentSingleFile(dialogOverlay = new DialogOverlay loadComponentSingleFile(dialogOverlay = new DialogOverlay
{ {
Depth = -7, Depth = -7,
}, overlayContent.Add); }, floatingOverlayContent.Add);
loadComponentSingleFile(externalLinkOpener = new ExternalLinkOpener loadComponentSingleFile(externalLinkOpener = new ExternalLinkOpener
{ {
Depth = -8, Depth = -8,
}, overlayContent.Add); }, floatingOverlayContent.Add);
dependencies.Cache(idleTracker); dependencies.Cache(idleTracker);
dependencies.Cache(settings); dependencies.Cache(settings);
@ -649,10 +649,10 @@ namespace osu.Game
public bool OnReleased(GlobalAction action) => false; public bool OnReleased(GlobalAction action) => false;
private Container mainContent;
private Container overlayContent; private Container overlayContent;
private Container floatingOverlayContent;
private OsuScreen currentScreen; private OsuScreen currentScreen;
private FrameworkConfigManager frameworkConfig; private FrameworkConfigManager frameworkConfig;
private ScalingContainer screenContainer; private ScalingContainer screenContainer;
@ -696,6 +696,7 @@ namespace osu.Game
Beatmap.Disabled = applyBeatmapRulesetRestrictions; Beatmap.Disabled = applyBeatmapRulesetRestrictions;
screenContainer.Padding = new MarginPadding { Top = ToolbarOffset }; screenContainer.Padding = new MarginPadding { Top = ToolbarOffset };
overlayContent.Padding = new MarginPadding { Top = ToolbarOffset };
MenuCursorContainer.CanShowCursor = currentScreen?.CursorVisible ?? false; MenuCursorContainer.CanShowCursor = currentScreen?.CursorVisible ?? false;
} }