diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 7c68dfb4bc..97c9dbb2e0 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -23,6 +23,7 @@ using osu.Game.Screens.Menu; using OpenTK; using System.Linq; +using osu.Framework.Graphics.Primitives; namespace osu.Game { @@ -226,6 +227,14 @@ protected override bool OnExiting() return base.OnExiting(); } + protected override void UpdateAfterChildren() + { + base.UpdateAfterChildren(); + + if (modeStack.ChildGameMode != null) + modeStack.ChildGameMode.Padding = new MarginPadding { Top = Toolbar.Position.Y + Toolbar.DrawHeight }; + } + private void modeAdded(GameMode newMode) { newMode.ModePushed += modeAdded; diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index 0640741ef0..625d2aa0b0 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -8,12 +8,9 @@ using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Transformations; using osu.Framework.Input; -using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Modes; -using osu.Game.Online.API; using OpenTK; -using OpenTK.Graphics; namespace osu.Game.Overlays.Toolbar { @@ -135,8 +132,8 @@ protected override void PopIn() protected override void PopOut() { - MoveToY(-DrawSize.Y, transition_time, EasingTypes.InQuint); - FadeOut(transition_time, EasingTypes.InQuint); + MoveToY(-DrawSize.Y, transition_time, EasingTypes.OutQuint); + FadeOut(transition_time); } class PassThroughFlowContainer : FlowContainer diff --git a/osu.Game/Screens/OsuGameMode.cs b/osu.Game/Screens/OsuGameMode.cs index b2646f4dea..3134640a60 100644 --- a/osu.Game/Screens/OsuGameMode.cs +++ b/osu.Game/Screens/OsuGameMode.cs @@ -24,8 +24,6 @@ public abstract class OsuGameMode : GameMode protected new OsuGameBase Game => base.Game as OsuGameBase; - protected float ToolbarPadding => ShowOverlays ? (Game as OsuGame)?.Toolbar.DrawHeight ?? 0 : 0; - private bool boundToBeatmap; private Bindable beatmap; diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index ccc0732984..81fa0bead1 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -11,15 +11,12 @@ using osu.Framework.Configuration; using osu.Framework.GameModes; using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Primitives; -using osu.Framework.Graphics.Sprites; using osu.Game.Beatmaps; using osu.Game.Database; using osu.Game.Modes; using osu.Game.Screens.Backgrounds; using OpenTK; -using OpenTK.Graphics; using osu.Game.Screens.Play; using osu.Framework; using osu.Framework.Audio.Sample; @@ -45,7 +42,6 @@ public class PlaySongSelect : OsuGameMode private TrackManager trackManager; private static readonly Vector2 wedged_container_size = new Vector2(0.5f, 225); - private static readonly Vector2 wedged_container_start_position = new Vector2(0, 50); private BeatmapInfoWedge beatmapInfoWedge; private static readonly Vector2 background_blur = new Vector2(20); @@ -58,34 +54,6 @@ public class PlaySongSelect : OsuGameMode private Footer footer; - class WedgeBackground : Container - { - public WedgeBackground() - { - Children = new[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Size = new Vector2(1, 0.5f), - Colour = Color4.Black.Opacity(0.5f), - Shear = new Vector2(0.15f, 0), - EdgeSmoothness = new Vector2(2, 0), - }, - new Box - { - RelativeSizeAxes = Axes.Both, - RelativePositionAxes = Axes.Y, - Size = new Vector2(1, -0.5f), - Position = new Vector2(0, 1), - Colour = Color4.Black.Opacity(0.5f), - Shear = new Vector2(-0.15f, 0), - EdgeSmoothness = new Vector2(2, 0), - }, - }; - } - } - Player player; FilterControl filter; @@ -117,12 +85,12 @@ private void load(BeatmapDatabase beatmaps, AudioManager audio, BaseGame game, OsuGame osuGame, OsuColour colours) { const float carousel_width = 640; - const float bottom_tool_height = 50; beatmapGroups = new List(); Children = new Drawable[] { new ParallaxContainer { + Masking = true, ParallaxAmount = 0.005f, RelativeSizeAxes = Axes.Both, Children = new [] @@ -143,7 +111,6 @@ private void load(BeatmapDatabase beatmaps, AudioManager audio, BaseGame game, }, filter = new FilterControl { - Position = wedged_container_start_position, RelativeSizeAxes = Axes.X, FilterChanged = filterChanged, Exit = Exit, @@ -151,7 +118,6 @@ private void load(BeatmapDatabase beatmaps, AudioManager audio, BaseGame game, beatmapInfoWedge = new BeatmapInfoWedge { Alpha = 0, - Position = wedged_container_start_position, Size = wedged_container_size, RelativeSizeAxes = Axes.X, Margin = new MarginPadding { Top = 20, Right = 20, }, @@ -236,8 +202,8 @@ protected override void OnEntering(GameMode last) Content.FadeInFromZero(250); - beatmapInfoWedge.MoveToX(wedged_container_start_position.X - 50); - beatmapInfoWedge.MoveToX(wedged_container_start_position.X, 800, EasingTypes.OutQuint); + beatmapInfoWedge.MoveToX(-50); + beatmapInfoWedge.MoveToX(0, 800, EasingTypes.OutQuint); filter.Activate(); } @@ -269,7 +235,7 @@ protected override void OnSuspending(GameMode next) protected override bool OnExiting(GameMode next) { - beatmapInfoWedge.MoveTo(wedged_container_start_position + new Vector2(-100, 50), 800, EasingTypes.InQuint); + beatmapInfoWedge.MoveToX(-100, 800, EasingTypes.InQuint); beatmapInfoWedge.RotateTo(10, 800, EasingTypes.InQuint); Content.FadeOut(100); diff --git a/osu.Game/Screens/Select/WedgeBackground.cs b/osu.Game/Screens/Select/WedgeBackground.cs new file mode 100644 index 0000000000..901fa21c92 --- /dev/null +++ b/osu.Game/Screens/Select/WedgeBackground.cs @@ -0,0 +1,40 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.Screens.Select +{ + public class WedgeBackground : Container + { + public WedgeBackground() + { + Children = new[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Size = new Vector2(1, 0.5f), + Colour = Color4.Black.Opacity(0.5f), + Shear = new Vector2(0.15f, 0), + EdgeSmoothness = new Vector2(2, 0), + }, + new Box + { + RelativeSizeAxes = Axes.Both, + RelativePositionAxes = Axes.Y, + Size = new Vector2(1, -0.5f), + Position = new Vector2(0, 1), + Colour = Color4.Black.Opacity(0.5f), + Shear = new Vector2(-0.15f, 0), + EdgeSmoothness = new Vector2(2, 0), + }, + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 1b1c851128..3f610bed42 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -188,6 +188,7 @@ +