mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Minimal code refactoring
This commit is contained in:
@@ -121,18 +121,15 @@ export class UnitControlPanel extends Panel {
|
||||
button.classList.add("pill", "highlight-coalition")
|
||||
|
||||
button.addEventListener("click", ( ev:MouseEventInit ) => {
|
||||
|
||||
// Ctrl-click deselection
|
||||
if ( ev.ctrlKey === true && ev.shiftKey === false && ev.altKey === false ) {
|
||||
getUnitsManager().deselectUnit( unit.ID );
|
||||
button.remove();
|
||||
|
||||
// Deselect all
|
||||
} else {
|
||||
getUnitsManager().deselectAllUnits();
|
||||
getUnitsManager().selectUnit(unit.ID, true);
|
||||
}
|
||||
|
||||
});
|
||||
return (button);
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user