Add filenames to Trait/Weapon/SpriteSequence docs metadata.

This commit is contained in:
Paul Chote
2025-01-05 20:01:50 +00:00
committed by Pavel Penev
parent 0efbefc62a
commit 711055a3bc
4 changed files with 57 additions and 0 deletions

View File

@@ -53,6 +53,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
static string GenerateJson(string version, IEnumerable<Type> weaponTypes, ObjectCreator objectCreator)
{
var relatedEnumTypes = new HashSet<Type>();
var pdbReaderCache = Utilities.CreatePdbReaderCache();
var weaponTypesInfo = weaponTypes
.Where(x => !x.ContainsGenericParameters && !x.IsAbstract)
@@ -61,6 +62,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
type.Namespace,
Name = type.Name.EndsWith("Info", StringComparison.Ordinal) ? type.Name[..^4] : type.Name,
Description = string.Join(" ", Utility.GetCustomAttributes<DescAttribute>(type, false).SelectMany(d => d.Lines)),
Filename = Utilities.GetSourceFilenameFromPdb(type, pdbReaderCache),
InheritedTypes = type.BaseTypes()
.Select(y => y.Name)
.Where(y => y != type.Name && y != $"{type.Name}Info" && y != "Object"),