Ticket #4008: missingunitactionhotkeys.patch

File missingunitactionhotkeys.patch, 4.8 KB (added by Sandarac, 4 years ago)

Adds hotkeys as suggested by Imarok, and "Y" for rally point focusing

  • binaries/data/config/default.cfg

     
    177177[hotkey.camera]
    178178reset = "R"                                   ; Reset camera rotation to default.
    179179follow = "F"                                  ; Follow the first unit in the selection
     180rallypointfocus = "Y"                         ; Focus the camera on the rally point of the selected building
    180181zoom.in = Plus, Equals, NumPlus               ; Zoom camera in (continuous control)
    181182zoom.out = Minus, NumMinus                    ; Zoom camera out (continuous control)
    182183zoom.wheel.in = WheelUp                       ; Zoom camera in (stepped control)
     
    280281garrison = Ctrl              ; Modifier to garrison when clicking on building
    281282autorallypoint = Ctrl        ; Modifier to set the rally point on the building itself
    282283guard = "G"                  ; Modifier to escort/guard when clicking on unit/building
     284repair = Alt                 ; Modifier to repair when clicking on building/mechanical unit
     285unload = "U"                 ; Modifier to unload when building/mechanical unit is selected
    283286queue = Shift                ; Modifier to queue unit orders instead of replacing
    284287batchtrain = Shift           ; Modifier to train units in batches
    285288massbarter = 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

     
    5353        <action on="Press">performCommand(g_Selection.getFirstSelected(), "delete");</action>
    5454    </object>
    5555
     56    <!-- Unload units from building/mechanical unit -->
     57    <object hotkey="session.unload">
     58        <action on="Press">unloadAll();</action>
     59    </object>
     60
    5661    <!-- Stop the selected units -->
    5762    <object hotkey="session.stop">
    5863        <action on="Press">stopUnits(g_Selection.toList());</action>
  • binaries/data/mods/public/gui/session/unit_actions.js

     
    782782                data.targetClasses = targetClasses;
    783783                cursor = "action-attack-move";
    784784            }
     785            else if (Engine.HotkeyIsPressed("session.repair") && targetState.needsRepair &&
     786                playerCheck(entState, targetState, ["Ally"]))
     787            {
     788                data.command = "repair";
     789                data.target = targetState.id;
     790                cursor = "action-repair";
     791            }
    785792
    786             if (targetState.garrisonHolder &&
     793            if (targetState.garrisonHolder && !Engine.HotkeyIsPressed("session.repair") &&
    787794                playerCheck(entState, targetState, ["Player", "MutualAlly"]))
    788795            {
    789796                data.command = "garrison";
     
    973980            }
    974981
    975982            return {
    976                 "tooltip": translate("Unload All"),
     983                "tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.unload") +
     984                           translate("Unload All."),
    977985                "icon": "garrison-out.png",
    978986                "count": count,
    979987            };
     
    11031111                return false;
    11041112
    11051113            return {
    1106                 "tooltip": translate("Repair"),
     1114                "tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.repair") +
     1115                           translate("Order the selected units to repair a building or mechanical unit."),
    11071116                "icon": "repair.png"
    11081117            };
    11091118        },
     
    11211130                return false;
    11221131
    11231132            return {
    1124                 "tooltip": translate("Focus on Rally Point"),
     1133                "tooltip": colorizeHotkey("%(hotkey)s" + " ", "camera.rallypointfocus") +
     1134                           translate("Focus on Rally Point."),
    11251135                "icon": "focus-rally.png"
    11261136            };
    11271137        },
     
    12751285            }
    12761286
    12771287            return {
    1278                 "tooltip": translate("Unload All"),
     1288                "tooltip": colorizeHotkey("%(hotkey)s" + " ", "session.unload") +
     1289                           translate("Unload All."),
    12791290                "icon": "garrison-out.png",
    12801291                "count": count,
    12811292            };