2025-01-10 19:55:53 +08: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 15:09:18 +08:00
|
|
|
using osu.Framework.Bindables;
|
2025-01-10 19:55:53 +08:00
|
|
|
using osu.Framework.Graphics;
|
2025-01-24 17:34:04 +08:00
|
|
|
using osu.Framework.Graphics.Pooling;
|
2025-01-10 19:55:53 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Screens.SelectV2
|
|
|
|
{
|
|
|
|
/// <summary>
|
2025-01-10 18:34:56 +08: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 17:34:04 +08:00
|
|
|
/// Importantly, all properties in this interface are managed by <see cref="Carousel{T}"/> and should not be written to elsewhere.
|
2025-01-10 19:55:53 +08:00
|
|
|
/// </summary>
|
|
|
|
public interface ICarouselPanel
|
|
|
|
{
|
2025-01-23 15:09:18 +08:00
|
|
|
/// <summary>
|
2025-02-04 16:16:36 +08:00
|
|
|
/// Whether this item has selection (see <see cref="Carousel{T}.CurrentSelection"/>). Should be read from to update the visual state.
|
2025-01-23 15:09:18 +08:00
|
|
|
/// </summary>
|
|
|
|
BindableBool Selected { get; }
|
|
|
|
|
2025-02-04 16:16:36 +08: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 15:09:18 +08:00
|
|
|
/// <summary>
|
2025-01-24 17:34:04 +08:00
|
|
|
/// Whether this item has keyboard selection. Should be read from to update the visual state.
|
2025-01-23 15:09:18 +08:00
|
|
|
/// </summary>
|
|
|
|
BindableBool KeyboardSelected { get; }
|
|
|
|
|
2025-01-24 17:40:48 +08:00
|
|
|
/// <summary>
|
|
|
|
/// Called when the panel is activated. Should be used to update the panel's visual state.
|
|
|
|
/// </summary>
|
|
|
|
void Activated();
|
|
|
|
|
2025-01-10 19:55:53 +08:00
|
|
|
/// <summary>
|
2025-01-24 17:34:04 +08:00
|
|
|
/// The Y position used internally for positioning in the carousel.
|
2025-01-10 19:55:53 +08:00
|
|
|
/// </summary>
|
2025-01-15 16:01:07 +08:00
|
|
|
double DrawYPosition { get; set; }
|
2025-01-10 19:55:53 +08:00
|
|
|
|
|
|
|
/// <summary>
|
2025-01-24 17:34:04 +08:00
|
|
|
/// The carousel item this drawable is representing. Will be set before <see cref="PoolableDrawable.PrepareForUse"/> is called.
|
2025-01-10 19:55:53 +08:00
|
|
|
/// </summary>
|
|
|
|
CarouselItem? Item { get; set; }
|
|
|
|
}
|
|
|
|
}
|