Changeset View
Changeset View
Standalone View
Standalone View
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"]', '[/color][/font]'], | ||||
"header": ['[font="sans-bold-13"]', '[/font]'], | "header": ['[font="sans-bold-13"]', '[/font]'], | ||||
"body": ['[font="sans-13"]', '[/font]'], | "body": ['[font="sans-13"]', '[/font]'], | ||||
"comma": ['[font="sans-12"]', '[/font]'] | "comma": ['[font="sans-12"]', '[/font]'] | ||||
}; | }; | ||||
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:"), | ||||
"Death": translate("Damage on Destroy:") | |||||
fatherbushido: Just nitpicking but it can be confusing (it's when the unit lose all its hp not when it's… | |||||
Done Inline ActionsThe death damage is inflicted even if the user kills the unit (by hitting "Delete"). Original description says: "When a unit is destroyed the destruction causes damage to nearby units." from https://trac.wildfiregames.com/ticket/1910 Mate-86: The death damage is inflicted even if the user kills the unit (by hitting "Delete"). Original… | |||||
fatherbushidoUnsubmitted Not Done Inline ActionsIt seems we have not to add that here (it will be use by CanAttack, a function related to UnitAI). fatherbushido: It seems we have not to add that here (it will be use by CanAttack, a function related to… | |||||
}; | }; | ||||
var g_DamageTypes = { | var g_DamageTypes = { | ||||
"hack": translate("Hack"), | "hack": translate("Hack"), | ||||
"pierce": translate("Pierce"), | "pierce": translate("Pierce"), | ||||
"crush": translate("Crush"), | "crush": translate("Crush"), | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 151 Lines • ▼ Show 20 Lines | |||||
function getAttackTooltip(template) | function getAttackTooltip(template) | ||||
{ | { | ||||
if (!template.attack) | if (!template.attack) | ||||
return ""; | return ""; | ||||
let tooltips = []; | let tooltips = []; | ||||
for (let type in template.attack) | for (let type in template.attack) | ||||
{ | { | ||||
if (type == "Death") | |||||
Done Inline Actionsnewline before { bb: newline before `{` | |||||
{ | |||||
attacks.push(sprintf(translate("%(label)s %(details)s Friendly Fire: %(enabled)s"), { | |||||
"label": headerFont(g_AttackTypes[type]), | |||||
"details": damageTypesToText(template.attack.Death), | |||||
"enabled": template.attack.Death.friendlyFire ? translate("Yes") : translate("No") | |||||
})); | |||||
continue; | |||||
} | |||||
if (type == "Slaughter") | if (type == "Slaughter") | ||||
continue; // Slaughter is used to kill animals, so do not show it. | continue; // Slaughter is used to kill animals, so do not show it. | ||||
let rate = sprintf(translate("%(label)s %(details)s"), { | let rate = sprintf(translate("%(label)s %(details)s"), { | ||||
"label": | "label": | ||||
headerFont( | headerFont( | ||||
template.buildingAI && type == "Ranged" ? | template.buildingAI && type == "Ranged" ? | ||||
translate("Interval:") : | translate("Interval:") : | ||||
▲ Show 20 Lines • Show All 536 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Just nitpicking but it can be confusing (it's when the unit lose all its hp not when it's destroyed by the user for example)