1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-25 13:24:26 +08:00

Move activation drawable flow portion to ICarouselPanel

This commit is contained in:
Dean Herbert 2025-01-24 18:40:48 +09:00
parent 92429b2ed9
commit 9366bfbf0d
No known key found for this signature in database
4 changed files with 9 additions and 10 deletions

View File

@ -124,15 +124,6 @@ namespace osu.Game.Screens.SelectV2
}
}
protected override void HandleItemActivated(CarouselItem item)
{
base.HandleItemActivated(item);
// TODO: maybe this should be handled by the panel itself?
if (GetMaterialisedDrawableForItem(item) is BeatmapCarouselPanel drawable)
drawable.FlashFromActivation();
}
#endregion
#region Filtering

View File

@ -123,7 +123,7 @@ namespace osu.Game.Screens.SelectV2
public double DrawYPosition { get; set; }
public void FlashFromActivation()
public void Activated()
{
activationFlash.FadeOutFromOne(500, Easing.OutQuint);
}

View File

@ -109,7 +109,10 @@ namespace osu.Game.Screens.SelectV2
}
if (currentSelection.CarouselItem != null)
{
(GetMaterialisedDrawableForItem(currentSelection.CarouselItem) as ICarouselPanel)?.Activated();
HandleItemActivated(currentSelection.CarouselItem);
}
}
#endregion

View File

@ -23,6 +23,11 @@ namespace osu.Game.Screens.SelectV2
/// </summary>
BindableBool KeyboardSelected { get; }
/// <summary>
/// Called when the panel is activated. Should be used to update the panel's visual state.
/// </summary>
void Activated();
/// <summary>
/// The Y position used internally for positioning in the carousel.
/// </summary>