mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Fixed unit payloads, spread update load from mission update
This commit is contained in:
1236
client/src/units/aircraftDatabase.ts
Normal file
1236
client/src/units/aircraftDatabase.ts
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -12,6 +12,7 @@ var pathIcon = new Icon({
|
||||
|
||||
export class Unit {
|
||||
ID: number = -1;
|
||||
AI: boolean = false;
|
||||
formation: string = "";
|
||||
name: string = "";
|
||||
unitName: string = "";
|
||||
@@ -387,6 +388,9 @@ export class Unit {
|
||||
|
||||
export class AirUnit extends Unit {
|
||||
getHidden() {
|
||||
if (this.AI == false && getVisibilitySettings().uncontrolled === "hidden")
|
||||
return true
|
||||
|
||||
if (this.alive)
|
||||
{
|
||||
if (this.flags.user && getVisibilitySettings().user === "hidden")
|
||||
@@ -421,6 +425,9 @@ export class GroundUnit extends Unit {
|
||||
}
|
||||
|
||||
getHidden() {
|
||||
if (this.AI == false && getVisibilitySettings().uncontrolled === "hidden")
|
||||
return true
|
||||
|
||||
if (this.alive)
|
||||
{
|
||||
if (this.flags.user && getVisibilitySettings().user === "hidden")
|
||||
@@ -441,6 +448,9 @@ export class NavyUnit extends Unit {
|
||||
}
|
||||
|
||||
getHidden() {
|
||||
if (this.AI == false && getVisibilitySettings().uncontrolled === "hidden")
|
||||
return true
|
||||
|
||||
if (this.alive)
|
||||
{
|
||||
if (this.flags.user && getVisibilitySettings().user === "hidden")
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,8 @@ export class UnitsManager {
|
||||
name: data.name,
|
||||
human: data.human,
|
||||
coalitionID: data.coalitionID,
|
||||
type: data.type
|
||||
type: data.type,
|
||||
AI: data.AI
|
||||
}
|
||||
this.#units[ID] = new constructor(ID, options);
|
||||
}
|
||||
@@ -112,10 +113,13 @@ export class UnitsManager {
|
||||
this.deselectAllUnits();
|
||||
for (let ID in this.#units)
|
||||
{
|
||||
var latlng = new LatLng(this.#units[ID].latitude, this.#units[ID].longitude);
|
||||
if (bounds.contains(latlng))
|
||||
if (this.#units[ID].getHidden() == false)
|
||||
{
|
||||
this.#units[ID].setSelected(true);
|
||||
var latlng = new LatLng(this.#units[ID].latitude, this.#units[ID].longitude);
|
||||
if (bounds.contains(latlng))
|
||||
{
|
||||
this.#units[ID].setSelected(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user