Skip to content

Commit

Permalink
fix: Show consumption as negative
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorus committed Feb 19, 2025
1 parent 6ed34c1 commit 9c981fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Yafc/Workspace/ProductionTable/ProductionLinkSummaryScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private void ShowRelatedLinks(ImGui gui) {
table.Add((r, localFlow));
}
else if (localFlow < 0) {
table.Add((r, -localFlow));
table.Add((r, localFlow));
}
else {
table.Add((r, 0));
Expand All @@ -87,7 +87,7 @@ private void ShowRelatedLinks(ImGui gui) {
gui.BuildText("Related links: ");
var color = 1;
foreach (var relTable in related.Values) {
BuildFlow(gui, relTable, relTable.Sum(e => e.flow), false, color++);
BuildFlow(gui, relTable, relTable.Sum(e => Math.Abs(e.flow)), false, color++);
}
}
if (unlinked.Any()) {
Expand Down Expand Up @@ -172,7 +172,7 @@ void drawLinks(ImGui gui) {

if (gui.isBuilding) {
var lastRect = gui.lastRect;
lastRect.Width *= (flow / total);
lastRect.Width *= Math.Abs(flow / total);
gui.DrawRectangle(lastRect, GetColor(c));
}
}
Expand Down

0 comments on commit 9c981fa

Please sign in to comment.