mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 07:22:55 +08:00
Apply refactorings from review
This commit is contained in:
parent
33fdd7466c
commit
3ede095b9c
@ -236,13 +236,11 @@ namespace osu.Game.Screens.Ranking
|
|||||||
scorePanelList.Detach(expandedPanel);
|
scorePanelList.Detach(expandedPanel);
|
||||||
detachedPanelContainer.Add(expandedPanel);
|
detachedPanelContainer.Add(expandedPanel);
|
||||||
|
|
||||||
// Move into its original location in the local container.
|
// Move into its original location in the local container first, then to the final location.
|
||||||
var origLocation = detachedPanelContainer.ToLocalSpace(screenSpacePos);
|
var origLocation = detachedPanelContainer.ToLocalSpace(screenSpacePos);
|
||||||
expandedPanel.MoveTo(origLocation);
|
expandedPanel.MoveTo(origLocation)
|
||||||
expandedPanel.MoveToX(origLocation.X);
|
.Then()
|
||||||
|
.MoveTo(new Vector2(StatisticsPanel.SIDE_PADDING, origLocation.Y), 150, Easing.OutQuint);
|
||||||
// Move into the final location.
|
|
||||||
expandedPanel.MoveToX(StatisticsPanel.SIDE_PADDING, 150, Easing.OutQuint);
|
|
||||||
|
|
||||||
// Hide contracted panels.
|
// Hide contracted panels.
|
||||||
foreach (var contracted in scorePanelList.GetScorePanels().Where(p => p.State == PanelState.Contracted))
|
foreach (var contracted in scorePanelList.GetScorePanels().Where(p => p.State == PanelState.Contracted))
|
||||||
@ -262,13 +260,11 @@ namespace osu.Game.Screens.Ranking
|
|||||||
detachedPanelContainer.Remove(detachedPanel);
|
detachedPanelContainer.Remove(detachedPanel);
|
||||||
scorePanelList.Attach(detachedPanel);
|
scorePanelList.Attach(detachedPanel);
|
||||||
|
|
||||||
// Move into its original location in the attached container.
|
// Move into its original location in the attached container first, then to the final location.
|
||||||
var origLocation = detachedPanel.Parent.ToLocalSpace(screenSpacePos);
|
var origLocation = detachedPanel.Parent.ToLocalSpace(screenSpacePos);
|
||||||
detachedPanel.MoveTo(origLocation);
|
detachedPanel.MoveTo(origLocation)
|
||||||
detachedPanel.MoveToX(origLocation.X);
|
.Then()
|
||||||
|
.MoveTo(new Vector2(0, origLocation.Y), 150, Easing.OutQuint);
|
||||||
// Move into the final location.
|
|
||||||
detachedPanel.MoveToX(0, 150, Easing.OutQuint);
|
|
||||||
|
|
||||||
// Show contracted panels.
|
// Show contracted panels.
|
||||||
foreach (var contracted in scorePanelList.GetScorePanels().Where(p => p.State == PanelState.Contracted))
|
foreach (var contracted in scorePanelList.GetScorePanels().Where(p => p.State == PanelState.Contracted))
|
||||||
|
@ -202,7 +202,7 @@ namespace osu.Game.Screens.Ranking
|
|||||||
/// <exception cref="InvalidOperationException">If <paramref name="panel"/> is not a part of this <see cref="ScorePanelList"/>.</exception>
|
/// <exception cref="InvalidOperationException">If <paramref name="panel"/> is not a part of this <see cref="ScorePanelList"/>.</exception>
|
||||||
public void Detach(ScorePanel panel)
|
public void Detach(ScorePanel panel)
|
||||||
{
|
{
|
||||||
var container = flow.FirstOrDefault(t => t.Panel == panel);
|
var container = flow.SingleOrDefault(t => t.Panel == panel);
|
||||||
if (container == null)
|
if (container == null)
|
||||||
throw new InvalidOperationException("Panel is not contained by the score panel list.");
|
throw new InvalidOperationException("Panel is not contained by the score panel list.");
|
||||||
|
|
||||||
@ -216,7 +216,7 @@ namespace osu.Game.Screens.Ranking
|
|||||||
/// <exception cref="InvalidOperationException">If <paramref name="panel"/> is not a part of this <see cref="ScorePanelList"/>.</exception>
|
/// <exception cref="InvalidOperationException">If <paramref name="panel"/> is not a part of this <see cref="ScorePanelList"/>.</exception>
|
||||||
public void Attach(ScorePanel panel)
|
public void Attach(ScorePanel panel)
|
||||||
{
|
{
|
||||||
var container = flow.FirstOrDefault(t => t.Panel == panel);
|
var container = flow.SingleOrDefault(t => t.Panel == panel);
|
||||||
if (container == null)
|
if (container == null)
|
||||||
throw new InvalidOperationException("Panel is not contained by the score panel list.");
|
throw new InvalidOperationException("Panel is not contained by the score panel list.");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user