feat(dialog): 重构选项已选状态视觉表现
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user