Ticket #1571 (closed enhancement: fixed)
[PATCH] Redden construction/training/research icons when not enough resources
| Reported by: | wraitii | Owned by: | wraitii |
|---|---|---|---|
| Priority: | Nice to Have | Milestone: | Alpha 11 |
| Component: | UI & Simulation | Keywords: | patch |
| Cc: |
Description
Per this topic, I've updated the patch created by HowlingFlute? to work with technologies and support shift-multiplier.
Attachments
Change History
comment:2 Changed 10 months ago by Deiz
- Keywords patch added
There's also the market case (insufficient resources to barter), gate upgrade costs, etc., though these are much less common cases than what you've implemented support for.
Though this is completely outside the scope of this patch: I think it's rather unfortunate that overlays require a whole new set of objects. It'd be nice to be able to apply arbitrary blending by manipulating sprite effects in unit-commands.js similarly to how text properties are handled. Although first we'd need proper blending capability, as the 'add_color' sprite effect does exactly that (additive only).
comment:4 Changed 9 months ago by wraitii
Update to the patch. Moved it to Alpha 11 because I intend to commit it unless someone spots an obvious mistake/design flaw. (update after review by Deiz this morning).
comment:6 Changed 9 months ago by Deiz
Did some clean-up (migrated the common tooltip stuff into a function) and modified GetNeededResources somewhat so the caller doesn't need to know all the resource types.
comment:7 follow-up: ↓ 10 Changed 9 months ago by historic_bruno
Nice work :)
I noticed one problem: when selecting multiple long wall segments, it shows insufficient resource counts as if only one of them would be upgraded, but I believe the button will attempt to upgrade all selected long walls. Of course it only shows the cost for one upgrade too, so it may be a slightly more complicated fix.
And one suggestion: I would love to see the insufficient resource counts listed in red in the tooltip. That would make them really stand out. Another way of doing this: show the insufficient resources combined with the standard costs, but then we'd probably also want to show full costs for batch training. Maybe something like this would work for a combined display:
Costs: 50 Wood 100(-15) Food
where the player has at least 50 wood and only 85 food (needing 15 more to build/train this entity). Whatever looks best and is most intuitive :)
comment:8 Changed 9 months ago by wraitii
Committed the patch (rev 12404). I changed the "Insufficient Resources" text to be red.
The fix about gates is quite complicated and quite CPU extensive for the result, but it probably should be added at some point, as with the integrated costs (though I'm not too sure about the actual readability of that).
comment:10 in reply to: ↑ 7 Changed 9 months ago by historic_bruno
Replying to historic_bruno:
I noticed one problem: when selecting multiple long wall segments, it shows insufficient resource counts as if only one of them would be upgraded, but I believe the button will attempt to upgrade all selected long walls. Of course it only shows the cost for one upgrade too, so it may be a slightly more complicated fix.
After discussion this has been moved to a different ticket (#1591), as it's only tangentially related to this ticket.
