Adds select all unit production hotkey (#7824)
Co-authored-by: Garen7 <Garen7@users.noreply.github.com>
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user