From a2edc82b0cfb72af2d38bed64e32eb87f96f74b7 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Tue, 6 Aug 2024 19:58:48 +0100 Subject: [PATCH] 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. --- OpenRA.Mods.Common/Widgets/Logic/EncyclopediaLogic.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/EncyclopediaLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/EncyclopediaLogic.cs index d920fe995e..117d6351a0 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/EncyclopediaLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/EncyclopediaLogic.cs @@ -114,7 +114,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic () => SelectActor(actor)); var label = item.Get("TITLE"); - var name = actor.TraitInfoOrDefault()?.Name; + var name = actor.TraitInfos().FirstOrDefault(info => info.EnabledByDefault)?.Name; if (!string.IsNullOrEmpty(name)) WidgetUtils.TruncateLabelToTooltip(label, TranslationProvider.GetString(name));