Ticket #4505: patch

File patch, 4.0 KB (added by elexis, 7 years ago)

Translates them and shows them in the tech tree

  • binaries/data/mods/public/globalscripts/Templates.js

    function GetTemplateDataHelper(template,  
    300300        };
    301301        ret.icon = template.Identity.Icon;
    302302        ret.tooltip =  template.Identity.Tooltip;
    303303        ret.requiredTechnology = template.Identity.RequiredTechnology;
    304304        ret.visibleIdentityClasses = GetVisibleIdentityClasses(template.Identity);
     305
     306        if (template.Identity.History)
     307            ret.history = template.Identity.History;
    305308    }
    306309
    307310    if (template.UnitMotion)
    308311    {
    309312        ret.speed = {
  • binaries/data/mods/public/gui/common/tooltips.js

     
    11var g_TooltipTextFormats = {
    22    "unit": ['[font="sans-10"][color="orange"]', '[/color][/font]'],
    33    "header": ['[font="sans-bold-13"]', '[/font]'],
    44    "body": ['[font="sans-13"]', '[/font]'],
    5     "comma": ['[font="sans-12"]', '[/font]']
     5    "comma": ['[font="sans-12"]', '[/font]'],
     6    "history": ['[font="sans-14"]', '[/font]']
    67};
    78
    89var g_AttackTypes = {
    910    "Melee": translate("Melee Attack:"),
    1011    "Ranged": translate("Ranged Attack:"),
    function getEntityTooltip(template)  
    5354        return "";
    5455
    5556    return bodyFont(template.tooltip);
    5657}
    5758
     59function getEntityHistoryTooltip(template)
     60{
     61    if (!template.history)
     62        return "";
     63
     64    return g_TooltipTextFormats.history[0] + template.history + g_TooltipTextFormats.history[1];
     65}
     66
    5867function getHealthTooltip(template)
    5968{
    6069    if (!template.health)
    6170        return "";
    6271
  • binaries/data/mods/public/gui/structree/draw.js

    var g_TooltipFunctions = [  
    1313    getGarrisonTooltip,
    1414    getProjectilesTooltip,
    1515    getSpeedTooltip,
    1616    getGatherTooltip,
    1717    getPopulationBonusTooltip,
    18     getLootTooltip
     18    getLootTooltip,
     19    getEntityHistoryTooltip
    1920];
    2021
    2122/**
    2223 * Draw the structree
    2324 *
  • binaries/data/mods/public/l10n/messages.json

     
    376376                        "SpecificName": {},
    377377                        "VisibleClasses": {
    378378                            "splitOnWhitespace": true
    379379                        },
    380380                        "Tooltip": {},
     381                        "History": {},
    381382                        "DisabledTooltip": {},
    382383                        "FormationName": {},
    383384                        "FromClass": {},
    384385                        "Rank": {
    385386                            "tagAsContext": true
     
    407408                        "SpecificName": {},
    408409                        "VisibleClasses": {
    409410                            "splitOnWhitespace": true
    410411                        },
    411412                        "Tooltip": {},
     413                        "History": {},
    412414                        "DisabledTooltip": {},
    413415                        "FormationName": {},
    414416                        "FromClass": {},
    415417                        "Rank": {
    416418                            "tagAsContext": true
     
    445447                        "SpecificName": {},
    446448                        "VisibleClasses": {
    447449                            "splitOnWhitespace": true
    448450                        },
    449451                        "Tooltip": {},
     452                        "History": {},
    450453                        "DisabledTooltip": {},
    451454                        "FormationName": {},
    452455                        "FromClass": {},
    453456                        "Rank": {
    454457                            "tagAsContext": true