diff --git a/client/public/stylesheets/olympus.css b/client/public/stylesheets/olympus.css index 2bce5980..92e7573b 100644 --- a/client/public/stylesheets/olympus.css +++ b/client/public/stylesheets/olympus.css @@ -553,7 +553,7 @@ nav.ol-panel> :last-child { } .ol-sortable .handle { - background-image: url("/images/icons/grip-lines-solid.svg"); + background-image: url("/resources/theme/images/icons/grip-lines-solid.svg"); cursor: ns-resize; filter: invert(); height: 12px; diff --git a/client/public/themes/olympus/images/icons/crosshairs-solid.svg b/client/public/themes/olympus/images/icons/crosshairs-solid.svg new file mode 100644 index 00000000..c2a60f84 --- /dev/null +++ b/client/public/themes/olympus/images/icons/crosshairs-solid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/client/src/index.ts b/client/src/index.ts index c2f8a1b6..8d57b546 100644 --- a/client/src/index.ts +++ b/client/src/index.ts @@ -97,6 +97,7 @@ function readConfig(config: any) { } function setupEvents() { + /* Generic clicks */ document.addEventListener("click", (ev) => { if (ev instanceof MouseEvent && ev.target instanceof HTMLElement) { diff --git a/client/src/missionhandler/missionhandler.ts b/client/src/missionhandler/missionhandler.ts index 53c9f368..a6271c16 100644 --- a/client/src/missionhandler/missionhandler.ts +++ b/client/src/missionhandler/missionhandler.ts @@ -9,7 +9,6 @@ export class MissionHandler #airbases : {[name: string]: Airbase} = {}; #theatre : string = ""; - #airbaseData : { [name: string]: object } = {}; // Time @@ -20,7 +19,6 @@ export class MissionHandler #updateTime : any; - constructor() { diff --git a/client/src/units/unit.ts b/client/src/units/unit.ts index d54034a7..d2c70b46 100644 --- a/client/src/units/unit.ts +++ b/client/src/units/unit.ts @@ -511,7 +511,6 @@ export class Unit extends CustomMarker { } delete() { - // TODO: add confirmation popup deleteUnit(this.ID); } diff --git a/client/src/units/unitsmanager.ts b/client/src/units/unitsmanager.ts index 07f5ac9c..95fbb744 100644 --- a/client/src/units/unitsmanager.ts +++ b/client/src/units/unitsmanager.ts @@ -20,7 +20,7 @@ export class UnitsManager { document.addEventListener('paste', () => this.pasteUnits()); document.addEventListener('unitSelection', (e: CustomEvent) => this.#onUnitSelection(e.detail)); document.addEventListener('unitDeselection', (e: CustomEvent) => this.#onUnitDeselection(e.detail)); - document.addEventListener('keydown', (event) => this.#onKeyDown(event)); + document.addEventListener('keyup', (event) => this.#onKeyUp(event)); document.addEventListener('deleteSelectedUnits', () => this.selectedUnitsDelete()) } @@ -426,9 +426,18 @@ export class UnitsManager { } /***********************************************/ - #onKeyDown(event: KeyboardEvent) { - if (!keyEventWasInInput(event) && event.key === "Delete") { - this.selectedUnitsDelete(); + #onKeyUp(event: KeyboardEvent) { + if (!keyEventWasInInput(event) && event.key === "Delete" ) { + + const selectedUnits = this.getSelectedUnits(); + const selectionContainsAHuman = selectedUnits.some( ( unit:Unit ) => { + return unit.getMissionData().flags.Human === true; + }); + + if ( !selectionContainsAHuman || confirm( "Your selection includes a human player. Deleting humans causes their vehicle to crash.\n\nAre you sure you want to do this?" ) ) { + this.selectedUnitsDelete(); + } + } } diff --git a/client/views/atc/addflight.ejs b/client/views/atc/addflight.ejs index 818869f0..97e1ae5b 100644 --- a/client/views/atc/addflight.ejs +++ b/client/views/atc/addflight.ejs @@ -1,5 +1,5 @@
- +
\ No newline at end of file