Readded command mode options

This commit is contained in:
Davide Passoni
2024-11-07 17:39:34 +01:00
parent 454c7ad2de
commit df939f1ac3
27 changed files with 990 additions and 231 deletions

View File

@@ -19,6 +19,7 @@ export class Airbase extends CustomMarker {
#properties: string[] = [];
#parkings: string[] = [];
#img: HTMLImageElement;
#selected: boolean = false;
constructor(options: AirbaseOptions) {
super(options.position, { riseOnHover: true });
@@ -26,8 +27,14 @@ export class Airbase extends CustomMarker {
this.#name = options.name;
this.#img = document.createElement("img");
AirbaseSelectedEvent.on((airbase) => {
this.#selected = airbase == this;
if (this.getElement()?.querySelector(".airbase-icon"))
(this.getElement()?.querySelector(".airbase-icon") as HTMLElement).dataset.selected = `${this.#selected}`;
})
this.addEventListener("click", (ev) => {
if (getApp().getState() === OlympusState.IDLE) {
if (getApp().getState() === OlympusState.IDLE || getApp().getState() === OlympusState.AIRBASE) {
getApp().setState(OlympusState.AIRBASE)
AirbaseSelectedEvent.dispatch(this)
}

View File

@@ -223,7 +223,8 @@ export class MissionManager {
commandModeOptions.spawnPoints.red !== this.getCommandModeOptions().spawnPoints.red ||
commandModeOptions.spawnPoints.blue !== this.getCommandModeOptions().spawnPoints.blue ||
commandModeOptions.restrictSpawns !== this.getCommandModeOptions().restrictSpawns ||
commandModeOptions.restrictToCoalition !== this.getCommandModeOptions().restrictToCoalition;
commandModeOptions.restrictToCoalition !== this.getCommandModeOptions().restrictToCoalition ||
commandModeOptions.setupTime !== this.getCommandModeOptions().setupTime;
this.#commandModeOptions = commandModeOptions;
this.setSpentSpawnPoints(0);