1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 06:23:20 +08:00

overall fixes

This commit is contained in:
EVAST9919 2017-05-23 16:01:00 +03:00
parent 2ca0794b37
commit 178f8127b8
2 changed files with 15 additions and 21 deletions

View File

@ -26,9 +26,9 @@ namespace osu.Game.Graphics.UserInterface
private FillFlowContainer content; private FillFlowContainer content;
private SimpleButton button; private SimpleButton button;
private bool buttonIsPressed; private bool buttonIsActive;
private Color4 buttonPressedColour; private Color4 buttonActiveColour;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
@ -82,7 +82,7 @@ namespace osu.Game.Graphics.UserInterface
Position = new Vector2(-15,0), Position = new Vector2(-15,0),
Icon = FontAwesome.fa_bars, Icon = FontAwesome.fa_bars,
Scale = new Vector2(0.75f), Scale = new Vector2(0.75f),
Colour = buttonPressedColour = colours.Yellow, Colour = buttonActiveColour = colours.Yellow,
Action = triggerContentVisibility, Action = triggerContentVisibility,
}, },
} }
@ -92,9 +92,9 @@ namespace osu.Game.Graphics.UserInterface
Name = @"Content", Name = @"Content",
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
AutoSizeDuration = transition_duration, AutoSizeDuration = transition_duration,
AutoSizeEasing = EasingTypes.OutQuint, AutoSizeEasing = EasingTypes.OutQuint,
AutoSizeAxes = Axes.Y,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Padding = new MarginPadding(15), Padding = new MarginPadding(15),
@ -111,21 +111,16 @@ namespace osu.Game.Graphics.UserInterface
} }
private void triggerContentVisibility() private void triggerContentVisibility()
{
if (buttonIsPressed)
{ {
content.ClearTransforms(); content.ClearTransforms();
content.AutoSizeAxes = Axes.Y; content.AutoSizeAxes = buttonIsActive ? Axes.Y : Axes.None;
}
else if (!buttonIsActive)
{
content.AutoSizeAxes = Axes.None;
content.ResizeHeightTo(0, transition_duration, EasingTypes.OutQuint); 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;
} }
} }
} }

View File

@ -21,7 +21,10 @@ namespace osu.Game.Screens.Play.ReplaySettings
set set
{ {
isAvaliable = value; isAvaliable = value;
if (!isAvaliable) Hide(); if (isAvaliable)
Show();
else
Hide();
} }
get get
{ {
@ -62,11 +65,7 @@ namespace osu.Game.Screens.Play.ReplaySettings
{ {
if (isAvaliable) if (isAvaliable)
{ {
if (isVisible) FadeTo(isVisible ? 1 : 0, fade_duration);
FadeIn(fade_duration);
else
FadeOut(fade_duration);
isVisible = !isVisible; isVisible = !isVisible;
} }
} }