Ticket #4026: healertooltip.diff
File healertooltip.diff, 7.5 KB (added by , 8 years ago) |
---|
-
binaries/data/mods/public/globalscripts/Templates.js
function GetTemplateDataHelper(template, 222 222 ret.garrisonHolder = {}; 223 223 if (template.GarrisonHolder.Max) 224 224 ret.garrisonHolder.max = getEntityValue("GarrisonHolder/Max"); 225 225 } 226 226 227 if (template.Heal) 228 { 229 ret.heal = {}; 230 if (template.Heal.HP) 231 ret.heal.hp = getEntityValue("Heal/HP"); 232 if (template.Heal.Range) 233 ret.heal.range = getEntityValue("Heal/Range"); 234 if (template.Heal.Rate) 235 ret.heal.rate = getEntityValue("Heal/Rate"); 236 } 237 227 238 if (template.Obstruction) 228 239 { 229 240 ret.obstruction = { 230 241 "active": ("" + template.Obstruction.Active == "true"), 231 242 "blockMovement": ("" + template.Obstruction.BlockMovement == "true"), -
binaries/data/mods/public/gui/common/tooltips.js
function getSpeedTooltip(template) 458 458 }); 459 459 } 460 460 461 461 function getHealerTooltip(template) 462 462 { 463 if (!template.heal er)463 if (!template.heal) 464 464 return ""; 465 465 466 466 return [ 467 sprintf(translatePlural("%(label)s %(val)s %(unit)s", "%(label)s %(val)s %(unit)s", template.heal er.HP), {467 sprintf(translatePlural("%(label)s %(val)s %(unit)s", "%(label)s %(val)s %(unit)s", template.heal.hp), { 468 468 "label": headerFont(translate("Heal:")), 469 "val": template.heal er.HP,469 "val": template.heal.hp, 470 470 // Translation: Short for hit points (or health points) that are healed in one healing action 471 "unit": unitFont(translatePlural("HP", "HP", template.heal er.HP))471 "unit": unitFont(translatePlural("HP", "HP", template.heal.hp)) 472 472 }), 473 sprintf(translatePlural("%(label)s %(val)s %(unit)s", "%(label)s %(val)s %(unit)s", template.heal er.Range), {473 sprintf(translatePlural("%(label)s %(val)s %(unit)s", "%(label)s %(val)s %(unit)s", template.heal.range), { 474 474 "label": headerFont(translate("Range:")), 475 "val": template.heal er.Range,476 "unit": unitFont(translatePlural("meter", "meters", template.heal er.Range))475 "val": template.heal.range, 476 "unit": unitFont(translatePlural("meter", "meters", template.heal.range)) 477 477 }), 478 sprintf(translatePlural("%(label)s %(val)s %(unit)s", "%(label)s %(val)s %(unit)s", template.heal er.Rate/1000), {478 sprintf(translatePlural("%(label)s %(val)s %(unit)s", "%(label)s %(val)s %(unit)s", template.heal.rate/1000), { 479 479 "label": headerFont(translate("Rate:")), 480 "val": template.heal er.Rate/1000,481 "unit": unitFont(translatePlural("second", "seconds", template.heal er.Rate / 1000))480 "val": template.heal.rate/1000, 481 "unit": unitFont(translatePlural("second", "seconds", template.heal.rate / 1000)) 482 482 }) 483 483 ].join(translate(", ")); 484 484 } 485 485 486 486 function getAurasTooltip(template) -
binaries/data/mods/public/gui/session/selection_details.js
function displaySingle(entState) 285 285 Engine.GetGUIObjectByName("attackAndArmorStats").tooltip = [ 286 286 getAttackTooltip, 287 287 getArmorTooltip, 288 288 getRepairRateTooltip, 289 289 getBuildRateTooltip, 290 getHealerTooltip, 290 291 getGarrisonTooltip, 291 292 getProjectilesTooltip 292 293 ].map(func => func(entState)).filter(tip => tip).join("\n"); 293 294 294 295 let iconTooltips = []; -
binaries/data/mods/public/gui/session/selection_panels.js
g_SelectionPanels.Training = { 1005 1005 if (Engine.ConfigDB_GetValue("user", "showdetailedtooltips") === "true") 1006 1006 tooltips.push( 1007 1007 getHealthTooltip(template), 1008 1008 getAttackTooltip(template), 1009 1009 getArmorTooltip(template), 1010 getHealerTooltip(template), 1010 1011 getGarrisonTooltip(template), 1011 1012 getProjectilesTooltip(template), 1012 1013 getSpeedTooltip(template) 1013 1014 ); 1014 1015 -
binaries/data/mods/public/gui/structree/load.js
function loadUnit(templateName) 79 79 } 80 80 } 81 81 } 82 82 83 83 if (template.Heal) 84 unit.heal er= {85 " Range": +template.Heal.Range || 0,86 " HP": +template.Heal.HP || 0,87 " Rate": +template.Heal.Rate || 084 unit.heal = { 85 "range": +template.Heal.Range || 0, 86 "hp": +template.Heal.HP || 0, 87 "rate": +template.Heal.Rate || 0 88 88 }; 89 89 90 90 if (template.Builder && template.Builder.Entities._string) 91 91 for (let build of template.Builder.Entities._string.split(" ")) 92 92 { -
binaries/data/mods/public/simulation/components/GuiInterface.js
GuiInterface.prototype.GetExtendedEntity 543 543 ret.barterMarket = { "prices": cmpBarter.GetPrices() }; 544 544 } 545 545 546 546 let cmpHeal = Engine.QueryInterface(ent, IID_Heal); 547 547 if (cmpHeal) 548 ret.healer = { 548 ret.heal = { 549 "hp": cmpHeal.GetHP(), 550 "range": cmpHeal.GetRange().max, 551 "rate": cmpHeal.GetRate(), 549 552 "unhealableClasses": cmpHeal.GetUnhealableClasses(), 550 553 "healableClasses": cmpHeal.GetHealableClasses(), 551 554 }; 552 555 553 556 return ret; -
binaries/data/mods/public/simulation/components/Heal.js
Heal.prototype.GetTimers = function() 45 45 repeat = ApplyValueModificationsToEntity("Heal/Rate", repeat, this.entity); 46 46 47 47 return { "prepare": prepare, "repeat": repeat }; 48 48 }; 49 49 50 Heal.prototype.GetHP = function() 51 { 52 return ApplyValueModificationsToEntity("Heal/Range", +this.template.HP, this.entity); 53 }; 54 55 Heal.prototype.GetRate = function() 56 { 57 return ApplyValueModificationsToEntity("Heal/Rate", +this.template.Rate, this.entity); 58 }; 59 50 60 Heal.prototype.GetRange = function() 51 61 { 52 62 var min = 0; 53 63 var max = +this.template.Range; 54 64 -
binaries/data/mods/public/simulation/templates/units/maur_hero_chanakya.xml
29 29 <Classes datatype="tokens">Human Organic Support</Classes> 30 30 <VisibleClasses datatype="tokens">Hero Healer</VisibleClasses> 31 31 <GenericName>Acharya Chanakya</GenericName> 32 32 <SpecificName>Acharya Chāṇakya</SpecificName> 33 33 <Icon>units/maur_hero_chanakya.png</Icon> 34 <Tooltip>Hero Special: "Healer" - Heal units at an accelerated rate.35 Hero Special: "Philosopher" - Research 4 special technologies only available to Chanakya.</Tooltip>36 34 <RequiredTechnology>phase_city</RequiredTechnology> 37 35 </Identity> 38 36 <Minimap> 39 37 <Type>hero</Type> 40 38 </Minimap>