Ticket #4026: healertooltip.2.diff

File healertooltip.2.diff, 7.6 KB (added by fatherbushido, 8 years ago)

remove now useless code in st

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

    function GetTemplateDataHelper(template,  
    222222        ret.garrisonHolder = {};
    223223        if (template.GarrisonHolder.Max)
    224224            ret.garrisonHolder.max = getEntityValue("GarrisonHolder/Max");
    225225    }
    226226
     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
    227238    if (template.Obstruction)
    228239    {
    229240        ret.obstruction = {
    230241            "active": ("" + template.Obstruction.Active == "true"),
    231242            "blockMovement": ("" + template.Obstruction.BlockMovement == "true"),
  • binaries/data/mods/public/gui/common/tooltips.js

    function getSpeedTooltip(template)  
    458458    });
    459459}
    460460
    461461function getHealerTooltip(template)
    462462{
    463     if (!template.healer)
     463    if (!template.heal)
    464464        return "";
    465465
    466466    return [
    467         sprintf(translatePlural("%(label)s %(val)s %(unit)s", "%(label)s %(val)s %(unit)s", template.healer.HP), {
     467        sprintf(translatePlural("%(label)s %(val)s %(unit)s", "%(label)s %(val)s %(unit)s", template.heal.hp), {
    468468            "label": headerFont(translate("Heal:")),
    469             "val": template.healer.HP,
     469            "val": template.heal.hp,
    470470            // Translation: Short for hit points (or health points) that are healed in one healing action
    471             "unit": unitFont(translatePlural("HP", "HP", template.healer.HP))
     471            "unit": unitFont(translatePlural("HP", "HP", template.heal.hp))
    472472        }),
    473         sprintf(translatePlural("%(label)s %(val)s %(unit)s", "%(label)s %(val)s %(unit)s", template.healer.Range), {
     473        sprintf(translatePlural("%(label)s %(val)s %(unit)s", "%(label)s %(val)s %(unit)s", template.heal.range), {
    474474            "label": headerFont(translate("Range:")),
    475             "val": template.healer.Range,
    476             "unit": unitFont(translatePlural("meter", "meters", template.healer.Range))
     475            "val": template.heal.range,
     476            "unit": unitFont(translatePlural("meter", "meters", template.heal.range))
    477477        }),
    478         sprintf(translatePlural("%(label)s %(val)s %(unit)s", "%(label)s %(val)s %(unit)s", template.healer.Rate/1000), {
     478        sprintf(translatePlural("%(label)s %(val)s %(unit)s", "%(label)s %(val)s %(unit)s", template.heal.rate/1000), {
    479479            "label": headerFont(translate("Rate:")),
    480             "val": template.healer.Rate/1000,
    481             "unit": unitFont(translatePlural("second", "seconds", template.healer.Rate / 1000))
     480            "val": template.heal.rate/1000,
     481            "unit": unitFont(translatePlural("second", "seconds", template.heal.rate / 1000))
    482482        })
    483483    ].join(translate(", "));
    484484}
    485485
    486486function getAurasTooltip(template)
  • binaries/data/mods/public/gui/session/selection_details.js

    function displaySingle(entState)  
    285285    Engine.GetGUIObjectByName("attackAndArmorStats").tooltip = [
    286286        getAttackTooltip,
    287287        getArmorTooltip,
    288288        getRepairRateTooltip,
    289289        getBuildRateTooltip,
     290        getHealerTooltip,
    290291        getGarrisonTooltip,
    291292        getProjectilesTooltip
    292293    ].map(func => func(entState)).filter(tip => tip).join("\n");
    293294
    294295    let iconTooltips = [];
  • binaries/data/mods/public/gui/session/selection_panels.js

    g_SelectionPanels.Training = {  
    10051005        if (Engine.ConfigDB_GetValue("user", "showdetailedtooltips") === "true")
    10061006            tooltips.push(
    10071007                getHealthTooltip(template),
    10081008                getAttackTooltip(template),
    10091009                getArmorTooltip(template),
     1010                getHealerTooltip(template),
    10101011                getGarrisonTooltip(template),
    10111012                getProjectilesTooltip(template),
    10121013                getSpeedTooltip(template)
    10131014            );
    10141015
  • binaries/data/mods/public/gui/structree/load.js

    function loadUnit(templateName)  
    7777                if (g_Lists.techs.indexOf(research) < 0)
    7878                    g_Lists.techs.push(research);
    7979            }
    8080        }
    8181    }
    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 || 0
    88         };
    89 
    9082    if (template.Builder && template.Builder.Entities._string)
    9183        for (let build of template.Builder.Entities._string.split(" "))
    9284        {
    9385            build = build.replace("{civ}", g_SelectedCiv);
    9486            if (g_Lists.structures.indexOf(build) < 0)
  • binaries/data/mods/public/simulation/components/GuiInterface.js

    GuiInterface.prototype.GetExtendedEntity  
    543543        ret.barterMarket = { "prices": cmpBarter.GetPrices() };
    544544    }
    545545
    546546    let cmpHeal = Engine.QueryInterface(ent, IID_Heal);
    547547    if (cmpHeal)
    548         ret.healer = {
     548        ret.heal = {
     549            "hp": cmpHeal.GetHP(),
     550            "range": cmpHeal.GetRange().max,
     551            "rate": cmpHeal.GetRate(),
    549552            "unhealableClasses": cmpHeal.GetUnhealableClasses(),
    550553            "healableClasses": cmpHeal.GetHealableClasses(),
    551554        };
    552555
    553556    return ret;
  • binaries/data/mods/public/simulation/components/Heal.js

    Heal.prototype.GetTimers = function()  
    4545    repeat = ApplyValueModificationsToEntity("Heal/Rate", repeat, this.entity);
    4646   
    4747    return { "prepare": prepare, "repeat": repeat };
    4848};
    4949
     50Heal.prototype.GetHP = function()
     51{
     52    return ApplyValueModificationsToEntity("Heal/Range", +this.template.HP, this.entity);
     53};
     54
     55Heal.prototype.GetRate = function()
     56{
     57    return ApplyValueModificationsToEntity("Heal/Rate", +this.template.Rate, this.entity);
     58};
     59
    5060Heal.prototype.GetRange = function()
    5161{
    5262    var min = 0;
    5363    var max = +this.template.Range;
    5464   
  • binaries/data/mods/public/simulation/templates/units/maur_hero_chanakya.xml

     
    2929    <Classes datatype="tokens">Human Organic Support</Classes>
    3030    <VisibleClasses datatype="tokens">Hero Healer</VisibleClasses>
    3131    <GenericName>Acharya Chanakya</GenericName>
    3232    <SpecificName>Acharya Chāṇakya</SpecificName>
    3333    <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>
    3634    <RequiredTechnology>phase_city</RequiredTechnology>
    3735  </Identity>
    3836  <Minimap>
    3937    <Type>hero</Type>
    4038  </Minimap>