Skip to content

Commit

Permalink
Added remove link button to link summary screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorus committed Feb 7, 2025
1 parent f3603ca commit 871be9c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Yafc/Workspace/ProductionTable/ProductionLinkSummaryScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,22 @@ public override void Build(ImGui gui) {
_ = gui.BuildFactorioObjectButtonWithText(link.goods, tooltipOptions: DrawParentRecipes(link.owner, "link"));
}
scrollArea.Build(gui);
if (gui.BuildButton("Remove link", link.owner.links.Contains(link) ? SchemeColor.Primary : SchemeColor.Grey)) {
DestroyLink(link);
Close();
}
if (gui.BuildButton("Done")) {
Close();
}
}

private void DestroyLink(ProductionLink link) {
if (link.owner.links.Contains(link)) {
_ = link.owner.RecordUndo().links.Remove(link);
Rebuild();
}
}

protected override void ReturnPressed() => Close();

private void BuildFlow(ImGui gui, List<(RecipeRow row, float flow)> list, float total, bool isLinkOutput) {
Expand Down
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Version:
Date:
Features:
- Detect lightning rods/collectors as electricity sources, and estimate the required accumulator count.
- Added button to remove link from link summary screen.
Fixes:
- When creating launch recipes, obey the rocket capacity, not the item stack size.
----------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 871be9c

Please sign in to comment.