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.Collections.Generic;
using osu.Framework.Allocation;
using System.Linq;
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
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.Framework.Graphics.Colour;
using osu.Game.Beatmaps.Drawables;
using System.Linq;
using osu.Framework.Graphics.Transforms;
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.Sprites;
using osu.Game.Modes;
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);
@ -52,18 +53,32 @@ namespace osu.Game.Screens.Select
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)
{
if (beatmap?.BeatmapInfo == null)
{
FadeOut(250);
State = Visibility.Hidden;
beatmapInfoContainer?.FadeOut(250);
beatmapInfoContainer?.Expire();
beatmapInfoContainer = null;
return;
}
FadeIn(250);
State = Visibility.Visible;
var lastContainer = beatmapInfoContainer;
float newDepth = lastContainer?.Depth + 1 ?? 0;