2025-01-10 20:55:53 +09:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
2025-01-23 16:09:18 +09:00
|
|
|
using osu.Framework.Bindables;
|
2025-01-10 20:55:53 +09:00
|
|
|
using osu.Framework.Graphics;
|
2025-01-24 18:34:04 +09:00
|
|
|
using osu.Framework.Graphics.Pooling;
|
2025-01-10 20:55:53 +09:00
|
|
|
|
|
|
|
namespace osu.Game.Screens.SelectV2
|
|
|
|
{
|
|
|
|
/// <summary>
|
2025-01-10 19:34:56 +09:00
|
|
|
/// An interface to be attached to any <see cref="Drawable"/>s which are used for display inside a <see cref="Carousel{T}"/>.
|
2025-01-24 18:34:04 +09:00
|
|
|
/// Importantly, all properties in this interface are managed by <see cref="Carousel{T}"/> and should not be written to elsewhere.
|
2025-01-10 20:55:53 +09:00
|
|
|
/// </summary>
|
|
|
|
public interface ICarouselPanel
|
|
|
|
{
|
2025-01-23 16:09:18 +09:00
|
|
|
/// <summary>
|
2025-02-04 17:16:36 +09:00
|
|
|
/// Whether this item has selection (see <see cref="Carousel{T}.CurrentSelection"/>). Should be read from to update the visual state.
|
2025-01-23 16:09:18 +09:00
|
|
|
/// </summary>
|
|
|
|
BindableBool Selected { get; }
|
|
|
|
|
2025-02-04 17:16:36 +09:00
|
|
|
/// <summary>
|
|
|
|
/// Whether this item is expanded (see <see cref="CarouselItem.IsExpanded"/>). Should be read from to update the visual state.
|
|
|
|
/// </summary>
|
|
|
|
BindableBool Expanded { get; }
|
|
|
|
|
2025-01-23 16:09:18 +09:00
|
|
|
/// <summary>
|
2025-01-24 18:34:04 +09:00
|
|
|
/// Whether this item has keyboard selection. Should be read from to update the visual state.
|
2025-01-23 16:09:18 +09:00
|
|
|
/// </summary>
|
|
|
|
BindableBool KeyboardSelected { get; }
|
|
|
|
|
2025-01-24 18:40:48 +09:00
|
|
|
/// <summary>
|
|
|
|
/// Called when the panel is activated. Should be used to update the panel's visual state.
|
|
|
|
/// </summary>
|
|
|
|
void Activated();
|
|
|
|
|
2025-01-10 20:55:53 +09:00
|
|
|
/// <summary>
|
2025-01-24 18:34:04 +09:00
|
|
|
/// The Y position used internally for positioning in the carousel.
|
2025-01-10 20:55:53 +09:00
|
|
|
/// </summary>
|
2025-01-15 17:01:07 +09:00
|
|
|
double DrawYPosition { get; set; }
|
2025-01-10 20:55:53 +09:00
|
|
|
|
|
|
|
/// <summary>
|
2025-01-24 18:34:04 +09:00
|
|
|
/// The carousel item this drawable is representing. Will be set before <see cref="PoolableDrawable.PrepareForUse"/> is called.
|
2025-01-10 20:55:53 +09:00
|
|
|
/// </summary>
|
|
|
|
CarouselItem? Item { get; set; }
|
|
|
|
}
|
|
|
|
}
|