Ticket #4008: missingunitactionhotkeys_v2.1.patch

File missingunitactionhotkeys_v2.1.patch, 5.2 KB (added by Imarok, 3 years ago)

Uses "J" for repairing

  • binaries/data/config/default.cfg

     
    181181[hotkey.camera]
    182182reset = "R"                                   ; Reset camera rotation to default.
    183183follow = "F"                                  ; Follow the first unit in the selection
     184rallypointfocus = "Y"                         ; Focus the camera on the rally point of the selected building
    184185zoom.in = Plus, Equals, NumPlus               ; Zoom camera in (continuous control)
    185186zoom.out = Minus, NumMinus                    ; Zoom camera out (continuous control)
    186187zoom.wheel.in = WheelUp                       ; Zoom camera in (stepped control)
     
    284285garrison = Ctrl              ; Modifier to garrison when clicking on building
    285286autorallypoint = Ctrl        ; Modifier to set the rally point on the building itself
    286287guard = "G"                  ; Modifier to escort/guard when clicking on unit/building
     288repair = "J"                 ; Modifier to repair when clicking on building/mechanical unit
     289unload = "U"                 ; Modifier to unload when building/mechanical unit is selected
    287290queue = Shift                ; Modifier to queue unit orders instead of replacing
    288291batchtrain = Shift           ; Modifier to train units in batches
    289292massbarter = Shift           ; Modifier to barter bunch of resources
  • binaries/data/mods/public/gui/session/hotkeys/camera.xml

     
    55        <action on="Press">setCameraFollow(g_Selection.getFirstSelected());</action>
    66    </object>
    77
     8    <!-- Focus camera on building rally point -->
     9    <object hotkey="camera.rallypointfocus">
     10        <action on="Press">performCommand(g_Selection.getFirstSelected(), "focus-rally");</action>
     11    </object>
     12
    813    <!-- Camera jumping - press a hotkey to mark a position and another hotkey to jump back there -->
    914    <object hotkey="camera.jump.1">
    1015        <action on="Press">jumpCamera(1);</action>
  • binaries/data/mods/public/gui/session/hotkeys/misc.xml

     
    4848        <action on="Press">performCommand(g_Selection.getFirstSelected(), "delete");</action>
    4949    </object>
    5050
     51    <!-- Unload units from building/mechanical unit -->
     52    <object hotkey="session.unload">
     53        <action on="Press">unloadAll();</action>
     54    </object>
     55
    5156    <object hotkey="session.stop">
    5257        <action on="Press">stopUnits(g_Selection.toList());</action>
    5358    </object>
  • binaries/data/mods/public/gui/session/unit_actions.js

     
    344344                "target": null
    345345            };
    346346        },
     347        "hotkeyActionCheck": function(target)
     348        {
     349            if (!Engine.HotkeyIsPressed("session.repair") ||
     350                !getActionInfo("repair", target).possible)
     351                return false;
     352
     353            return {
     354                "type": "build",
     355                "cursor": "action-repair",
     356                "target": target
     357            };
     358        },
    347359        "actionCheck": function(target)
    348360        {
    349361            if (!getActionInfo("repair", target).possible)
     
    782794                data.targetClasses = targetClasses;
    783795                cursor = "action-attack-move";
    784796            }
     797            else if (Engine.HotkeyIsPressed("session.repair") && targetState.needsRepair &&
     798                playerCheck(entState, targetState, ["Ally"]))
     799            {
     800                data.command = "repair";
     801                data.target = targetState.id;
     802                cursor = "action-repair";
     803            }
    785804
    786             if (targetState.garrisonHolder &&
     805            if (targetState.garrisonHolder && !Engine.HotkeyIsPressed("session.repair") &&
    787806                playerCheck(entState, targetState, ["Player", "MutualAlly"]))
    788807            {
    789808                data.command = "garrison";
     
    973992            }
    974993
    975994            return {
    976                 "tooltip": translate("Unload All"),
     995                "tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.unload") +
     996                           translate("Unload All."),
    977997                "icon": "garrison-out.png",
    978998                "count": count,
    979999            };
     
    11031123                return false;
    11041124
    11051125            return {
    1106                 "tooltip": translate("Repair"),
     1126                "tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.repair") +
     1127                           translate("Order the selected units to repair a building or mechanical unit."),
    11071128                "icon": "repair.png"
    11081129            };
    11091130        },
     
    11211142                return false;
    11221143
    11231144            return {
    1124                 "tooltip": translate("Focus on Rally Point"),
     1145                "tooltip": colorizeHotkey("%(hotkey)s" + " ", "camera.rallypointfocus") +
     1146                           translate("Focus on Rally Point."),
    11251147                "icon": "focus-rally.png"
    11261148            };
    11271149        },
     
    12671289            }
    12681290
    12691291            return {
    1270                 "tooltip": translate("Unload All"),
     1292                "tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.unload") +
     1293                           translate("Unload All."),
    12711294                "icon": "garrison-out.png",
    12721295                "count": count,
    12731296            };