Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#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: Patch:

Description

Per this topic, I've updated the patch created by HowlingFlute to work with technologies and support shift-multiplier.

Attachments (4)

redIcons.patch (7.1 KB ) - added by wraitii 12 years ago.
redIcons.2.patch (10.8 KB ) - added by wraitii 12 years ago.
redIcons.3.patch (11.2 KB ) - added by wraitii 12 years ago.
redIcons.4.patch (12.1 KB ) - added by Deiz 12 years ago.

Download all attachments as: .zip

Change History (14)

by wraitii, 12 years ago

Attachment: redIcons.patch added

comment:1 by wraitii, 12 years ago

Owner: set to wraitii

comment:2 by Deiz, 12 years ago

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).

Last edited 12 years ago by Deiz (previous) (diff)

by wraitii, 12 years ago

Attachment: redIcons.2.patch added

comment:3 by wraitii, 12 years ago

Now handles bartering and gate upgrade cost.

by wraitii, 12 years ago

Attachment: redIcons.3.patch added

comment:4 by wraitii, 12 years ago

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:5 by wraitii, 12 years ago

Milestone: BacklogAlpha 11

by Deiz, 12 years ago

Attachment: redIcons.4.patch added

comment:6 by Deiz, 12 years ago

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 by historic_bruno, 12 years ago

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 by wraitii, 12 years ago

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:9 by wraitii, 12 years ago

Resolution: fixed
Status: newclosed

in reply to:  7 comment:10 by historic_bruno, 12 years ago

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.

Note: See TracTickets for help on using tickets.