mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 09:02:58 +08:00
Remove excessive logic
This commit is contained in:
parent
b8ecc41667
commit
1e3251e3e9
@ -28,8 +28,6 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
protected readonly ScrollToTopButton Button;
|
protected readonly ScrollToTopButton Button;
|
||||||
|
|
||||||
private float currentTarget;
|
|
||||||
|
|
||||||
public OverlayScrollContainer()
|
public OverlayScrollContainer()
|
||||||
{
|
{
|
||||||
AddInternal(Button = new ScrollToTopButton
|
AddInternal(Button = new ScrollToTopButton
|
||||||
@ -40,7 +38,6 @@ namespace osu.Game.Overlays
|
|||||||
Action = () =>
|
Action = () =>
|
||||||
{
|
{
|
||||||
ScrollToStart();
|
ScrollToStart();
|
||||||
currentTarget = Target;
|
|
||||||
Button.State = Visibility.Hidden;
|
Button.State = Visibility.Hidden;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -56,11 +53,6 @@ namespace osu.Game.Overlays
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clicking on button should immediately cause it's disappearance, so we don't want to override it's state until we have a new target.
|
|
||||||
if (Target == currentTarget)
|
|
||||||
return;
|
|
||||||
|
|
||||||
currentTarget = Target;
|
|
||||||
Button.State = Target > button_scroll_position ? Visibility.Visible : Visibility.Hidden;
|
Button.State = Target > button_scroll_position ? Visibility.Visible : Visibility.Hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user