Ticket #1928: v3_escape_cancel.diff

File v3_escape_cancel.diff, 2.0 KB (added by Josh, 11 years ago)

Re-implemented to be more extendable.

  • 0ad/binaries/data/mods/public/gui/session/input.js

     
    20532053
    20542054    Engine.PostNetworkCommand({"type": "unload-all", "garrisonHolders": garrisonHolders});
    20552055}
     2056function clearSelection()
     2057{
     2058    inputState = INPUT_NORMAL;
     2059    preSelectedAction = ACTION_NONE;
     2060    g_Selection.reset();
     2061    placementSupport.Reset();
     2062}
  • 0ad/binaries/data/mods/public/gui/session/session.xml

     
    142142        <action on="Press">findIdleUnit(["Hero", "Champion", "CitizenSoldier", "Siege", "Warship"]);</action>
    143143    </object>
    144144
     145    <!-- Unselects any selected entities -->
     146    <object hotkey="selection.cancel">
     147        <action on="Press">clearSelection()</action>
     148    </object>
    145149    <!-- ================================  ================================ -->
    146150    <!-- Developer / Debug items -->
    147151    <!-- ================================  ================================ -->
  • 0ad/binaries/data/config/default.cfg

     
    207207hotkey.selection.add = Shift                ; Add units to selection
    208208hotkey.selection.milonly = Alt              ; Add only military units to selection
    209209hotkey.selection.remove = Ctrl              ; Remove units from selection
     210hotkey.selection.cancel = Esc               ; Un-select all units and cancel building placement
    210211hotkey.selection.idleworker = Period        ; Select next idle worker
    211212hotkey.selection.idlewarrior = Comma        ; Select next idle warrior
    212213hotkey.selection.offscreen = Alt            ; Include offscreen units in selection