48 lines
1.5 KiB
C#
48 lines
1.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Cielonos.MainGame.UI
|
|
{
|
|
/// <summary>
|
|
/// 确认页面的单个按钮配置。
|
|
/// </summary>
|
|
public class ConfirmButtonConfig
|
|
{
|
|
/// <summary>按钮显示文本(传入时应已完成本地化)。</summary>
|
|
public string Label { get; }
|
|
|
|
/// <summary>
|
|
/// 点击回调。为 null 表示仅关闭确认页面,不执行额外操作。
|
|
/// 回调在页面关闭动画结束后触发。
|
|
/// </summary>
|
|
public Action OnClick { get; }
|
|
|
|
public ConfirmButtonConfig(string label, Action onClick = null)
|
|
{
|
|
Label = label;
|
|
OnClick = onClick;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 确认页面的完整配置数据,用于动态创建 <see cref="ConfirmUIPage"/>。
|
|
/// </summary>
|
|
public class ConfirmPageConfig
|
|
{
|
|
/// <summary>标题文本。</summary>
|
|
public string Title { get; set; } = string.Empty;
|
|
|
|
/// <summary>描述文本。</summary>
|
|
public string Description { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// 按钮列表,按从左到右的顺序排列。
|
|
/// 至少需要一个按钮。
|
|
/// </summary>
|
|
public List<ConfirmButtonConfig> Buttons { get; set; } = new();
|
|
|
|
/// <summary>是否允许按 ESC 关闭(等同于取消),默认 true。</summary>
|
|
public bool AllowEscClose { get; set; } = true;
|
|
}
|
|
}
|