- S4-03 | 先固化 Tag 系统设计与首发范围
- S4-04 | 实现组件实例 Tag 的统一生成入口 - S4-05 | 实现组塔后的 Tag 汇总与展示入口
This commit is contained in:
@@ -43,7 +43,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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace GeometryTD.UI
|
||||
item.Name,
|
||||
BuildComponentTypeText(item.SlotType),
|
||||
ItemDescUtility.BuildMuzzleDesc(item) ?? string.Empty,
|
||||
item.Tags);
|
||||
TagDisplayUtility.BuildTagTexts(item.Tags));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace GeometryTD.UI
|
||||
item.Name,
|
||||
BuildComponentTypeText(item.SlotType),
|
||||
ItemDescUtility.BuildBearingDesc(item) ?? string.Empty,
|
||||
item.Tags);
|
||||
TagDisplayUtility.BuildTagTexts(item.Tags));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace GeometryTD.UI
|
||||
item.Name,
|
||||
BuildComponentTypeText(item.SlotType),
|
||||
ItemDescUtility.BuildBaseDesc(item) ?? string.Empty,
|
||||
item.Tags);
|
||||
TagDisplayUtility.BuildTagTexts(item.Tags));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace GeometryTD.UI
|
||||
_compAreaTowerIds.Add(itemContext.InstanceId);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -181,15 +181,10 @@ namespace GeometryTD.UI
|
||||
Title = string.IsNullOrWhiteSpace(title) ? $"Item {itemId}" : title,
|
||||
TypeText = typeText ?? string.Empty,
|
||||
Description = description ?? string.Empty,
|
||||
Tags = CloneTags(tags)
|
||||
TagTexts = tagTexts != null ? (string[])tagTexts.Clone() : Array.Empty<string>()
|
||||
};
|
||||
}
|
||||
|
||||
private static TagType[] CloneTags(TagType[] tags)
|
||||
{
|
||||
return tags != null ? (TagType[])tags.Clone() : Array.Empty<TagType>();
|
||||
}
|
||||
|
||||
private static string BuildComponentTypeText(TowerCompSlotType slotType)
|
||||
{
|
||||
return slotType switch
|
||||
@@ -391,4 +386,3 @@ namespace GeometryTD.UI
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace GeometryTD.UI
|
||||
public string Title;
|
||||
public string TypeText;
|
||||
public string Description;
|
||||
public TagType[] Tags;
|
||||
public string[] TagTexts;
|
||||
}
|
||||
|
||||
protected override UIFormType UIFormTypeId => UIFormType.RepoForm;
|
||||
@@ -151,7 +151,7 @@ namespace GeometryTD.UI
|
||||
Description = seed.Description ?? string.Empty,
|
||||
Price = 0,
|
||||
TargetPos = args.TargetPos,
|
||||
Tags = CloneTags(seed.Tags)
|
||||
TagTexts = CloneTagTexts(seed.TagTexts)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -301,5 +301,9 @@ namespace GeometryTD.UI
|
||||
}
|
||||
|
||||
#endregion
|
||||
private static string[] CloneTagTexts(string[] tagTexts)
|
||||
{
|
||||
return tagTexts != null ? (string[])tagTexts.Clone() : System.Array.Empty<string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user