标记 #option_prompt 的台词不再进入普通台词流程,由 OptionView 暂存并在下一组 Dream Options 出现时显示在选项上方,同时通过 新增 LineHistoryAppend 事件加入对话历史。OnelineOptions 支持 提示语文本与独立选项根节点,并改为按实例追踪销毁按钮。
106 lines
2.0 KiB
C#
106 lines
2.0 KiB
C#
using System.Text.RegularExpressions;
|
|
using AibisDream.Kit;
|
|
using AibisDream.Utility;
|
|
using Yarn.Unity;
|
|
|
|
namespace AibisDream
|
|
{
|
|
public enum EventEnum
|
|
{
|
|
NextYarn,
|
|
PlugIn,
|
|
PlugOut,
|
|
SceneLoad,
|
|
FixSceneModeChanged,
|
|
CutEnd
|
|
}
|
|
|
|
public enum GameLifecycleEvent
|
|
{
|
|
ApplicationReady,
|
|
SessionStarted,
|
|
SessionReady,
|
|
SessionPaused,
|
|
SessionResumed,
|
|
SessionEnding,
|
|
SessionEnded,
|
|
SessionFailed
|
|
}
|
|
|
|
public enum DialogEventEnum
|
|
{
|
|
StartNode,
|
|
|
|
LineStart,
|
|
LineShown,
|
|
LineEnd,
|
|
OptionShow,
|
|
OptionSelected,
|
|
LineHistoryAppend
|
|
}
|
|
|
|
public enum InteractionEventEnum
|
|
{
|
|
DialogStart,
|
|
DialogEnd
|
|
}
|
|
|
|
public enum ScreenEventEnum
|
|
{
|
|
RegisterLineView,
|
|
|
|
Selected
|
|
}
|
|
|
|
public struct DialogText
|
|
{
|
|
public bool isOption;
|
|
public string line;
|
|
public CharacterVo actor;
|
|
public string lineId;
|
|
|
|
public static DialogText GetLine(LocalizedLine dialogueLine)
|
|
{
|
|
return new DialogText
|
|
{
|
|
isOption = false,
|
|
line = dialogueLine.TextWithoutCharacterName.Text,
|
|
lineId = dialogueLine.TextID,
|
|
actor = dialogueLine.GetCharacterVo()
|
|
};
|
|
}
|
|
|
|
public string GetRecordLine()
|
|
{
|
|
const string allowedTagsPattern = @"(<|{)(?!\/?(b|i|color)(?=>|\s|=))[^(>|})]+(>|})";
|
|
var res = Regex.Replace(line, allowedTagsPattern, "");
|
|
return res;
|
|
}
|
|
}
|
|
|
|
public enum StorageEvent
|
|
{
|
|
VariableSet
|
|
}
|
|
|
|
public enum SettingChangeEvent
|
|
{
|
|
TextSpeed,
|
|
LocaleChanged,
|
|
DisplayChanged
|
|
}
|
|
|
|
public enum TerminalUIAudioEnum
|
|
{
|
|
Hover,
|
|
Click,
|
|
}
|
|
|
|
public enum TerminalUIEvent
|
|
{
|
|
MainMenuPhase,
|
|
PauseMenuAmbEnter,
|
|
PauseMenuAmbExit,
|
|
}
|
|
}
|