Index: ps/trunk/binaries/data/mods/public/gui/common/tooltips.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/common/tooltips.js +++ ps/trunk/binaries/data/mods/public/gui/common/tooltips.js @@ -2,6 +2,7 @@ "unit": { "font": "sans-10", "color": "orange" }, "header": { "font": "sans-bold-13" }, "body": { "font": "sans-13" }, + "objection": { "font": "sans-bold-13", "color": "red" }, "comma": { "font": "sans-12" }, "namePrimaryBig": { "font": "sans-bold-16" }, "namePrimarySmall": { "font": "sans-bold-12" }, @@ -81,6 +82,11 @@ return setStringTags(text, g_TooltipTextFormats.body); } +function objectionFont(text) +{ + return setStringTags(text, g_TooltipTextFormats.objection); +} + function headerFont(text) { return setStringTags(text, g_TooltipTextFormats.header); @@ -963,10 +969,10 @@ // Simple requirements (one tech) can be translated on the fly. if ("Techs" in requirements && !requirements.Techs.includes(" ")) - return sprintf(translate("Requires %(technology)s"), { + return objectionFont(sprintf(translate("Requires %(technology)s"), { "technology": getEntityNames(GetTechnologyData(requirements.Techs, civ)) - }); - return translate(requirements.Tooltip); + })); + return objectionFont(translate(requirements.Tooltip)); } /** @@ -997,10 +1003,8 @@ "component": '[font="sans-12"]' + resourceIcon(resource) + '[/font]', "cost": Math.ceil(resources[resource]) })); - return coloredText( - '[font="sans-bold-13"]' + translate("Insufficient resources:") + '[/font]', - "red") + " " + - formatted.join(" "); + return objectionFont(translate("Insufficient resources:")) + + " " + formatted.join(" "); } function getSpeedTooltip(template) Index: ps/trunk/binaries/data/mods/public/gui/credits/texts/programming.json =================================================================== --- ps/trunk/binaries/data/mods/public/gui/credits/texts/programming.json +++ ps/trunk/binaries/data/mods/public/gui/credits/texts/programming.json @@ -72,6 +72,7 @@ { "name": "Daniel Trevitz" }, { "nick": "Dariost", "name": "Dario Ostuni" }, { "nick": "Dave", "name": "David Protasowski" }, + { "name": "David Abián" }, { "name": "David Marshall" }, { "nick": "dax", "name": "Dacian Fiordean" }, { "nick": "deebee", "name": "Deepak Anthony" }, Index: ps/trunk/binaries/data/mods/public/gui/session/selection_panels.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/session/selection_panels.js +++ ps/trunk/binaries/data/mods/public/gui/session/selection_panels.js @@ -282,7 +282,7 @@ translate("Right-click to set this as the default formation.")); if (!formationOk && formationInfo.tooltip) - tooltip += "\n" + coloredText(translate(formationInfo.tooltip), "red"); + tooltip += "\n" + objectionFont(translate(formationInfo.tooltip)); data.button.tooltip = tooltip; data.button.enabled = formationOk && controlsPlayer(data.player); @@ -558,7 +558,7 @@ tooltips.push(translate("The auto-queue will try to train this item later.")); if (queuedItem.neededSlots) { - tooltips.push(coloredText(translate("Insufficient population capacity:"), "red")); + tooltips.push(objectionFont(translate("Insufficient population capacity:"))); tooltips.push(sprintf(translate("%(population)s %(neededSlots)s"), { "population": resourceIcon("population"), "neededSlots": queuedItem.neededSlots @@ -791,7 +791,7 @@ "entityCounts": entityCounts.join(translateWithContext("Separator for a list of entity counts", ", ")) }); } - tooltips.push(tip); + tooltips.push(objectionFont(tip)); } tooltips.push(getNeededResourcesTooltip(neededResources)); button.tooltip = tooltips.filter(tip => tip).join("\n"); @@ -840,7 +840,7 @@ { button.enabled = false; modifier += "color:0 0 0 127:grayscale:"; - button.tooltip += "\n" + coloredText(translate("Cannot research while upgrading."), "red"); + button.tooltip += "\n" + objectionFont(translate("Cannot research while upgrading.")); } @@ -1070,7 +1070,7 @@ { data.button.enabled = false; modifier = "color:0 0 0 127:grayscale:"; - data.button.tooltip += "\n" + coloredText(translate("Cannot train while upgrading."), "red"); + data.button.tooltip += "\n" + objectionFont(translate("Cannot train while upgrading.")); } if (template.icon) @@ -1208,10 +1208,10 @@ } else { - tooltip = coloredText(translatePlural( + tooltip = objectionFont(translatePlural( "Cannot upgrade when the entity is training, researching or already upgrading.", "Cannot upgrade when all entities are training, researching or already upgrading.", - data.unitEntStates.length), "red"); + data.unitEntStates.length)); data.button.onPress = function() {}; Index: ps/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js +++ ps/trunk/binaries/data/mods/public/gui/session/selection_panels_helpers.js @@ -98,7 +98,7 @@ }); if (trainEntCount >= trainEntLimit) - text = coloredText(text, "red"); + text = objectionFont(text); for (var c in trainEntLimitChangers) { @@ -176,7 +176,7 @@ }); } - return passedLimit ? coloredText(text, "red") : text; + return passedLimit ? objectionFont(text) : text; } /**