mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 15:12:57 +08:00
Move filter container z depth and add hover fx
This commit is contained in:
parent
73e46ee8c0
commit
63031fbc3d
@ -6,6 +6,7 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Input;
|
||||
using osu.Game.Graphics;
|
||||
|
||||
namespace osu.Game.Screens.Select
|
||||
@ -85,27 +86,48 @@ namespace osu.Game.Screens.Select
|
||||
set { text.Text = value; }
|
||||
}
|
||||
|
||||
public bool Active
|
||||
{
|
||||
get { return box.Alpha != 0; }
|
||||
set
|
||||
{
|
||||
if (value)
|
||||
private void FadeActive()
|
||||
{
|
||||
box.FadeIn(300);
|
||||
text.FadeColour(Color4.White, 300);
|
||||
}
|
||||
else
|
||||
|
||||
private void FadeInactive()
|
||||
{
|
||||
box.FadeOut(300);
|
||||
text.FadeColour(new Color4(102, 204, 255, 255), 300);
|
||||
}
|
||||
|
||||
private bool active;
|
||||
public bool Active
|
||||
{
|
||||
get { return active; }
|
||||
set
|
||||
{
|
||||
active = value;
|
||||
if (active)
|
||||
FadeActive();
|
||||
else
|
||||
FadeInactive();
|
||||
}
|
||||
}
|
||||
|
||||
private SpriteText text;
|
||||
private Box box;
|
||||
|
||||
protected override bool OnHover(InputState state)
|
||||
{
|
||||
if (!active)
|
||||
FadeActive();
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(InputState state)
|
||||
{
|
||||
if (!active)
|
||||
FadeInactive();
|
||||
}
|
||||
|
||||
public GroupSortItem()
|
||||
{
|
||||
AutoSizeAxes = Axes.Both;
|
||||
@ -116,6 +138,7 @@ namespace osu.Game.Screens.Select
|
||||
Colour = new Color4(102, 204, 255, 255),
|
||||
Margin = new MarginPadding(5),
|
||||
TextSize = 14,
|
||||
Font = @"Exo2.0-Bold",
|
||||
},
|
||||
box = new Box
|
||||
{
|
||||
@ -190,6 +213,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
new SpriteText
|
||||
{
|
||||
Font = @"Exo2.0-Bold",
|
||||
Text = "Sort results by",
|
||||
Colour = new Color4(165, 204, 0, 255),
|
||||
TextSize = 14,
|
||||
|
@ -127,11 +127,6 @@ namespace osu.Game.Screens.Select
|
||||
},
|
||||
}
|
||||
},
|
||||
new FilterSongSelect
|
||||
{
|
||||
Position = wedged_container_start_position,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
},
|
||||
carousel = new CarouselContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
@ -139,6 +134,11 @@ namespace osu.Game.Screens.Select
|
||||
Anchor = Anchor.CentreRight,
|
||||
Origin = Anchor.CentreRight,
|
||||
},
|
||||
new FilterSongSelect
|
||||
{
|
||||
Position = wedged_container_start_position,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
},
|
||||
beatmapInfoWedge = new BeatmapInfoWedge
|
||||
{
|
||||
Alpha = 0,
|
||||
|
Loading…
Reference in New Issue
Block a user