Skip to content

Commit

Permalink
add base effect to entity tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
SWeini committed Dec 27, 2024
1 parent 0154858 commit 77abbd6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Yafc/Widgets/ObjectTooltip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 77abbd6

Please sign in to comment.