S4-07 process 1

This commit is contained in:
SepComet
2026-03-11 10:18:14 +08:00
parent 52f9e212b9
commit 9de2e50262
32 changed files with 803 additions and 194 deletions
@@ -32,20 +32,39 @@ namespace GeometryTD.UI
{
Title = rawData.Title,
TypeText = rawData.TypeText,
Description = rawData.Description,
Description = BuildDescription(rawData),
Price = rawData.Price,
TargetPos = rawData.TargetPos,
Tags = BuildTags(rawData)
};
}
private static string BuildDescription(ItemDescFormRawData rawData)
{
string baseDescription = rawData?.Description ?? string.Empty;
string tagDescription = rawData?.TagRuntimes != null && rawData.TagRuntimes.Length > 0
? TagDisplayUtility.BuildTagDescriptionText(rawData.TagRuntimes)
: TagDisplayUtility.BuildTagDescriptionText(rawData?.Tags);
if (string.IsNullOrWhiteSpace(tagDescription))
{
return baseDescription;
}
if (string.IsNullOrWhiteSpace(baseDescription))
{
return tagDescription;
}
return $"{baseDescription}\n{tagDescription}";
}
private static TagItemContext[] BuildTags(ItemDescFormRawData rawData)
{
string[] tagTexts = rawData?.TagTexts;
if ((tagTexts == null || tagTexts.Length <= 0) && rawData?.Tags != null)
{
tagTexts = TagDisplayUtility.BuildTagTexts(rawData.Tags);
}
string[] tagTexts = rawData?.TagRuntimes != null && rawData.TagRuntimes.Length > 0
? TagDisplayUtility.BuildTagTexts(rawData.TagRuntimes)
: rawData?.Tags != null
? TagDisplayUtility.BuildTagTexts(rawData.Tags)
: null;
if (tagTexts == null || tagTexts.Length <= 0)
{
@@ -11,6 +11,6 @@ namespace GeometryTD.UI
public int Price;
public Vector3 TargetPos;
public TagType[] Tags;
public string[] TagTexts;
public TagRuntimeData[] TagRuntimes;
}
}