Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/gui/common/tooltips.js
var g_TooltipTextFormats = { | var g_TooltipTextFormats = { | ||||
"unit": ['[font="sans-10"][color="orange"]', '[/color][/font]'], | "unit": { "font": "sans-10", "color": "orange" }, | ||||
"header": ['[font="sans-bold-13"]', '[/font]'], | "header": { "font": "sans-bold-13" }, | ||||
"body": ['[font="sans-13"]', '[/font]'], | "body": { "font": "sans-13" }, | ||||
"comma": ['[font="sans-12"]', '[/font]'] | "comma": { "font": "sans-12" } | ||||
}; | }; | ||||
var g_AttackTypes = { | var g_AttackTypes = { | ||||
"Melee": translate("Melee Attack:"), | "Melee": translate("Melee Attack:"), | ||||
"Ranged": translate("Ranged Attack:"), | "Ranged": translate("Ranged Attack:"), | ||||
"Capture": translate("Capture Attack:") | "Capture": translate("Capture Attack:") | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | return sprintf(translate("%(previousAmounts)s and %(lastAmount)s"), { | ||||
// Translation: This comma is used for separating first to penultimate elements in an enumeration. | // Translation: This comma is used for separating first to penultimate elements in an enumeration. | ||||
"previousAmounts": amounts.join(translate(", ")), | "previousAmounts": amounts.join(translate(", ")), | ||||
"lastAmount": lastAmount | "lastAmount": lastAmount | ||||
}); | }); | ||||
} | } | ||||
function bodyFont(text) | function bodyFont(text) | ||||
{ | { | ||||
return g_TooltipTextFormats.body[0] + text + g_TooltipTextFormats.body[1]; | return setStringTags(text, g_TooltipTextFormats.body); | ||||
} | } | ||||
function headerFont(text) | function headerFont(text) | ||||
{ | { | ||||
return g_TooltipTextFormats.header[0] + text + g_TooltipTextFormats.header[1]; | return setStringTags(text, g_TooltipTextFormats.header); | ||||
} | } | ||||
function unitFont(text) | function unitFont(text) | ||||
{ | { | ||||
return g_TooltipTextFormats.unit[0] + text + g_TooltipTextFormats.unit[1]; | return setStringTags(text, g_TooltipTextFormats.unit); | ||||
} | } | ||||
function commaFont(text) | function commaFont(text) | ||||
{ | { | ||||
return g_TooltipTextFormats.comma[0] + text + g_TooltipTextFormats.comma[1]; | return setStringTags(text, g_TooltipTextFormats.comma); | ||||
} | } | ||||
function getSecondsString(seconds) | function getSecondsString(seconds) | ||||
{ | { | ||||
return sprintf(translatePlural("%(time)s %(second)s", "%(time)s %(second)s", seconds), { | return sprintf(translatePlural("%(time)s %(second)s", "%(time)s %(second)s", seconds), { | ||||
"time": seconds, | "time": seconds, | ||||
"second": unitFont(translatePlural("second", "seconds", seconds)) | "second": unitFont(translatePlural("second", "seconds", seconds)) | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 652 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator