Added "select all units" keybind
This commit is contained in:
@@ -19,6 +19,8 @@ public enum Binding implements KeyBind{
|
||||
deselect(KeyCode.mouseRight),
|
||||
break_block(KeyCode.mouseRight),
|
||||
|
||||
select_all_units(KeyCode.g),
|
||||
|
||||
pickupCargo(KeyCode.leftBracket),
|
||||
dropCargo(KeyCode.rightBracket),
|
||||
|
||||
|
||||
@@ -254,6 +254,15 @@ public class DesktopInput extends InputHandler{
|
||||
//validate commanding units
|
||||
selectedUnits.removeAll(u -> !u.isCommandable() || !u.isValid());
|
||||
|
||||
if(commandMode && input.keyTap(Binding.select_all_units) && !scene.hasField() && !scene.hasDialog()){
|
||||
selectedUnits.clear();
|
||||
for(var unit : player.team().data().units){
|
||||
if(unit.isCommandable()){
|
||||
selectedUnits.add(unit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!scene.hasMouse() && !locked && state.rules.possessionAllowed){
|
||||
if(Core.input.keyDown(Binding.control) && Core.input.keyTap(Binding.select)){
|
||||
Unit on = selectedUnit();
|
||||
|
||||
Reference in New Issue
Block a user