Skip to content

Cost breakdown UI#567

Open
Roxxik wants to merge 4 commits intoYafc-CE:masterfrom
Roxxik:cost-breakdown-ui
Open

Cost breakdown UI#567
Roxxik wants to merge 4 commits intoYafc-CE:masterfrom
Roxxik:cost-breakdown-ui

Conversation

@Roxxik
Copy link
Copy Markdown

@Roxxik Roxxik commented Feb 4, 2026

This PR is in spirit similar to #509 from ApocDev, but without duplicating the LogisticCost logic and visually better integrated with the rest of the Tooltip.

  • Holding Ctrl before hovering over a recipe will show a cost breakdown.
  • Holding Ctrl+Shift before hovering over a recipe will show a cost breakdown at current milestones (if the cost are available)

It is split into 3 commits:

  1. isolate the LogisticCost logic
  2. add the Info to the tooltip
  3. allows to toggle between endgame and current milestone cost

Full Cost:
image

At current milestone:
image

Please note anything you would want to change, I'm open to suggestions.

   Extract RecipeLogisticsBreakdown record and ComputeLogisticsBreakdown
   method to share logistics cost calculation between CostAnalysis.Compute
   and UI tooltip display.
   Show ingredient cost, product value, and logistics cost in recipe tooltips.
   Hold Ctrl to see detailed logistics breakdown and per-item costs.
   Uses milestone-aware costs with fallback to full costs.
Hold Shift while viewing recipe tooltips to show costs at current milestones.
Display N/A for non-automatable recipes or infinite ingredient costs.
Update item cost display and localization hints accordingly.
@Roxxik Roxxik requested a review from shpaass as a code owner February 4, 2026 23:12
Copy link
Copy Markdown
Collaborator

@veger veger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for splitting the PR up into separate commits, it helps understanding/seeing what you did!

In overall the changes look good to me. I left one remark

Comment thread Yafc/Widgets/ObjectTooltip.cs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants