diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 245f66c130..6a756e165a 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -1142,6 +1142,7 @@ keybind.diagonal_placement.name = Diagonal Placement keybind.pick.name = Pick Block keybind.break_block.name = Break Block keybind.select_all_units = Select All Units +keybind.select_all_unit_factories = Select All Unit Factories keybind.deselect.name = Deselect keybind.pickupCargo.name = Pickup Cargo keybind.dropCargo.name = Drop Cargo diff --git a/core/src/mindustry/input/Binding.java b/core/src/mindustry/input/Binding.java index 5599cd1fe6..89d8fde1b7 100644 --- a/core/src/mindustry/input/Binding.java +++ b/core/src/mindustry/input/Binding.java @@ -20,6 +20,7 @@ public enum Binding implements KeyBind{ break_block(KeyCode.mouseRight), select_all_units(KeyCode.g), + select_all_unit_factories(KeyCode.h), pickupCargo(KeyCode.leftBracket), dropCargo(KeyCode.rightBracket), diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index fb2449ebd5..4a36ccf1b8 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -279,6 +279,7 @@ public class DesktopInput extends InputHandler{ if(commandMode && input.keyTap(Binding.select_all_units) && !scene.hasField() && !scene.hasDialog()){ selectedUnits.clear(); + commandBuildings.clear(); for(var unit : player.team().data().units){ if(unit.isCommandable()){ selectedUnits.add(unit); @@ -286,6 +287,16 @@ public class DesktopInput extends InputHandler{ } } + if(commandMode && input.keyTap(Binding.select_all_unit_factories) && !scene.hasField() && !scene.hasDialog()){ + selectedUnits.clear(); + commandBuildings.clear(); + for(var build : player.team().data().buildings){ + if(build.block.commandable){ + commandBuildings.add(build); + } + } + } + if(!scene.hasMouse() && !locked && state.rules.possessionAllowed){ if(Core.input.keyDown(Binding.control) && Core.input.keyTap(Binding.select)){ Unit on = selectedUnit();