Story流程+本地化
This commit is contained in:
@@ -94,8 +94,6 @@ namespace Ichni.Story.Dialogue
|
||||
|
||||
public override YarnTask OnDialogueStartedAsync()
|
||||
{
|
||||
Debug.Log("[YarnDiag] VNDialoguePresenter.OnDialogueStartedAsync 开始。");
|
||||
|
||||
// 快进是一次 Yarn 对话会话的临时操作,绝不能遗留到下一次进入 TextBlock。
|
||||
_isFastForwarding = false;
|
||||
_typewriterComplete = false;
|
||||
@@ -104,7 +102,6 @@ namespace Ichni.Story.Dialogue
|
||||
DialogueHistory.BeginSession();
|
||||
|
||||
Page.PlayFadeIn();
|
||||
Debug.Log("[YarnDiag] VNDialoguePresenter.OnDialogueStartedAsync 完成。");
|
||||
return YarnTask.CompletedTask;
|
||||
}
|
||||
|
||||
@@ -112,8 +109,6 @@ namespace Ichni.Story.Dialogue
|
||||
{
|
||||
if (Page == null) return;
|
||||
|
||||
Debug.Log($"[YarnDiag] VNDialoguePresenter.RunLineAsync: LineID='{line.TextID}', Speaker='{line.CharacterName}', Text='{line.TextWithoutCharacterName.Text}', RawText='{line.RawText}'");
|
||||
|
||||
// 确保选项区不可见;台词区始终可见
|
||||
if (Page.choiceFrame != null) Page.choiceFrame.SetActive(false);
|
||||
|
||||
@@ -130,7 +125,8 @@ namespace Ichni.Story.Dialogue
|
||||
if (string.IsNullOrEmpty(fullText) && !string.IsNullOrEmpty(line.RawText))
|
||||
{
|
||||
fullText = line.RawText;
|
||||
Debug.LogWarning($"[YarnDiag] [WARNING] 台词 '{line.TextID}' 本地化解析结果为空,回退使用 RawText: '{fullText}'");
|
||||
Debug.LogWarning(
|
||||
$"[VNDialoguePresenter] 台词 '{line.TextID}' 的本地化结果为空,已回退使用 Yarn RawText。");
|
||||
}
|
||||
// 记录的是本次实际展示时已经解析完成的本地化文本,而非 Yarn Key。
|
||||
DialogueHistory.AddLine(line.CharacterName, fullText);
|
||||
@@ -291,37 +287,30 @@ namespace Ichni.Story.Dialogue
|
||||
|
||||
private void OnAdvanceButtonClicked()
|
||||
{
|
||||
Debug.Log($"[YarnDiag] OnAdvanceButtonClicked 推进按钮被点击!_runner={(_runner != null ? _runner.name : "null")}, _typewriterComplete={_typewriterComplete}, _isFastForwarding={_isFastForwarding}, _optionTcs={(_optionTcs != null)}");
|
||||
|
||||
// 未记忆选项必须由 ChoiceButton 明确选择;推进按钮不能越过当前选择。
|
||||
if (_optionTcs != null)
|
||||
{
|
||||
Debug.LogWarning("[YarnDiag] OnAdvanceButtonClicked 被拦截:正在等待选项选择。");
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果玩家在快进时点击屏幕/推进键,则打断快进状态并停止当前动作
|
||||
if (_isFastForwarding)
|
||||
{
|
||||
Debug.Log("[YarnDiag] OnAdvanceButtonClicked 打断快进模式。");
|
||||
_isFastForwarding = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (_runner == null)
|
||||
{
|
||||
Debug.LogError("[YarnDiag] [ERROR] OnAdvanceButtonClicked 拦截:_runner 为 null!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_typewriterComplete)
|
||||
{
|
||||
Debug.Log("[YarnDiag] RequestHurryUpLine (跳过打字效果)");
|
||||
_runner.RequestHurryUpLine(); // 第一次点击:跳过打字效果
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("[YarnDiag] RequestNextLine (推进下一行)");
|
||||
_runner.RequestNextLine(); // 第二次点击:推进到下一行
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user