mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 05:07:28 +08:00
Removed background triangles
This commit is contained in:
parent
64d036fe81
commit
34ba3129a3
@ -25,7 +25,6 @@ namespace osu.Game.Overlays.Dialog
|
|||||||
private readonly Vector2 ring_minified_size = new Vector2(20f);
|
private readonly Vector2 ring_minified_size = new Vector2(20f);
|
||||||
private readonly Vector2 buttons_spacing = new Vector2(0f, 50f);
|
private readonly Vector2 buttons_spacing = new Vector2(0f, 50f);
|
||||||
|
|
||||||
private PopupDialogTriangles triangles;
|
|
||||||
private Container content, ring;
|
private Container content, ring;
|
||||||
private FlowContainer<PopupDialogButton> buttonsContainer;
|
private FlowContainer<PopupDialogButton> buttonsContainer;
|
||||||
private TextAwesome iconText;
|
private TextAwesome iconText;
|
||||||
@ -98,7 +97,6 @@ namespace osu.Game.Overlays.Dialog
|
|||||||
ring.ResizeTo(ring_minified_size);
|
ring.ResizeTo(ring_minified_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
triangles.SlideIn();
|
|
||||||
content.FadeIn(enter_duration, EasingTypes.OutQuint);
|
content.FadeIn(enter_duration, EasingTypes.OutQuint);
|
||||||
ring.ResizeTo(ring_size, enter_duration, EasingTypes.OutQuint);
|
ring.ResizeTo(ring_size, enter_duration, EasingTypes.OutQuint);
|
||||||
buttonsContainer.TransformSpacingTo(Vector2.Zero, enter_duration, EasingTypes.OutQuint);
|
buttonsContainer.TransformSpacingTo(Vector2.Zero, enter_duration, EasingTypes.OutQuint);
|
||||||
@ -107,7 +105,6 @@ namespace osu.Game.Overlays.Dialog
|
|||||||
|
|
||||||
protected override void PopOut()
|
protected override void PopOut()
|
||||||
{
|
{
|
||||||
triangles.SlideOut();
|
|
||||||
content.FadeOut(exit_duration, EasingTypes.InSine);
|
content.FadeOut(exit_duration, EasingTypes.InSine);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,13 +112,6 @@ namespace osu.Game.Overlays.Dialog
|
|||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
triangles = new PopupDialogTriangles
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Anchor = Anchor.BottomCentre,
|
|
||||||
Origin = Anchor.BottomCentre,
|
|
||||||
Width = 0.5f,
|
|
||||||
},
|
|
||||||
content = new Container
|
content = new Container
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
@ -233,85 +223,4 @@ namespace osu.Game.Overlays.Dialog
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class PopupDialogTriangles : Triangles
|
|
||||||
{
|
|
||||||
private const float transition_duration = 500;
|
|
||||||
private const float triangle_normal_speed = 20000;
|
|
||||||
private const float triangle_moving_speed = 100;
|
|
||||||
private float triangleMoveSpeed;
|
|
||||||
|
|
||||||
private Color4[] colours;
|
|
||||||
|
|
||||||
protected override float SpawnRatio => spawnRatio;
|
|
||||||
private float spawnRatio = 0f;
|
|
||||||
|
|
||||||
protected override Color4 GetTriangleShade() => colours[RNG.Next(0, colours.Length - 1)];
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OsuColour colour)
|
|
||||||
{
|
|
||||||
colours = new Color4[]
|
|
||||||
{
|
|
||||||
colour.BlueLight,
|
|
||||||
colour.Blue,
|
|
||||||
colour.PinkLight,
|
|
||||||
colour.Pink,
|
|
||||||
colour.YellowLight,
|
|
||||||
colour.Yellow,
|
|
||||||
colour.PurpleLight,
|
|
||||||
colour.Purple,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Update()
|
|
||||||
{
|
|
||||||
base.Update();
|
|
||||||
foreach (Drawable d in Children)
|
|
||||||
d.Position -= new Vector2(0, (float)(d.Scale.X * (Time.Elapsed / triangleMoveSpeed)));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SlideIn()
|
|
||||||
{
|
|
||||||
triangleMoveSpeed = triangle_moving_speed;
|
|
||||||
TransformFloatTo(spawnRatio, 1f, transition_duration, EasingTypes.None, new TransformFloatSpawnRatio());
|
|
||||||
TransformFloatTo(triangleMoveSpeed, triangle_normal_speed, transition_duration, EasingTypes.InExpo, new TransformFloatSpeed());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SlideOut()
|
|
||||||
{
|
|
||||||
TransformFloatTo(spawnRatio, 0f, transition_duration, EasingTypes.None, new TransformFloatSpawnRatio());
|
|
||||||
TransformFloatTo(triangleMoveSpeed, triangle_moving_speed, transition_duration, EasingTypes.OutExpo, new TransformFloatSpeed());
|
|
||||||
}
|
|
||||||
|
|
||||||
class TransformFloatSpeed : TransformFloat
|
|
||||||
{
|
|
||||||
public override void Apply(Drawable d)
|
|
||||||
{
|
|
||||||
base.Apply(d);
|
|
||||||
PopupDialogTriangles t = d as PopupDialogTriangles;
|
|
||||||
t.triangleMoveSpeed = CurrentValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class TransformFloatSpawnRatio : TransformFloat
|
|
||||||
{
|
|
||||||
public override void Apply(Drawable d)
|
|
||||||
{
|
|
||||||
base.Apply(d);
|
|
||||||
PopupDialogTriangles t = d as PopupDialogTriangles;
|
|
||||||
t.spawnRatio = CurrentValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void LoadComplete()
|
|
||||||
{
|
|
||||||
// override so the triangles don't do the initial fill
|
|
||||||
}
|
|
||||||
|
|
||||||
public PopupDialogTriangles()
|
|
||||||
{
|
|
||||||
TriangleScale = 2f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user