Show more accurate time remaining in build and research queues #1014
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1004
In order to test this, one should enable "No Queue Order" and "No Research Queue Order", and set "Queue Merging" to "Never Merge". When adding two of the same item to the build queue, this change makes the time remaining on the second item more accurate. Also, when two queue items both consume the same resource (eg, University and Bank need Stone), then the item in the queue which would finish second has its time extended to account for the item finishing first using up that resource. This also works for the research queue.
There is an unhanded edge case here: the two queues are independent, so if an item in the research queue and the build queue both require the same resource (eg, Money) then neither item will take this into account, so at least one item will have a misleading time shown.