剧情+对话完善

This commit is contained in:
SoulliesOfficial
2026-07-21 15:24:42 -04:00
parent 8f230831e9
commit 810d019619
161 changed files with 7271 additions and 1893 deletions

View File

@@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
namespace Ichni.Story.Dialogue
{
/// <summary>对话记录中一条已经实际显示或采用的内容。</summary>
[Serializable]
public sealed class DialogueHistoryEntry
{
public string speakerName;
public string content;
public bool isChoice;
}
/// <summary>
/// 当前一次 TextBlock 对话专用的临时记录。
/// <para>记录不会写入 ES3开始下一次对话、正常结束或点击 Back 取消时都会清空,
/// 因而它只承担 DialogUIPage 内的“本次对话回顾”职责。</para>
/// </summary>
public static class DialogueHistory
{
private static readonly List<DialogueHistoryEntry> EntriesInternal = new();
public static IReadOnlyList<DialogueHistoryEntry> Entries => EntriesInternal;
public static void BeginSession() => EntriesInternal.Clear();
public static void AddLine(string speakerName, string content)
{
if (string.IsNullOrWhiteSpace(content))
return;
EntriesInternal.Add(new DialogueHistoryEntry
{
speakerName = speakerName ?? string.Empty,
content = content,
isChoice = false
});
}
public static void AddChoice(string content)
{
if (string.IsNullOrWhiteSpace(content))
return;
EntriesInternal.Add(new DialogueHistoryEntry
{
speakerName = string.Empty,
content = content,
isChoice = true
});
}
public static void Clear() => EntriesInternal.Clear();
}
}