forked from mirrors/0ad
cdf6109713
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.
40 lines
876 B
JavaScript
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);
|
|
}
|