1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-25 18:22:55 +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 #endregion
#region Filtering #region Filtering

View File

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

View File

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

View File

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