Fixed unit payloads, spread update load from mission update

This commit is contained in:
Pax1601
2023-02-14 22:48:17 +01:00
parent 0564b4b01f
commit 433b4bdf56
13 changed files with 1349 additions and 60 deletions

View File

@@ -8,6 +8,7 @@ export interface MarkerOptions {
human: boolean
coalitionID: number
type: any
AI: boolean
}
export interface MarkerData {
@@ -21,6 +22,7 @@ export class UnitMarker extends L.Marker {
#unitName: string
#name: string
#human: boolean
#AI: boolean
#alive: boolean = true
#selected: boolean = false
@@ -29,6 +31,7 @@ export class UnitMarker extends L.Marker {
this.#unitName = options.unitName;
this.#name = options.name;
this.#human = options.human;
this.#AI = options.AI;
var symbol = new Symbol(this.#computeMarkerCode(options), { size: 25 });
var img = symbol.asCanvas().toDataURL('image/png');
@@ -127,6 +130,10 @@ export class UnitMarker extends L.Marker {
return this.#human;
}
getAI() {
return this.#AI;
}
getAlive() {
return this.#alive;
}
@@ -226,7 +233,7 @@ export class AirUnitMarker extends UnitMarker {
else if (!this.getAlive())
return "none";
else
return getVisibilitySettings().ai;
return this.getAI()? getVisibilitySettings().ai: getVisibilitySettings().uncontrolled;
}
}
@@ -247,7 +254,7 @@ export class GroundUnitMarker extends UnitMarker {
else if (!this.getAlive())
return "none";
else
return getVisibilitySettings().ai;
return this.getAI()? getVisibilitySettings().ai: getVisibilitySettings().uncontrolled;
}
}
@@ -259,7 +266,7 @@ export class NavyUnitMarker extends UnitMarker {
if (!this.getAlive())
return "none";
else
return getVisibilitySettings().ai;
return this.getAI()? getVisibilitySettings().ai: getVisibilitySettings().uncontrolled;
}
}