feat(dialog): 重构选项已选状态视觉表现

This commit is contained in:
2026-05-25 18:43:23 +08:00
parent 7e579a2eb0
commit db5fbb0cb8
5 changed files with 15 additions and 142 deletions
@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Collections.Generic;
using AibisDream.Framework;
@@ -15,7 +15,6 @@ namespace AibisDream
private DialogueOption _option;
public bool IsAvailable => _option.IsAvailable;
public bool IsSelected { get; private set; }
public string Line => _option.Line.TextWithoutCharacterName.Text;
public CharacterVo Character => _option.Line.GetCharacterVo();
@@ -51,21 +50,6 @@ namespace AibisDream
return dialogueOptions
.Select(item => new DialogOption { _option = item, _onOptionSelected = onOptionSelected }).ToArray();
}
public static DialogOption[] GeneOptions(DialogueOption[] dialogueOptions, Action<int> onOptionSelected, HashSet<string> selectedIds)
{
var options = new List<DialogOption>();
foreach (var item in dialogueOptions)
{
var option = new DialogOption { _option = item, _onOptionSelected = onOptionSelected };
if (selectedIds.Contains(option._option.TextID))
{
option.IsSelected = true;
}
options.Add(option);
}
return options.ToArray();
}
}
[Serializable]