- S4-03 | 先固化 Tag 系统设计与首发范围

- S4-04 | 实现组件实例 Tag 的统一生成入口
- S4-05 | 实现组塔后的 Tag 汇总与展示入口
This commit is contained in:
SepComet
2026-03-09 21:06:43 +08:00
parent 73b7adedb8
commit 34ef001ef3
31 changed files with 1280 additions and 178 deletions
@@ -18,7 +18,7 @@ namespace GeometryTD.UI
public string Title;
public string TypeText;
public string Description;
public TagType[] Tags;
public string[] TagTexts;
}
protected override UIFormType UIFormTypeId => UIFormType.CombatFinishForm;
@@ -138,7 +138,7 @@ namespace GeometryTD.UI
tower.Name,
"Tower",
ItemDescUtility.BuildTowerDesc(tower, muzzleMap, bearingMap, baseMap) ?? string.Empty,
tower.Stats != null ? tower.Stats.Tags : null);
TagDisplayUtility.BuildTowerTagTexts(tower.Stats));
}
}
@@ -166,7 +166,7 @@ namespace GeometryTD.UI
item.Name,
BuildComponentTypeText(item.SlotType),
ItemDescUtility.BuildMuzzleDesc(item) ?? string.Empty,
item.Tags);
TagDisplayUtility.BuildTagTexts(item.Tags));
}
}
@@ -194,7 +194,7 @@ namespace GeometryTD.UI
item.Name,
BuildComponentTypeText(item.SlotType),
ItemDescUtility.BuildBearingDesc(item) ?? string.Empty,
item.Tags);
TagDisplayUtility.BuildTagTexts(item.Tags));
}
}
@@ -222,7 +222,7 @@ namespace GeometryTD.UI
item.Name,
BuildComponentTypeText(item.SlotType),
ItemDescUtility.BuildBaseDesc(item) ?? string.Empty,
item.Tags);
TagDisplayUtility.BuildTagTexts(item.Tags));
}
}
@@ -261,7 +261,7 @@ namespace GeometryTD.UI
return Color.white;
}
private void AddItemDescSeed(long itemId, string title, string typeText, string description, TagType[] tags)
private void AddItemDescSeed(long itemId, string title, string typeText, string description, string[] tagTexts)
{
if (itemId <= 0)
{
@@ -273,13 +273,13 @@ namespace GeometryTD.UI
Title = string.IsNullOrWhiteSpace(title) ? $"Item {itemId}" : title,
TypeText = typeText ?? string.Empty,
Description = description ?? string.Empty,
Tags = CloneTags(tags)
TagTexts = CloneTagTexts(tagTexts)
};
}
private static TagType[] CloneTags(TagType[] tags)
private static string[] CloneTagTexts(string[] tagTexts)
{
return tags != null ? (TagType[])tags.Clone() : System.Array.Empty<TagType>();
return tagTexts != null ? (string[])tagTexts.Clone() : System.Array.Empty<string>();
}
private static string BuildComponentTypeText(TowerCompSlotType slotType)
@@ -374,7 +374,7 @@ namespace GeometryTD.UI
Description = seed.Description ?? string.Empty,
Price = 0,
TargetPos = args.TargetPos,
Tags = CloneTags(seed.Tags)
TagTexts = CloneTagTexts(seed.TagTexts)
});
}
@@ -405,4 +405,3 @@ namespace GeometryTD.UI