-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete unused recipe rows in the production table #172
base: master
Are you sure you want to change the base?
Conversation
Obey version
Recalculate the recipes after changing reactor layout or mining productivity.
…solver from getting confused.
@@ -228,6 +229,40 @@ private void CalculateFlow(RecipeRow include) | |||
flow = flowArr; | |||
} | |||
|
|||
public void RemoveUnusedRecipes(bool unpackToo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried spamming calls to RecordUndo
in this method, but that sent the undo system into a stack overflow loop, both with and without unpacking.
Here's a demonstration of me mis-handling the undo system. Load DeleteUnusedTest.yafc.zip with this mod list, and use either of the two new buttons. Then try to undo the changes. After undo, the page will unexpectedly consume five of the six "Purified *" items, among other things. It will also unexpectedly produce gold ore, titanium sheet coil, uranium ore, nickel carbonyl, and tungsten ore. If the modlist doesn't work, you should also be able to sync with this save: DeleteUnusedTest.zip |
…ws using recipesPerSecond instead.
This is a follow-up to #168. After adding all the recipes in existence, I want to delete the ones the solver decided not to use. It can be merged without #168, if desired.
This adds two buttons to the dropdown on the Recipe column:
The first button deletes all recipe rows that have zero assigned buildings, recursively through all nested tables.
The second button also unpacks any nested tables that only have a header recipe.
Given this nested table,
the first button converts it to this
and the second button converts it to this
Omit 1c0d336 to omit the second button. I can create a new PR if that's desired.
Required additional work
Potential future concerns
builtBuildings
, but that the solver didn't use. I'm guessing those rows should be preserved, and can update this PR to do that once one or both of those are merged.