From 77abbd6c2a5cffad66f979be17c3c82cf3dd1692 Mon Sep 17 00:00:00 2001 From: Simon Weinberger Date: Fri, 27 Dec 2024 09:09:20 +0100 Subject: [PATCH] add base effect to entity tooltip --- Yafc/Widgets/ObjectTooltip.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Yafc/Widgets/ObjectTooltip.cs b/Yafc/Widgets/ObjectTooltip.cs index 34e12a45..7d114dfd 100644 --- a/Yafc/Widgets/ObjectTooltip.cs +++ b/Yafc/Widgets/ObjectTooltip.cs @@ -242,9 +242,15 @@ private void BuildEntity(Entity entity, Quality quality, ImGui gui) { gui.BuildText(DataUtils.FormatAmount(crafter.CraftingSpeed(quality), UnitOfMeasure.Percent, "Crafting speed: ")); } - float productivity = crafter.effectReceiver?.baseEffect.productivity ?? 0; - if (productivity != 0f) { - gui.BuildText(DataUtils.FormatAmount(productivity, UnitOfMeasure.Percent, "Crafting productivity: ")); + Effect baseEffect = crafter.effectReceiver.baseEffect; + if (baseEffect.speed != 0f) { + gui.BuildText(DataUtils.FormatAmount(baseEffect.speed, UnitOfMeasure.Percent, "Crafting speed: ")); + } + if (baseEffect.productivity != 0f) { + gui.BuildText(DataUtils.FormatAmount(baseEffect.productivity, UnitOfMeasure.Percent, "Crafting productivity: ")); + } + if (baseEffect.consumption != 0f) { + gui.BuildText(DataUtils.FormatAmount(baseEffect.consumption, UnitOfMeasure.Percent, "Energy consumption: ")); } if (crafter.allowedEffects != AllowedEffects.None) {