Made Tooltip trait upgradable
This commit is contained in:
@@ -70,7 +70,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Footprint = new ReadOnlyDictionary<CPos, SubCell>(footprint);
|
||||
}
|
||||
|
||||
var tooltip = Info.TraitInfoOrDefault<EditorOnlyTooltipInfo>() as TooltipInfoBase ?? Info.TraitInfoOrDefault<TooltipInfo>();
|
||||
var tooltip = Info.TraitInfos<EditorOnlyTooltipInfo>().FirstOrDefault(Exts.IsTraitEnabled) as TooltipInfoBase
|
||||
?? Info.TraitInfos<TooltipInfo>().FirstOrDefault(Exts.IsTraitEnabled);
|
||||
|
||||
Tooltip = (tooltip == null ? " < " + Info.Name + " >" : tooltip.Name) + "\n" + owner.Name + " (" + owner.Faction + ")"
|
||||
+ "\nID: " + ID + "\nType: " + Info.Name;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user