44 lines
1.5 KiB
C#
44 lines
1.5 KiB
C#
using UnityEngine;
|
|
|
|
namespace Ashwild.Inventory
|
|
{
|
|
/// <summary>
|
|
/// The view payload for the hover description panel: exactly what the panel renders (icon,
|
|
/// name, description, and an optional duration/uses bar), nothing more. The inventory manager
|
|
/// builds one of these from a hovered slot and pushes it into the view, so the panel never
|
|
/// touches ItemData or the inventory model — it just draws what it is handed.
|
|
/// </summary>
|
|
public readonly struct ItemDescriptionView
|
|
{
|
|
public readonly Sprite Icon;
|
|
public readonly string Name;
|
|
public readonly string Description;
|
|
|
|
/// <summary>
|
|
/// Whether the hovered item tracks uses/durability and should show its duration bar.
|
|
/// </summary>
|
|
public readonly bool HasDuration;
|
|
|
|
/// <summary>
|
|
/// Remaining uses as a 0..1 fill for the bar's Filled image.
|
|
/// </summary>
|
|
public readonly float DurationFill;
|
|
|
|
/// <summary>
|
|
/// The remaining/max label drawn over the bar, e.g. "3 / 5".
|
|
/// </summary>
|
|
public readonly string DurationText;
|
|
|
|
public ItemDescriptionView(Sprite icon, string name, string description,
|
|
bool hasDuration, float durationFill, string durationText)
|
|
{
|
|
Icon = icon;
|
|
Name = name;
|
|
Description = description;
|
|
HasDuration = hasDuration;
|
|
DurationFill = durationFill;
|
|
DurationText = durationText;
|
|
}
|
|
}
|
|
}
|