Ticket #4026: healertooltip.5.diff
File healertooltip.5.diff, 8.8 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 let hp = template.heal.hp.toFixed(1); 467 let range = template.heal.range.toFixed(1); 468 let rate = (template.heal.rate / 1000).toFixed(1); 469 466 470 return [ 467 sprintf(translatePlural("%(label)s %(val)s %(unit)s", "%(label)s %(val)s %(unit)s", template.healer.HP), {471 sprintf(translatePlural("%(label)s %(val)s %(unit)s", "%(label)s %(val)s %(unit)s", hp), { 468 472 "label": headerFont(translate("Heal:")), 469 "val": template.healer.HP,473 "val": hp, 470 474 // Translation: Short for hit points (or health points) that are healed in one healing action 471 "unit": unitFont(translatePlural("HP", "HP", template.healer.HP))475 "unit": unitFont(translatePlural("HP", "HP", hp)) 472 476 }), 473 sprintf(translatePlural("%(label)s %(val)s %(unit)s", "%(label)s %(val)s %(unit)s", template.healer.Range), {477 sprintf(translatePlural("%(label)s %(val)s %(unit)s", "%(label)s %(val)s %(unit)s", range), { 474 478 "label": headerFont(translate("Range:")), 475 "val": template.healer.Range,476 "unit": unitFont(translatePlural("meter", "meters", template.healer.Range))479 "val": range, 480 "unit": unitFont(translatePlural("meter", "meters", range)) 477 481 }), 478 sprintf(translatePlural("%(label)s %(val)s %(unit)s", "%(label)s %(val)s %(unit)s", template.healer.Rate/1000), {482 sprintf(translatePlural("%(label)s %(val)s %(unit)s", "%(label)s %(val)s %(unit)s", rate), { 479 483 "label": headerFont(translate("Rate:")), 480 "val": template.healer.Rate/1000,481 "unit": unitFont(translatePlural("second", "seconds", template.healer.Rate / 1000))484 "val": rate, 485 "unit": unitFont(translatePlural("second", "seconds", rate)) 482 486 }) 483 487 ].join(translate(", ")); 484 488 } 485 489 486 490 function getAurasTooltip(template) -
binaries/data/mods/public/gui/session/selection_details.js
function displaySingle(entState) 282 282 // TODO: we should require all entities to have icons 283 283 Engine.GetGUIObjectByName("icon").sprite = template.icon ? ("stretched:session/portraits/" + template.icon) : "bkFillBlack"; 284 284 285 285 Engine.GetGUIObjectByName("attackAndArmorStats").tooltip = [ 286 286 getAttackTooltip, 287 getHealerTooltip, 287 288 getArmorTooltip, 288 289 getRepairRateTooltip, 289 290 getBuildRateTooltip, 290 291 getGarrisonTooltip, 291 292 getProjectilesTooltip -
binaries/data/mods/public/gui/session/selection_panels.js
g_SelectionPanels.Training = { 1004 1004 1005 1005 if (Engine.ConfigDB_GetValue("user", "showdetailedtooltips") === "true") 1006 1006 tooltips.push( 1007 1007 getHealthTooltip(template), 1008 1008 getAttackTooltip(template), 1009 getHealerTooltip(template), 1009 1010 getArmorTooltip(template), 1010 1011 getGarrisonTooltip(template), 1011 1012 getProjectilesTooltip(template), 1012 1013 getSpeedTooltip(template) 1013 1014 ); -
binaries/data/mods/public/gui/session/unit_actions.js
var unitActions = 226 226 227 227 return true; 228 228 }, 229 229 "getActionInfo": function(entState, targetState) 230 230 { 231 if (!entState.heal er||231 if (!entState.heal || 232 232 !hasClass(targetState, "Unit") || !targetState.needsHeal || 233 233 !playerCheck(entState, targetState, ["Player", "Ally"]) || 234 234 entState.id == targetState.id) // Healers can't heal themselves. 235 235 return false; 236 236 237 let unhealableClasses = entState.heal er.unhealableClasses;237 let unhealableClasses = entState.heal.unhealableClasses; 238 238 if (MatchesClassList(targetState.identity.classes, unhealableClasses)) 239 239 return false; 240 240 241 let healableClasses = entState.heal er.healableClasses;241 let healableClasses = entState.heal.healableClasses; 242 242 if (!MatchesClassList(targetState.identity.classes, healableClasses)) 243 243 return false; 244 244 245 245 return { "possible": true }; 246 246 }, -
binaries/data/mods/public/gui/structree/load.js
function loadUnit(templateName) 78 78 g_Lists.techs.push(research); 79 79 } 80 80 } 81 81 } 82 82 83 if (template.Heal)84 unit.healer = {85 "Range": +template.Heal.Range || 0,86 "HP": +template.Heal.HP || 0,87 "Rate": +template.Heal.Rate || 088 };89 90 83 if (template.Builder && template.Builder.Entities._string) 91 84 for (let build of template.Builder.Entities._string.split(" ")) 92 85 { 93 86 build = build.replace("{civ}", g_SelectedCiv); 94 87 if (g_Lists.structures.indexOf(build) < 0) -
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>