mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 09:23:06 +08:00
Handle toolbar offsets better.
This commit is contained in:
parent
3cee23fc00
commit
2e119cd74f
@ -23,6 +23,7 @@ using osu.Game.Screens;
|
||||
using osu.Game.Screens.Menu;
|
||||
using OpenTK;
|
||||
using System.Linq;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
|
||||
namespace osu.Game
|
||||
{
|
||||
@ -226,6 +227,14 @@ namespace osu.Game
|
||||
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;
|
||||
|
@ -8,12 +8,9 @@ using osu.Framework.Graphics.Containers;
|
||||
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 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
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
|
||||
|
@ -24,8 +24,6 @@ namespace osu.Game.Screens
|
||||
|
||||
protected new OsuGameBase Game => base.Game as OsuGameBase;
|
||||
|
||||
protected float ToolbarPadding => ShowOverlays ? (Game as OsuGame)?.Toolbar.DrawHeight ?? 0 : 0;
|
||||
|
||||
private bool boundToBeatmap;
|
||||
private Bindable<WorkingBeatmap> beatmap;
|
||||
|
||||
|
@ -11,15 +11,12 @@ using osu.Framework.Audio.Track;
|
||||
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 @@ namespace osu.Game.Screens.Select
|
||||
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 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
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 @@ namespace osu.Game.Screens.Select
|
||||
OsuGame osuGame, OsuColour colours)
|
||||
{
|
||||
const float carousel_width = 640;
|
||||
const float bottom_tool_height = 50;
|
||||
beatmapGroups = new List<BeatmapGroup>();
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new ParallaxContainer
|
||||
{
|
||||
Masking = true,
|
||||
ParallaxAmount = 0.005f,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new []
|
||||
@ -143,7 +111,6 @@ namespace osu.Game.Screens.Select
|
||||
},
|
||||
filter = new FilterControl
|
||||
{
|
||||
Position = wedged_container_start_position,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
FilterChanged = filterChanged,
|
||||
Exit = Exit,
|
||||
@ -151,7 +118,6 @@ namespace osu.Game.Screens.Select
|
||||
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 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
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 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
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);
|
||||
|
40
osu.Game/Screens/Select/WedgeBackground.cs
Normal file
40
osu.Game/Screens/Select/WedgeBackground.cs
Normal file
@ -0,0 +1,40 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// 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),
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
@ -188,6 +188,7 @@
|
||||
<Compile Include="Overlays\Toolbar\ToolbarModeSelector.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Screens\Select\BeatmapInfoWedge.cs" />
|
||||
<Compile Include="Screens\Select\WedgeBackground.cs" />
|
||||
<Compile Include="Users\User.cs" />
|
||||
<Compile Include="Graphics\UserInterface\Volume\VolumeControl.cs" />
|
||||
<Compile Include="Database\BeatmapDatabase.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user