Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#4061 closed defect (fixed)

[PATCH] Interval weird infos for capture attack in AttackTooltip

Reported by: fatherbushido Owned by: elexis
Priority: Should Have Milestone: Alpha 21
Component: UI & Simulation Keywords: patch
Cc: bb Patch:

Description (last modified by fatherbushido)

In the attack tooltip, the capture attack have a weird interval useless info for siege tower or ships (units with buildingAI arrows).

http://trac.wildfiregames.com/raw-attachment/ticket/4061/tooltip.jpg

The place to look are getAttackTooltip and attackRateDetails function in tooltips.js

Attachments (3)

tooltip.jpg (26.0 KB ) - added by fatherbushido 8 years ago.
4061.diff (1.6 KB ) - added by fatherbushido 8 years ago.
4061.2.diff (1.6 KB ) - added by fatherbushido 8 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 by fatherbushido, 8 years ago

Description: modified (diff)

by fatherbushido, 8 years ago

Attachment: tooltip.jpg added

comment:2 by fatherbushido, 8 years ago

Description: modified (diff)

comment:3 by fatherbushido, 8 years ago

Description: modified (diff)

comment:4 by fatherbushido, 8 years ago

Description: modified (diff)

comment:5 by fatherbushido, 8 years ago

comment:6 by elexis, 8 years ago

Cc: bb added

See also #4000 and #252 (secondary attacks, which capturing could be one thereof).

by fatherbushido, 8 years ago

Attachment: 4061.diff added

comment:7 by fatherbushido, 8 years ago

Milestone: BacklogAlpha 21
Summary: Interval weird infos for capture attack in AttackTooltip[PATCH] Interval weird infos for capture attack in AttackTooltip

by fatherbushido, 8 years ago

Attachment: 4061.2.diff added

comment:8 by fatherbushido, 8 years ago

Keywords: patch review added

comment:9 by fatherbushido, 8 years ago

Keywords: review removed

i removed the review tag because i included that in #3904

comment:10 by elexis, 8 years ago

Owner: set to elexis
Resolution: fixed
Status: newclosed

In 18454:

Tooltip overhaul.

Also contains a patch by fatherbushido for attackRateDetails and getAttackTooltip to
not show something broken for buildingAI units that can capture, fixes #4061 (see #4000).

Make tooltip functions uniform.

Pass template everywhere

instead of template.armour in getArmorTooltip
rate in getRepairRateTooltip and getBuildRateTooltip and
entState in attackRateDetails.

Add an early return for every tooltip function.

Use empty string instead of "Armor: (None)" for trees etc..

Don't prefix tooltip return values with "\n", but let the user of that function add them.
Thus make tooltip concatenation much nicer (f.e. draw.js).

Use a loop instead of duplicating per damage type in damageTypesToText.
Add font functions to avoid duplicating tag code.
Merge sprintf's and inline variables.
Add few TODOs.

Fix some strings:

Use "%(specificName)s %(fontStart)s(%(genericName)s)%(fontEnd)s") instead of "(" + foo + ")" ...
Use existing "%(percentage)s%%" instead of foo + "%" in armorLevelToPercentageString.

Remove

duplication by calling/introducing shared functions (getEntityTooltip, getHealthTooltip, getGatherTooltip, getVisibleEntityClassesFormatted),
unused function damageTypeDetails which was also a duplicate of damageTypesToText,
unused function damageValues,
some warns that are equivalent to errors they attempt to cover up (getAttackTypeLabel, getCostComponentDisplayIcon, getEntityNames, getEntityNamesFormatted),
some unused variables,
"???" and translate("???").

Don't fix translate("Foo:") strings to avoid a lot of translation work.

comment:11 by elexis, 8 years ago

Keywords: simple removed

Thanks

Note: See TracTickets for help on using tickets.