Merge pull request #11984 from reaperrr/upgradable-tooltip

Make Tooltip upgradable
This commit is contained in:
Oliver Brakmann
2016-10-26 20:48:19 +02:00
committed by GitHub
10 changed files with 78 additions and 17 deletions

View File

@@ -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;