Ticket #1571 (closed enhancement: fixed)

Opened 10 months ago

Last modified 9 months ago

[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

redIcons.patch (7.1 KB) - added by wraitii 10 months ago.
redIcons.2.patch (10.8 KB) - added by wraitii 10 months ago.
redIcons.3.patch (11.2 KB) - added by wraitii 9 months ago.
redIcons.4.patch (12.1 KB) - added by Deiz 9 months ago.

Change History

Changed 10 months ago by wraitii

comment:1 Changed 10 months ago by wraitii

  • Owner set to wraitii

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

Last edited 10 months ago by Deiz (previous) (diff)

Changed 10 months ago by wraitii

comment:3 Changed 10 months ago by wraitii

Now handles bartering and gate upgrade cost.

Changed 9 months ago by wraitii

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:5 Changed 9 months ago by wraitii

  • Milestone changed from Backlog to Alpha 11

Changed 9 months ago by Deiz

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:9 Changed 9 months ago by wraitii

  • Status changed from new to closed
  • Resolution set to fixed

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.

Note: See TracTickets for help on using tickets.