Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
go back to using Type.Name
Browse files Browse the repository at this point in the history
  • Loading branch information
Chasmical committed Jul 17, 2021
1 parent 42de3ca commit 591a773
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion RogueLibsCore/Hooks/Effects/EffectInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private EffectInfo(Type type)
throw new ArgumentException($"The specified {nameof(type)} is not a {nameof(CustomEffect)}.", nameof(type));

EffectNameAttribute attr = type.GetCustomAttributes<EffectNameAttribute>().FirstOrDefault();
Name = attr?.Name ?? type.FullName;
Name = attr?.Name ?? type.Name;

EffectParametersAttribute parsAttr = type.GetCustomAttributes<EffectParametersAttribute>().FirstOrDefault();
if (parsAttr is null)
Expand Down
2 changes: 1 addition & 1 deletion RogueLibsCore/Hooks/Items/ItemInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private ItemInfo(Type type)
throw new ArgumentException($"{nameof(type)} does not inherit from {nameof(CustomItem)}!", nameof(type));

ItemNameAttribute nameAttr = type.GetCustomAttributes<ItemNameAttribute>().FirstOrDefault();
Name = nameAttr?.Name ?? type.FullName;
Name = nameAttr?.Name ?? type.Name;

string[] categories = type.GetCustomAttributes<ItemCategoriesAttribute>().SelectMany(c => c.Categories).Distinct().ToArray();
Categories = new ReadOnlyCollection<string>(categories);
Expand Down
2 changes: 1 addition & 1 deletion RogueLibsCore/Hooks/Traits/TraitInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private TraitInfo(Type type)
throw new ArgumentException($"The specified type is not a {nameof(CustomTrait)}!", nameof(type));

TraitNameAttribute nameAttr = type.GetCustomAttributes<TraitNameAttribute>().FirstOrDefault();
Name = nameAttr?.Name ?? type.FullName;
Name = nameAttr?.Name ?? type.Name;
}
}
/// <summary>
Expand Down

0 comments on commit 591a773

Please sign in to comment.