Minimal code refactoring

This commit is contained in:
Pax1601
2023-08-15 11:09:00 +02:00
parent 06e1cbeb7e
commit f544b0afaa
4 changed files with 22 additions and 24 deletions

View File

@@ -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);
}));