mirror of
https://github.com/ppy/osu.git
synced 2024-12-16 06:23:20 +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 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user