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

Replace state-based screen offsetting logic with HorizontalScreenOffsets

This commit is contained in:
Salman Ahmed 2021-08-06 18:38:48 +03:00
parent 8e8e0fb8d8
commit f77037ef57

View File

@ -828,21 +828,6 @@ namespace osu.Game
{
if (mode.NewValue != OverlayActivation.All) CloseAllOverlays();
};
void updateScreenOffset()
{
float offset = 0;
if (Settings.State.Value == Visibility.Visible)
offset += Toolbar.HEIGHT / 2;
if (notifications.State.Value == Visibility.Visible)
offset -= Toolbar.HEIGHT / 2;
screenOffsetContainer.MoveToX(offset, SettingsPanel.TRANSITION_LENGTH, Easing.OutQuint);
}
Settings.State.ValueChanged += _ => updateScreenOffset();
notifications.State.ValueChanged += _ => updateScreenOffset();
}
private void showOverlayAboveOthers(OverlayContainer overlay, OverlayContainer[] otherOverlays)
@ -1026,6 +1011,9 @@ namespace osu.Game
screenOffsetContainer.Padding = new MarginPadding { Top = ToolbarOffset };
overlayContent.Padding = new MarginPadding { Top = ToolbarOffset };
screenOffsetContainer.X = Settings.HorizontalScreenOffset * 0.125f +
notifications.HorizontalScreenOffset * 0.125f;
MenuCursorContainer.CanShowCursor = (ScreenStack.CurrentScreen as IOsuScreen)?.CursorVisible ?? false;
}