HomeWildfire Games

Tooltip overhaul.

Description

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.

Details

Committed
elexisJun 30 2016, 3:16 AM
Parents
rP18453: Remove gathering capacity from elephant archers as they are way too clumsy for…
Branches
Unknown
Tags
Unknown