Ticket #3385: ticket3385unitstances_3.diff

File ticket3385unitstances_3.diff, 3.2 KB (added by bb, 9 years ago)

Patch looks good in my opinion, besides the violent tooltip: "Chase all opponents that any of your units see, but focus on attackers" This indicates that an idle unit will attack all visible enemy units. This is not the actual behaviour: the unit only attacks the enemy units in HIS vision range but chases them also outside the vision range (when they have been inside the vision range). So I would propose another tooltip like: "Attack nearby opponents and chase them to death" This is changed in the new patch. When I have some spare time I will take a look at the other buttons.

  • binaries/data/mods/public/gui/session/selection_panels.js

     
    10061006    {
    10071007        data.button.onPress = function() { performStance(data.unitEntState, data.item); };
    10081008    },
    10091009    "setTooltip": function(data)
    10101010    {
    1011         data.button.tooltip = getStanceDisplayName(data.item);
     1011        data.button.tooltip = '[font="sans-bold-16"]' + getStanceDisplayName(data.item) + "[/font]\n" + getStanceTooltip(data.item);
    10121012    },
    10131013    "setGraphics": function(data)
    10141014    {
    10151015        data.guiSelection.hidden = !data.stanceSelected;
    10161016        data.icon.sprite = "stretched:session/icons/stances/"+data.item+".png";
  • binaries/data/mods/public/gui/session/selection_panels_helpers.js

     
    3030// ==============================================
    3131// STANCE HELPERS
    3232
    3333function getStanceDisplayName(name)
    3434{
    35     var displayName;
    36     switch(name)
     35    switch (name)
    3736    {
    38         case "violent":
    39             displayName = translateWithContext("stance", "Violent");
    40             break;
    41         case "aggressive":
    42             displayName = translateWithContext("stance", "Aggressive");
    43             break;
    44         case "passive":
    45             displayName = translateWithContext("stance", "Passive");
    46             break;
    47         case "defensive":
    48             displayName = translateWithContext("stance", "Defensive");
    49             break;
    50         case "standground":
    51             displayName = translateWithContext("stance", "Standground");
    52             break;
    53         default:
    54             warn(sprintf("Internationalization: Unexpected stance found with code ‘%(stance)s’. This stance must be internationalized.", { stance: name }));
    55             displayName = name;
    56             break;
     37    case "violent":
     38        return translateWithContext("stance", "Violent");
     39    case "aggressive":
     40        return translateWithContext("stance", "Aggressive");
     41    case "defensive":
     42        return translateWithContext("stance", "Defensive");
     43    case "passive":
     44        return translateWithContext("stance", "Passive");
     45    case "standground":
     46        return translateWithContext("stance", "Standground");
     47    default:
     48        warn(sprintf("Internationalization: Unexpected stance found with code ‘%(stance)s’. This stance must be internationalized.", { "stance": name }));
     49        return name;
     50    }
     51}
     52
     53function getStanceTooltip(name)
     54{
     55    switch (name)
     56    {
     57    case "violent":
     58        return translateWithContext("stance", "Attack nearby opponents and chase them to death");
     59    case "aggressive":
     60        return translateWithContext("stance", "Attack nearby opponents");
     61    case "defensive":
     62        return translateWithContext("stance", "Attack nearby opponents and return to the original location");
     63    case "passive":
     64        return translateWithContext("stance", "Flee if attacked");
     65    case "standground":
     66        return translateWithContext("stance", "Attack opponents in range, but don't move to attack");
     67    default:
     68        return "";
    5769    }
    58     return displayName;
    5970}
    6071
    6172// ==============================================
    6273// TRAINING / CONSTRUCTION HELPERS
    6374/**