Skip to content

Commands: stop production queue should clear all items except current, double should clear current #2190

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

Closed
badosu opened this issue Nov 1, 2023 · 0 comments · Fixed by #4762 · May be fixed by #2194
Closed

Commands: stop production queue should clear all items except current, double should clear current #2190

badosu opened this issue Nov 1, 2023 · 0 comments · Fixed by #4762 · May be fixed by #2194

Comments

@badosu
Copy link
Contributor

badosu commented Nov 1, 2023

Basically what the title says, make it so the clear production button for factories removes all items in queue except current in production.

If current is only item in queue, remove it.

Motivation

It is the case that often players want to clear queue but keep progress on current unit being built. This makes it so while keeping it easy to support the remove all items case (just issue the command twice)

Proposed fix

Check if #commands > 1 and skip the first removal on the loop by starting the index from 2 instead. Here: https://github.com/badosu/Beyond-All-Reason/blob/badosu%2Frework-gridmenu/luarules/gadgets/cmd_factory_stop_production.lua#L78-L80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant