Ticket #4061: 4061.diff
File 4061.diff, 1.6 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/gui/common/tooltips.js
function attackRateDetails(entState, typ 57 57 "time": time, 58 58 "second": g_TooltipTextFormats.unit[0] + translatePlural("second", "seconds", time) + g_TooltipTextFormats.unit[1] 59 59 }); 60 60 61 61 // or multiple arrows shot by BuildingAI 62 if (!entState.buildingAI )62 if (!entState.buildingAI || type != "Ranged") 63 63 return timeString; 64 64 65 65 let arrows = entState.buildingAI.arrowCount; 66 66 let arrowString = sprintf(translatePlural("%(arrowcount)s %(arrow)s", "%(arrowcount)s %(arrow)s", arrows), { 67 67 "arrowcount": arrows, … … function getAttackTooltip(template) 160 160 { 161 161 let attacks = []; 162 162 if (!template.attack) 163 163 return ""; 164 164 165 let rateLabel = g_TooltipTextFormats.header[0] + (template.buildingAI ? translate("Interval:") : translate("Rate:")) + g_TooltipTextFormats.header[1];166 167 165 for (let type in template.attack) 168 166 { 169 167 if (type == "Slaughter") 170 168 continue; // Slaughter is not a real attack, so do not show it. 171 169 if (type == "Charge") 172 170 continue; // Charging isn't implemented yet and shouldn't be displayed. 173 171 172 let rateLabel = g_TooltipTextFormats.header[0] 173 if (template.buildingAI && type == "Ranged") 174 rateLabel += translate("Interval:") 175 else 176 rateLabel += translate("Rate:") 177 rateLabel += g_TooltipTextFormats.header[1]; 178 174 179 let rate = sprintf(translate("%(label)s %(details)s"), { 175 180 "label": rateLabel, 176 181 "details": attackRateDetails(template, type) 177 182 }); 178 183