Opened 12 years ago

Closed 7 years ago

#1646 closed enhancement (fixed)

[PATCH] Show unmet requirements in technology icon tooltips

Reported by: zoot Owned by:
Priority: Nice to Have Milestone: Alpha 22
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

Show unmet requirements in technology icon tooltips.

See this thread for discussion.

Attachments (1)

techtiphack3.diff (5.4 KB ) - added by zoot 12 years ago.

Download all attachments as: .zip

Change History (12)

by zoot, 12 years ago

Attachment: techtiphack3.diff added

comment:1 by historic_bruno, 12 years ago

Cc: patch review added
Component: Core engineUI & Simulation
Milestone: BacklogAlpha 12

comment:2 by fcxSanya, 12 years ago

Cc: patch review removed
Keywords: patch review added

comment:3 by historic_bruno, 11 years ago

Keywords: review removed

Some comments from looking at the patch:

  • At first I wasn't sold on the need for a custom tooltip formatting syntax, but looking at all the possibilities, it may be the best option.
  • We should probably go ahead and plan on handling multiple requirements per tech, which may need a recursive design of the tooltip string building function.
  • The required count appears red, as if it's an unmet requirement. It will remain red even when the count is satisfied, which is an inconsistency in the UI. The logic would only grow messier to solve that with conditional colors or visibility.
  • I think the logic in GetRequirementsVars() should be combined with getFormattedRequirementsTooltip()

I guess the question is: do we want to keep this as simple as possible and only handle the case of a single class requirement per tech (which could be easily special-cased), or do we want to make it super flexible and handle all possibilities? The former would certainly be a simpler, neater solution. I don't know if we plan any techs that require a more complicated solution.

comment:4 by Kieran P, 11 years ago

Milestone: Alpha 12Alpha 13
Priority: Should HaveNice to Have

Moved to the next release as further work is required.

in reply to:  3 comment:5 by zoot, 11 years ago

Sorry, I seem to have missed the last comments here.

Replying to historic_bruno:

  • We should probably go ahead and plan on handling multiple requirements per tech, which may need a recursive design of the tooltip string building function.

Would it not be better to do that when multiple requirements are implemented? Then we will know how the format will look.

  • The required count appears red, as if it's an unmet requirement. It will remain red even when the count is satisfied, which is an inconsistency in the UI. The logic would only grow messier to solve that with conditional colors or visibility.

This is not strictly true. When the count is satisfied, the check on unit_commands.js:673 will fail, and the string won't be shown in the tooltip.

  • I think the logic in GetRequirementsVars() should be combined with getFormattedRequirementsTooltip()

GetRequirementsVars() is really just a glorified getter, modelled on the structure of CheckTechnologyRequirements(). The idea being that all the logic for parsing technology requirements should be contained in the component to which it is native.

I can copy it over if you insist, but then the logic has to be maintained in two different files. Alternatively, I could try to find a way to combine GetRequirementsVars() and CheckTechnologyRequirements() (or at least have one call the other)?

Last edited 11 years ago by zoot (previous) (diff)

comment:6 by Kieran P, 11 years ago

Milestone: Alpha 13Alpha 14

comment:7 by Kieran P, 11 years ago

Milestone: Alpha 14Alpha 15

comment:8 by wraitii, 10 years ago

Milestone: Alpha 15Alpha 16

comment:9 by leper, 10 years ago

Milestone: Alpha 16Backlog

comment:10 by scythetwirler, 10 years ago

It'd be nice to indicate which structures actually count as village/town phase structures on their individual structure tooltips for newer players.

comment:11 by elexis, 7 years ago

Milestone: BacklogAlpha 22
Resolution: fixed
Status: newclosed

In r19120 by fatherbushido:

Merge different logics of technology requirements and fix the related bugs. Create a global script which derive the technology requirements objects in a form usable for structure tree, gui, simulation and AI. Reviewed by mimo (for AI) and fatherbushido. Fixes #3993, #1646, #4263, #4217. Refs #4108.

In r19121 by fatherbushido:

Add a simulation test to the previous commit of s0600204's patch. Refs #4263.

Note: See TracTickets for help on using tickets.