Ticket #3962: forcedelete.patch

File forcedelete.patch, 2.0 KB (added by Sandarac, 8 years ago)
  • config/default.cfg

     
    284284batchtrain = Shift           ; Modifier to train units in batches
    285285massbarter = Shift           ; Modifier to barter bunch of resources
    286286masstribute = Shift          ; Modifier to tribute bunch of resources
     287massdelete = Shift           ; Do not ask confirmation when deleting a building
    287288fulltradeswap = Shift        ; Modifier to put the desired trade resource to 100%
    288289unloadtype = Shift           ; Modifier to unload all units of type
    289290deselectgroup = Ctrl         ; Modifier to deselect units when clicking group icon, instead of selecting
  • mods/public/gui/session/menu.js

     
    164164    closeOpenDialogs();
    165165
    166166    let deleteSelectedEntities = function (selectionArg)
     167   
    167168    {
    168169        Engine.PostNetworkCommand({ "type": "delete-entities", "entities": selectionArg });
    169170    };
     
    178179    );
    179180}
    180181
     182function deleteWithoutConfirmation(selection)
     183{
     184    closeOpenDialogs();
     185
     186    Engine.PostNetworkCommand({ "type": "delete-entities", "entities": selection });
     187}
     188
    181189function openSave()
    182190{
    183191    closeOpenDialogs();
  • mods/public/gui/session/unit_actions.js

     
    731731            if (!selection.length)
    732732                return;
    733733            if (!entState.resourceSupply || !entState.resourceSupply.killBeforeGather || g_DevSettings.controlAll)
    734                 openDeleteDialog(selection);
     734                if (Engine.HotkeyIsPressed("session.massdelete"))
     735                    deleteWithoutConfirmation(selection);
     736                else
     737                    openDeleteDialog(selection);
    735738        },
    736739    },
    737740    // Stop