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

Make BeatmapInfoWedge:OverlayContainer and unify transforms.

This commit is contained in:
Huo Yaoyuan 2017-03-14 16:29:20 +08:00
parent 66d1e7c732
commit 0198593697
2 changed files with 42 additions and 27 deletions

View File

@ -3,27 +3,28 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Allocation; using System.Linq;
using OpenTK; using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Game.Beatmaps; using osu.Framework.Graphics.Transforms;
using osu.Game.Database;
using osu.Framework.Graphics.Colour;
using osu.Game.Beatmaps.Drawables;
using System.Linq;
using osu.Framework.MathUtils; using osu.Framework.MathUtils;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Drawables;
using osu.Game.Database;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Modes; using osu.Game.Modes;
namespace osu.Game.Screens.Select namespace osu.Game.Screens.Select
{ {
internal class BeatmapInfoWedge : Container internal class BeatmapInfoWedge : OverlayContainer
{ {
private static readonly Vector2 wedged_container_shear = new Vector2(0.15f, 0); private static readonly Vector2 wedged_container_shear = new Vector2(0.15f, 0);
@ -52,18 +53,32 @@ namespace osu.Game.Screens.Select
this.game = game; this.game = game;
} }
protected override bool HideOnEscape => false;
protected override void PopIn()
{
MoveToX(0, 800, EasingTypes.OutQuint);
RotateTo(0, 800, EasingTypes.OutQuint);
}
protected override void PopOut()
{
MoveToX(-100, 800, EasingTypes.InQuint);
RotateTo(10, 800, EasingTypes.InQuint);
}
public void UpdateBeatmap(WorkingBeatmap beatmap) public void UpdateBeatmap(WorkingBeatmap beatmap)
{ {
if (beatmap?.BeatmapInfo == null) if (beatmap?.BeatmapInfo == null)
{ {
FadeOut(250); State = Visibility.Hidden;
beatmapInfoContainer?.FadeOut(250); beatmapInfoContainer?.FadeOut(250);
beatmapInfoContainer?.Expire(); beatmapInfoContainer?.Expire();
beatmapInfoContainer = null; beatmapInfoContainer = null;
return; return;
} }
FadeIn(250); State = Visibility.Visible;
var lastContainer = beatmapInfoContainer; var lastContainer = beatmapInfoContainer;
float newDepth = lastContainer?.Depth + 1 ?? 0; float newDepth = lastContainer?.Depth + 1 ?? 0;

View File

@ -2,33 +2,34 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using OpenTK;
using OpenTK.Input;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Audio; using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Audio.Track; using osu.Framework.Audio.Track;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Screens;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.Primitives;
using osu.Game.Beatmaps;
using osu.Game.Database;
using osu.Game.Modes;
using osu.Game.Screens.Backgrounds;
using OpenTK;
using osu.Game.Screens.Play;
using osu.Framework.Audio.Sample;
using osu.Framework.Graphics.Transforms; using osu.Framework.Graphics.Transforms;
using osu.Game.Beatmaps.Drawables;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics;
using osu.Framework.Input; using osu.Framework.Input;
using OpenTK.Input; using osu.Framework.Screens;
using System.Collections.Generic;
using osu.Framework.Threading; using osu.Framework.Threading;
using osu.Game.Overlays.Mods; using osu.Game.Beatmaps;
using osu.Game.Beatmaps.Drawables;
using osu.Game.Database;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Modes;
using osu.Game.Overlays; using osu.Game.Overlays;
using osu.Game.Overlays.Mods;
using osu.Game.Screens.Backgrounds;
using osu.Game.Screens.Play;
using osu.Game.Screens.Select.Options; using osu.Game.Screens.Select.Options;
namespace osu.Game.Screens.Select namespace osu.Game.Screens.Select
@ -129,6 +130,7 @@ namespace osu.Game.Screens.Select
Top = 20, Top = 20,
Right = 20, Right = 20,
}, },
X = -50,
}, },
beatmapOptions = new BeatmapOptionsOverlay beatmapOptions = new BeatmapOptionsOverlay
{ {
@ -259,8 +261,7 @@ namespace osu.Game.Screens.Select
Content.FadeInFromZero(250); Content.FadeInFromZero(250);
beatmapInfoWedge.MoveToX(-50); beatmapInfoWedge.State = Visibility.Visible;
beatmapInfoWedge.MoveToX(0, 800, EasingTypes.OutQuint);
filter.Activate(); filter.Activate();
} }
@ -292,8 +293,7 @@ namespace osu.Game.Screens.Select
protected override bool OnExiting(Screen next) protected override bool OnExiting(Screen next)
{ {
beatmapInfoWedge.MoveToX(-100, 800, EasingTypes.InQuint); beatmapInfoWedge.State = Visibility.Hidden;
beatmapInfoWedge.RotateTo(10, 800, EasingTypes.InQuint);
Content.FadeOut(100); Content.FadeOut(100);