更新版本号至 1.2.1.19,优化 README 文档中的功能描述,增强用户对技能和物品图标数据包的理解。添加对物品 ID 的支持,改进状态管理和条件字段显示,确保用户界面信息展示更加清晰。

This commit is contained in:
waynebian01
2026-09-01 17:05:20 +08:00
parent 3a5b4e8db5
commit ccd670dfb5
13 changed files with 1596 additions and 63 deletions

View File

@@ -61,6 +61,8 @@ public sealed class ModuleEditorControl : UserControl
private readonly List<ModuleValueAdjustment> _valueAdjustments = new();
private readonly Dictionary<string, List<long>> _currentClassSpellIdsByName =
new(StringComparer.Ordinal);
private readonly Dictionary<string, List<long>> _currentSpecItemIdsByName =
new(StringComparer.Ordinal);
private readonly List<ConditionSpell> _currentClassConditionSpells = new();
private HashSet<string>? _availableConditionFields;
private HashSet<string>? _availableGroupConditionFields;
@@ -595,6 +597,8 @@ public sealed class ModuleEditorControl : UserControl
_specBox.SelectedIndexChanged += (_, _) =>
{
ResetHeroTalentOptions(_heroTalentBox, ReadMatchCombo(_classBox), ReadMatchCombo(_specBox));
ReloadCurrentClassSpellIds();
RefreshRuleSpellIcons();
RefreshAdjustmentFieldColumn();
InvalidateConditionFieldValidation();
_rulesGrid.Invalidate();
@@ -1202,6 +1206,7 @@ public sealed class ModuleEditorControl : UserControl
private void ReloadCurrentClassSpellIds()
{
_currentClassSpellIdsByName.Clear();
_currentSpecItemIdsByName.Clear();
_currentClassConditionSpells.Clear();
var classId = ReadMatchCombo(_classBox);
if (classId is null)
@@ -1239,6 +1244,31 @@ public sealed class ModuleEditorControl : UserControl
spellIds.Add(spell.SpellId);
}
}
var specId = ReadMatchCombo(_specBox);
if (specId is not null && document.Specs.TryGetValue(specId.Value, out var spec))
{
foreach (var item in spec.Items)
{
if (item.ItemId is not { } itemId || itemId <= 0 || string.IsNullOrWhiteSpace(item.Name))
{
continue;
}
var name = item.Name.Trim();
SpellIconCatalog.RegisterItem(itemId, name);
if (!_currentSpecItemIdsByName.TryGetValue(name, out var itemIds))
{
itemIds = [];
_currentSpecItemIdsByName[name] = itemIds;
}
if (!itemIds.Contains(itemId))
{
itemIds.Add(itemId);
}
}
}
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException
or InvalidDataException or ArgumentException)
@@ -1255,6 +1285,33 @@ public sealed class ModuleEditorControl : UserControl
return null;
}
if (_currentSpecItemIdsByName.TryGetValue(normalized, out var itemIds))
{
foreach (var itemId in itemIds)
{
var icon = SpellIconCatalog.GetItem(itemId);
if (icon is not null)
{
return icon;
}
}
}
if (SpellIconCatalog.TryParseItemReference(normalized, out var explicitItemId))
{
var icon = SpellIconCatalog.GetItem(explicitItemId);
if (icon is not null)
{
return icon;
}
}
var officialItemIcon = SpellIconCatalog.GetItem(normalized);
if (officialItemIcon is not null)
{
return officialItemIcon;
}
if (_currentClassSpellIdsByName.TryGetValue(normalized, out var spellIds))
{
foreach (var spellId in spellIds)