Story流程+本地化

This commit is contained in:
SoulliesOfficial
2026-07-24 17:56:30 -04:00
parent b0e0a7d5aa
commit de70870682
250 changed files with 5719 additions and 272966 deletions

View File

@@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using DG.Tweening;
using Ichni.Localization;
using UnityEngine;
using UnityEngine.Localization.Settings;
using UnityEngine.UI;
namespace Ichni.Story
@@ -162,8 +162,8 @@ namespace Ichni.Story
_activeTalk = Instantiate(helperTalkPrefab, helperTalkContainer);
_activeTalk.Closed += HandleTalkClosed;
_activeTalk.Show(
GetLocalizedText(helperData, helperData.displayNameKey, helperData.name),
GetLocalizedText(helperData, contentKey, contentKey));
LocalizationTextService.Resolve(helperData.localizationTable, helperData.displayNameKey, helperData.name),
LocalizationTextService.Resolve(helperData.localizationTable, contentKey, contentKey));
}
/// <summary>
@@ -322,24 +322,6 @@ namespace Ichni.Story
visualPresenter?.ApplyHelper(helperData);
}
/// <summary>本地化失败时显示 Key确保测试阶段仍能定位缺失条目而不是得到空白气泡。</summary>
private string GetLocalizedText(StoryHelperData helperData, string key, string fallback)
{
if (string.IsNullOrEmpty(key) || helperData == null)
return fallback;
try
{
string localized = LocalizationSettings.StringDatabase.GetLocalizedString(helperData.localizationTable, key);
return string.IsNullOrEmpty(localized) ? fallback : localized;
}
catch (Exception exception)
{
Debug.LogWarning($"[StoryHelper] 无法本地化 Key '{key}',将回退显示 '{fallback}'。{exception.Message}", this);
return fallback;
}
}
private void CacheBaseTransforms()
{
if (idleRoot != null)