mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 06:07:23 +08:00
Merge branch 'results-screen-animate-once' into results-screen-applause
This commit is contained in:
commit
404885af89
@ -2,6 +2,7 @@
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Performance;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Taiko.Objects.Drawables;
|
||||
using osu.Game.Rulesets.UI.Scrolling;
|
||||
|
@ -6,6 +6,7 @@ using System.Linq;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Performance;
|
||||
using osu.Game.Rulesets.Objects.Drawables;
|
||||
|
||||
namespace osu.Game.Rulesets.UI
|
||||
|
@ -118,9 +118,10 @@ namespace osu.Game.Screens.Ranking
|
||||
d.Origin = Anchor.Centre;
|
||||
}));
|
||||
|
||||
if (IsLoaded)
|
||||
{
|
||||
if (SelectedScore.Value == score)
|
||||
{
|
||||
if (IsLoaded)
|
||||
SelectedScore.TriggerChange();
|
||||
}
|
||||
else
|
||||
@ -136,6 +137,7 @@ namespace osu.Game.Screens.Ranking
|
||||
scroll.InstantScrollTarget = (scroll.InstantScrollTarget ?? scroll.Target) + ScorePanel.CONTRACTED_WIDTH + panel_spacing;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return panel;
|
||||
}
|
||||
@ -170,12 +172,15 @@ namespace osu.Game.Screens.Ranking
|
||||
expandedTrackingComponent.Margin = new MarginPadding { Horizontal = expanded_panel_spacing };
|
||||
expandedPanel.State = PanelState.Expanded;
|
||||
|
||||
SchedulerAfterChildren.Add(() =>
|
||||
{
|
||||
// Scroll to the new panel. This is done manually since we need:
|
||||
// 1) To scroll after the scroll container's visible range is updated.
|
||||
// 2) To account for the centre anchor/origins of panels.
|
||||
// In the end, it's easier to compute the scroll position manually.
|
||||
float scrollOffset = flow.GetPanelIndex(expandedPanel.Score) * (ScorePanel.CONTRACTED_WIDTH + panel_spacing);
|
||||
scroll.ScrollTo(scrollOffset);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
|
Loading…
x
Reference in New Issue
Block a user