mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 14:02:55 +08:00
overall fixes
This commit is contained in:
parent
2ca0794b37
commit
178f8127b8
@ -26,9 +26,9 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
private FillFlowContainer content;
|
||||
private SimpleButton button;
|
||||
private bool buttonIsPressed;
|
||||
private bool buttonIsActive;
|
||||
|
||||
private Color4 buttonPressedColour;
|
||||
private Color4 buttonActiveColour;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
@ -82,7 +82,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
Position = new Vector2(-15,0),
|
||||
Icon = FontAwesome.fa_bars,
|
||||
Scale = new Vector2(0.75f),
|
||||
Colour = buttonPressedColour = colours.Yellow,
|
||||
Colour = buttonActiveColour = colours.Yellow,
|
||||
Action = triggerContentVisibility,
|
||||
},
|
||||
}
|
||||
@ -92,9 +92,9 @@ namespace osu.Game.Graphics.UserInterface
|
||||
Name = @"Content",
|
||||
Direction = FillDirection.Vertical,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
AutoSizeDuration = transition_duration,
|
||||
AutoSizeEasing = EasingTypes.OutQuint,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
Origin = Anchor.TopCentre,
|
||||
Anchor = Anchor.TopCentre,
|
||||
Padding = new MarginPadding(15),
|
||||
@ -112,20 +112,15 @@ namespace osu.Game.Graphics.UserInterface
|
||||
|
||||
private void triggerContentVisibility()
|
||||
{
|
||||
if (buttonIsPressed)
|
||||
{
|
||||
content.ClearTransforms();
|
||||
content.AutoSizeAxes = Axes.Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
content.AutoSizeAxes = Axes.None;
|
||||
content.ClearTransforms();
|
||||
content.AutoSizeAxes = buttonIsActive ? Axes.Y : Axes.None;
|
||||
|
||||
if (!buttonIsActive)
|
||||
content.ResizeHeightTo(0, transition_duration, EasingTypes.OutQuint);
|
||||
}
|
||||
|
||||
button.FadeColour(buttonIsPressed ? buttonPressedColour : Color4.White, 200, EasingTypes.OutQuint);
|
||||
button.FadeColour(buttonIsActive ? buttonActiveColour : Color4.White, 200, EasingTypes.OutQuint);
|
||||
|
||||
buttonIsPressed = !buttonIsPressed;
|
||||
buttonIsActive = !buttonIsActive;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,10 @@ namespace osu.Game.Screens.Play.ReplaySettings
|
||||
set
|
||||
{
|
||||
isAvaliable = value;
|
||||
if (!isAvaliable) Hide();
|
||||
if (isAvaliable)
|
||||
Show();
|
||||
else
|
||||
Hide();
|
||||
}
|
||||
get
|
||||
{
|
||||
@ -62,11 +65,7 @@ namespace osu.Game.Screens.Play.ReplaySettings
|
||||
{
|
||||
if (isAvaliable)
|
||||
{
|
||||
if (isVisible)
|
||||
FadeIn(fade_duration);
|
||||
else
|
||||
FadeOut(fade_duration);
|
||||
|
||||
FadeTo(isVisible ? 1 : 0, fade_duration);
|
||||
isVisible = !isVisible;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user