mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 13:37:51 +08:00
Update visual apperance.
This commit is contained in:
parent
990c14fbe0
commit
00d8cacba8
@ -68,7 +68,7 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
{
|
{
|
||||||
if (currentlyDisplayed != null && !state.Mouse.HasMainButtonPressed)
|
if (currentlyDisplayed != null && !state.Mouse.HasMainButtonPressed)
|
||||||
{
|
{
|
||||||
tooltip.Delay(100);
|
tooltip.Delay(150);
|
||||||
tooltip.FadeOut(500, EasingTypes.OutQuint);
|
tooltip.FadeOut(500, EasingTypes.OutQuint);
|
||||||
currentlyDisplayed = null;
|
currentlyDisplayed = null;
|
||||||
}
|
}
|
||||||
@ -92,23 +92,31 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
|
|
||||||
public class Tooltip : Container
|
public class Tooltip : Container
|
||||||
{
|
{
|
||||||
private readonly Box tooltipBackground;
|
private readonly Box background;
|
||||||
private readonly OsuSpriteText text;
|
private readonly OsuSpriteText text;
|
||||||
|
|
||||||
public string TooltipText
|
public string TooltipText
|
||||||
{
|
{
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
if (value == text.Text) return;
|
||||||
|
|
||||||
text.Text = value;
|
text.Text = value;
|
||||||
|
if (Alpha > 0)
|
||||||
|
background.FlashColour(Color4.Gray, 200, EasingTypes.Out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool HandleInput => false;
|
public override bool HandleInput => false;
|
||||||
|
|
||||||
|
private const float text_size = 16;
|
||||||
|
|
||||||
public Tooltip()
|
public Tooltip()
|
||||||
{
|
{
|
||||||
|
AutoSizeDuration = 250;
|
||||||
|
AutoSizeEasing = EasingTypes.OutQuint;
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
|
|
||||||
CornerRadius = 5;
|
CornerRadius = 5;
|
||||||
Masking = true;
|
Masking = true;
|
||||||
EdgeEffect = new EdgeEffect
|
EdgeEffect = new EdgeEffect
|
||||||
@ -119,12 +127,13 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
};
|
};
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
tooltipBackground = new Box
|
background = new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both
|
RelativeSizeAxes = Axes.Both
|
||||||
},
|
},
|
||||||
text = new OsuSpriteText
|
text = new OsuSpriteText
|
||||||
{
|
{
|
||||||
|
TextSize = text_size,
|
||||||
Padding = new MarginPadding(5),
|
Padding = new MarginPadding(5),
|
||||||
Font = @"Exo2.0-Regular",
|
Font = @"Exo2.0-Regular",
|
||||||
}
|
}
|
||||||
@ -134,7 +143,7 @@ namespace osu.Game.Graphics.Cursor
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colour)
|
private void load(OsuColour colour)
|
||||||
{
|
{
|
||||||
tooltipBackground.Colour = colour.Gray3;
|
background.Colour = colour.Gray3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user