Fix tooltips in the Encyclopedia.
If multiple tooltips are defined with conditionals attached, the Encyclopedia could not handle this. Now, it selects the tooltip EnabledByDefault to match usage across the rest of the code.
This commit is contained in:
committed by
Matthias Mailänder
parent
00203201f4
commit
a2edc82b0c
@@ -114,7 +114,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
() => SelectActor(actor));
|
||||
|
||||
var label = item.Get<LabelWithTooltipWidget>("TITLE");
|
||||
var name = actor.TraitInfoOrDefault<TooltipInfo>()?.Name;
|
||||
var name = actor.TraitInfos<TooltipInfo>().FirstOrDefault(info => info.EnabledByDefault)?.Name;
|
||||
if (!string.IsNullOrEmpty(name))
|
||||
WidgetUtils.TruncateLabelToTooltip(label, TranslationProvider.GetString(name));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user