1
0
forked from mirrors/0ad
Files
0ad/binaries/data/mods/public/gui/reference/common/draw.js
T
s0600204 cdf6109713 Relocate and Rearrange the structree codebase
Makes it possible to reuse the more generic parts of the `structree`
codebase in other pages without including `structree`-specific logic.
This sets the stage for further reference/encyclopedia-type pages.

Reviewed By: fatherbushido, elexis
Differential Revision: https://code.wildfiregames.com/D295
This was SVN commit r19940.
2017-07-31 12:49:00 +00:00

40 lines
876 B
JavaScript

/**
* GUI limits. Populated if needed by a predraw() function.
*/
var g_DrawLimits = {};
/**
* These functions are defined in gui/common/tooltips.js
*/
var g_TooltipFunctions = [
getEntityNamesFormatted,
getEntityCostTooltip,
getEntityTooltip,
getAurasTooltip,
getHealthTooltip,
getHealerTooltip,
getAttackTooltip,
getSplashDamageTooltip,
getArmorTooltip,
getGarrisonTooltip,
getProjectilesTooltip,
getSpeedTooltip,
getGatherTooltip,
getPopulationBonusTooltip,
getResourceTrickleTooltip,
getLootTooltip
];
/**
* Concatanates the return values of the array of passed functions.
*
* @param {object} template
* @param {array} textFunctions
* @param {string} joiner
* @return {string} The built text.
*/
function buildText(template, textFunctions=[], joiner="\n")
{
return textFunctions.map(func => func(template)).filter(tip => tip).join(joiner);
}