#1659 closed enhancement (fixed)
[PATCH] Insufficient population capacity tooltip
Reported by: | zoot | Owned by: | zoot |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 13 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | Patch: |
Description
Description of the feature:
When you've added a training order to the production queue, and there aren't sufficient population capacity for the order to commence, hovering over the production icon in the queue will show the amount of capacity missing (so you can determine at a glance how many houses you need to build etc.)
(Feel free to come up with a better wording than "Insufficient population capacity".)
Also, the icon will blink orange instead of just being green.
See this thread for images and animation.
Attachments (2)
Change History (13)
by , 12 years ago
Attachment: | queuecapacitytweak2.diff added |
---|
by , 12 years ago
Attachment: | queuecapacitytweak3.diff added |
---|
comment:2 by , 12 years ago
Keywords: | patch review added |
---|---|
Summary: | Insufficient population capacity tooltip → [PATCH] Insufficient population capacity tooltip |
Nice to see you using trac :-). Just for future patches: Please take a look at SubmittingPatches.
comment:3 by , 12 years ago
Keywords: | review removed |
---|---|
Milestone: | Backlog → Alpha 12 |
There's one small issue with making it all run on simulation update: Single-player simulation turns are 200ms, so the indicators will be orange for either 400ms or 600ms. Shouldn't matter much in multiplayer since its turn rate is 500ms
In any case, the production queue blinking requires knowledge of the particular selected entity, and I think it'd be far uglier to cram that code into session.js's onTick than it is to deal with some minor visual inconsistencies.
comment:4 by , 11 years ago
Milestone: | Alpha 12 → Alpha 13 |
---|
Moving to next release because changes are required before this can be completed.
comment:5 by , 11 years ago
I've cleaned this up a bit:
https://github.com/zootzoot/0ad/compare/insufficient-pop-capacity-tooltip (diff)
The tooltip now mirrors the "insufficient resources" tooltip, with icon for the population count, as seen below. Also, I've dropped the 'blinking' feature which wasn't ready for prime-time. I'll add that in separate ticket if I get it to work.
comment:6 by , 11 years ago
Keywords: | review added |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:7 by , 11 years ago
Why don't you return 0 on success and the number of needed slots (positive) on failure? That way you can just have item.slots (maybe rename to neededSlots).
follow-up: 9 comment:8 by , 11 years ago
It wasn't introduced by this patch, but there's currently a weird redundant test for item.unitTemplate
on lines 548 and 552. Also the added slots
property should be documented in the comment block around line 40-49.
comment:9 by , 11 years ago
Replying to leper:
Why don't you return 0 on success and the number of needed slots (positive) on failure? That way you can just have item.slots (maybe rename to neededSlots).
Replying to historic_bruno:
It wasn't introduced by this patch, but there's currently a weird redundant test for
item.unitTemplate
on lines 548 and 552.
Also the added
slots
property should be documented in the comment block around line 40-49.
New diff: https://github.com/zootzoot/0ad/compare/insufficient-pop-capacity-tooltip.diff
Updated patch per Deiz's suggestions: