From 0db2e56e32bb8eff6b66dfdf84db4f6cabebb780 Mon Sep 17 00:00:00 2001 From: Pax1601 Date: Fri, 6 Oct 2023 16:07:54 +0200 Subject: [PATCH] Completed range rings --- client/demo.js | 10 +- .../controltips/src/controltipsplugin.ts | 2 +- .../databasemanager/src/grounduniteditor.ts | 4 +- .../databases/units/navyunitdatabase.json | 2902 +++++++++-------- client/src/constants/constants.ts | 20 +- client/src/contextmenus/contextmenu.ts | 2 + client/src/contextmenus/mapcontextmenu.ts | 15 +- client/src/controls/unitspawnmenu.ts | 66 +- client/src/dom.d.ts | 1 + client/src/map/map.ts | 6 +- client/src/olympusapp.ts | 41 +- client/src/panels/unitcontrolpanel.ts | 2 +- client/src/unit/unit.ts | 177 +- client/src/unit/unitsmanager.ts | 13 +- scripts/python/.vscode/launch.json | 2 +- 15 files changed, 1761 insertions(+), 1502 deletions(-) diff --git a/client/demo.js b/client/demo.js index 1e2288d0..7eed71b4 100644 --- a/client/demo.js +++ b/client/demo.js @@ -15,7 +15,7 @@ const DEMO_UNIT_DATA = { radio: { frequency: 124000000, callsign: 1, callsignNumber: 1 }, generalSettings: { prohibitAA: false, prohibitAfterburner: false, prohibitAG: false, prohibitAirWpn: false, prohibitJettison: false }, ammo: [{ quantity: 2, name: "A cool missile\0Ciao", guidance: 0, category: 0, missileCategory: 0 }, { quantity: 2, name: "A cool missile with a longer name\0Ciao", guidance: 0, category: 0, missileCategory: 0 }, { quantity: 2, name: "A cool missile\0Ciao", guidance: 0, category: 0, missileCategory: 0 } , { quantity: 2, name: "A cool missile\0Ciao", guidance: 0, category: 0, missileCategory: 0 } , { quantity: 2, name: "A cool missile\0Ciao", guidance: 0, category: 0, missileCategory: 0 } , { quantity: 2, name: "A cool missile\0Ciao", guidance: 0, category: 0, missileCategory: 0 } , { quantity: 2, name: "A cool missile\0Ciao", guidance: 0, category: 0, missileCategory: 0 } , { quantity: 2, name: "A cool missile\0Ciao", guidance: 0, category: 0, missileCategory: 0 } , { quantity: 2, name: "A cool missile\0Ciao", guidance: 0, category: 0, missileCategory: 0 } ], - contacts: [{ID: 2, detectionMethod: 1}, {ID: 3, detectionMethod: 4}, {ID: 5, detectionMethod: 4}], + contacts: [{ID: 2, detectionMethod: 1}, {ID: 3, detectionMethod: 4}, {ID: 4, detectionMethod: 1}], activePath: [{lat: 38, lng: -115, alt: 0}, {lat: 38, lng: -114, alt: 0}] }, ["2"]:{ category: "Aircraft", alive: true, human: false, controlled: false, coalition: 1, country: 0, name: "B-52H", unitName: "Cool guy 1-2", groupName: "Cool group 2", state: 1, task: "Being cool", @@ -31,7 +31,7 @@ const DEMO_UNIT_DATA = { radio: { frequency: 124000000, callsign: 1, callsignNumber: 1 }, generalSettings: { prohibitAA: false, prohibitAfterburner: false, prohibitAG: false, prohibitAirWpn: false, prohibitJettison: false }, ammo: [{ quantity: 2, name: "A cool missile", guidance: 0, category: 0, missileCategory: 0 } ], - contacts: [{ID: 1, detectionMethod: 16}], + contacts: [{ID: 4, detectionMethod: 1}], activePath: [ ] }, ["3"]:{ category: "Helicopter", alive: true, human: false, controlled: false, coalition: 1, country: 0, name: "AH-64D_BLK_II", unitName: "Cool guy 1-4", groupName: "Cool group 3", state: 1, task: "Being cool", hasTask: false, position: { lat: 37.1, lng: -116.1, alt: 1000 }, speed: 200, heading: 315 * Math.PI / 180, isTanker: false, isAWACS: false, onOff: true, followRoads: false, fuel: 50, @@ -48,7 +48,7 @@ const DEMO_UNIT_DATA = { ammo: [{ quantity: 2, name: "A cool missile", guidance: 0, category: 0, missileCategory: 0 } ], contacts: [{ID: 1, detectionMethod: 16}], activePath: [ ] - }, ["4"]:{ category: "GroundUnit", alive: true, human: false, controlled: true, coalition: 0, country: 0, name: "Gepard", unitName: "Cool guy 2-1", groupName: "Cool group 4", state: 1, task: "Being cool", + }, ["4"]:{ category: "GroundUnit", alive: true, human: false, controlled: true, coalition: 2, country: 0, name: "Tor 9A331", unitName: "Cool guy 2-1", groupName: "Cool group 4", state: 1, task: "Being cool", hasTask: false, position: { lat: 37.2, lng: -116.1, alt: 1000 }, speed: 200, heading: 315 * Math.PI / 180, isTanker: false, isAWACS: false, onOff: true, followRoads: false, fuel: 50, desiredSpeed: 300, desiredSpeedType: 1, desiredAltitude: 1000, desiredAltitudeType: 1, leaderID: 0, formationOffset: { x: 0, y: 0, z: 0 }, @@ -65,7 +65,7 @@ const DEMO_UNIT_DATA = { activePath: [ ], isLeader: true, operateAs: 2 - }, ["5"]:{ category: "GroundUnit", alive: true, human: false, controlled: true, coalition: 0, country: 0, name: "Gepard", unitName: "Cool guy 2-2", groupName: "Cool group 4", state: 1, task: "Being cool", + }, ["5"]:{ category: "GroundUnit", alive: true, human: false, controlled: true, coalition: 2, country: 0, name: "Gepard", unitName: "Cool guy 2-2", groupName: "Cool group 4", state: 1, task: "Being cool", hasTask: false, position: { lat: 37.21, lng: -116.1, alt: 1000 }, speed: 200, heading: 315 * Math.PI / 180, isTanker: false, isAWACS: false, onOff: true, followRoads: false, fuel: 50, desiredSpeed: 300, desiredSpeedType: 1, desiredAltitude: 1000, desiredAltitudeType: 1, leaderID: 0, formationOffset: { x: 0, y: 0, z: 0 }, @@ -98,7 +98,7 @@ const DEMO_UNIT_DATA = { ammo: [{ quantity: 2, name: "A cool missile", guidance: 0, category: 0, missileCategory: 0 } ], contacts: [{ID: 1, detectionMethod: 16}], activePath: [ ] - }, ["7"]:{ category: "GroundUnit", alive: true, human: false, controlled: true, coalition: 1, country: 0, name: "T-55", unitName: "Cool guy 2-1", groupName: "Cool group 10", state: 1, task: "Being cool", + }, ["7"]:{ category: "GroundUnit", alive: true, human: false, controlled: true, coalition: 1, country: 0, name: "Tor 9A331", unitName: "Cool guy 2-1", groupName: "Cool group 10", state: 1, task: "Being cool", hasTask: false, position: { lat: 37.2, lng: -116.2, alt: 1000 }, speed: 200, heading: 315 * Math.PI / 180, isTanker: false, isAWACS: false, onOff: true, followRoads: false, fuel: 50, desiredSpeed: 300, desiredSpeedType: 1, desiredAltitude: 1000, desiredAltitudeType: 1, leaderID: 0, formationOffset: { x: 0, y: 0, z: 0 }, diff --git a/client/plugins/controltips/src/controltipsplugin.ts b/client/plugins/controltips/src/controltipsplugin.ts index 63f0a068..20f9ab1d 100644 --- a/client/plugins/controltips/src/controltipsplugin.ts +++ b/client/plugins/controltips/src/controltipsplugin.ts @@ -58,7 +58,7 @@ export class ControlTipsPlugin implements OlympusPlugin { this.#updateTips(); }); - document.addEventListener("unitSelection", (ev: CustomEventInit ) => { + document.addEventListener("unitsSelection", (ev: CustomEventInit ) => { this.#updateTips(); }); diff --git a/client/plugins/databasemanager/src/grounduniteditor.ts b/client/plugins/databasemanager/src/grounduniteditor.ts index 5f6ea6f2..81853957 100644 --- a/client/plugins/databasemanager/src/grounduniteditor.ts +++ b/client/plugins/databasemanager/src/grounduniteditor.ts @@ -34,8 +34,8 @@ export class GroundUnitEditor extends UnitEditor { addDropdownInput(this.contentDiv2, "Era", blueprint.era, ["WW2", "Early Cold War", "Mid Cold War", "Late Cold War", "Modern"]); //addStringInput(this.contentDiv2, "Filename", blueprint.filename?? "", "text", (value: string) => {blueprint.filename = value; }); addStringInput(this.contentDiv2, "Cost", String(blueprint.cost)?? "", "number", (value: string) => {blueprint.cost = parseFloat(value); }); - addStringInput(this.contentDiv2, "Acquisition range [NM]", String(blueprint.acquisitionRange)?? "", "number", (value: string) => {blueprint.acquisitionRange = parseFloat(value); }); - addStringInput(this.contentDiv2, "Engagement range [NM]", String(blueprint.engagementRange)?? "", "number", (value: string) => {blueprint.engagementRange = parseFloat(value); }); + addStringInput(this.contentDiv2, "Acquisition range [m]", String(blueprint.acquisitionRange)?? "", "number", (value: string) => {blueprint.acquisitionRange = parseFloat(value); }); + addStringInput(this.contentDiv2, "Engagement range [m]", String(blueprint.engagementRange)?? "", "number", (value: string) => {blueprint.engagementRange = parseFloat(value); }); addStringInput(this.contentDiv2, "Barrel height [m]", String(blueprint.barrelHeight)?? "", "number", (value: string) => {blueprint.barrelHeight = parseFloat(value); }); addStringInput(this.contentDiv2, "Muzzle velocity [m/s]", String(blueprint.muzzleVelocity)?? "", "number", (value: string) => {blueprint.muzzleVelocity = parseFloat(value); }); addStringInput(this.contentDiv2, "Aim time [s]", String(blueprint.aimTime)?? "", "number", (value: string) => {blueprint.aimTime = parseFloat(value); }); diff --git a/client/public/databases/units/navyunitdatabase.json b/client/public/databases/units/navyunitdatabase.json index 7c6866c4..58f2a388 100644 --- a/client/public/databases/units/navyunitdatabase.json +++ b/client/public/databases/units/navyunitdatabase.json @@ -1,1401 +1,1505 @@ { - "BDK-775": { - "name": "BDK-775", - "coalition": "blue", - "type": "Landing Craft", - "era": "Mid Cold War", - "label": "LS Ropucha", - "shortLabel": "LS Ropucha", - "range": "", - "filename": "", - "enabled": true - }, - "CVN_71": { - "name": "CVN_71", - "coalition": "blue", - "type": "Super Aircraft Carrier", - "era": "Late Cold War", - "label": "CVN-71 Theodore Roosevelt", - "shortLabel": "CVN-71", - "range": "Short", - "filename": "", - "enabled": true - }, - "CVN_72": { - "name": "CVN_72", - "coalition": "blue", - "type": "Super Aircraft Carrier", - "era": "Late Cold War", - "label": "CVN-72 Abraham Lincoln", - "shortLabel": "CVN-72", - "range": "Short", - "filename": "", - "enabled": true - }, - "CVN_73": { - "name": "CVN_73", - "coalition": "blue", - "type": "Super Aircraft Carrier", - "era": "Late Cold War", - "label": "CVN-73 George Washington", - "shortLabel": "CVN-73", - "range": "Medium", - "filename": "", - "enabled": true - }, - "CVN_75": { - "name": "CVN_75", - "coalition": "blue", - "type": "Aircraft Carrier", - "era": "Late Cold War", - "label": "CVN-75 Harry S. Truman", - "shortLabel": "CVN-75", - "range": "Medium", - "filename": "", - "enabled": true, - "liveries": { - "autumn": { - "name": "Autumn", - "countries": "All" - }, - "winter": { - "name": "Winter", - "countries": "All" - }, - "summer": { - "name": "Summer", - "countries": "All" - }, - "spring": { - "name": "Spring", - "countries": "All" - }, - "desert": { - "name": "Desert", - "countries": "All" - } - } - }, - "CV_1143_5": { - "name": "CV_1143_5", - "coalition": "red", - "type": "Aircraft Carrier", - "era": "Modern", - "label": "CV Admiral Kuznetsov(2017)", - "shortLabel": "Admiral Kuznetsov(2017)", - "range": "Medium", - "filename": "", - "enabled": true - }, - "CastleClass_01": { - "name": "CastleClass_01", - "coalition": "blue", - "type": "Patrol", - "era": "Mid Cold War", - "label": "HMS Leeds Castle (P-258)", - "shortLabel": "HMS Leeds Castle (P-258)", - "range": "", - "filename": "", - "enabled": true, - "liveries": { - "dumbarton": { - "name": "Dumbarton", - "countries": "All" - } - } - }, - "HandyWind": { - "name": "HandyWind", - "coalition": "blue", - "type": "Cargoship", - "era": "Late Cold War", - "label": "Bulker Handy Wind", - "shortLabel": "Bulker Handy Wind", - "range": "", - "filename": "", - "enabled": true, - "liveries": { - "noname": { - "name": "NoName", - "countries": "All" - }, - "handy_wind": { - "name": "Handy Wind", - "countries": "All" - }, - "baltic_cove": { - "name": "Baltic Cove", - "countries": "All" - }, - "baltic_wind": { - "name": "Baltic Wind", - "countries": "All" - } - } - }, - "HarborTug": { - "name": "HarborTug", - "coalition": "", - "type": "Tug", - "era": "Mid Cold War", - "label": "Harbor Tug", - "shortLabel": "Harbor Tug", - "range": "", - "filename": "", - "enabled": true, - "liveries": { - "harbor tug blue": { - "name": "Harbor Tug Blue", - "countries": "All" - }, - "harbor tug red": { - "name": "Harbor Tug Red", - "countries": "All" - }, - "harbor tug black": { - "name": "Harbor Tug Black", - "countries": "All" - }, - "harbor tug green": { - "name": "Harbor Tug Green", - "countries": "All" - } - } - }, - "LHA_Tarawa": { - "name": "LHA_Tarawa", - "coalition": "blue", - "type": "Aircraft Carrier", - "era": "Mid Cold War", - "label": "LHA-1 Tarawa", - "shortLabel": "LHA-1 Tarawa", - "range": "Short", - "filename": "", - "enabled": true - }, - "La_Combattante_II": { - "name": "La_Combattante_II", - "coalition": "blue", - "type": "Fast Attack Craft", - "era": "Mid Cold War", - "label": "FAC La Combattante lla", - "shortLabel": "FAC La Combattante", - "range": "", - "filename": "", - "enabled": true, - "liveries": { - "irn_217": { - "name": "217", - "countries": [ - "IRN" - ] - }, - "syr_35": { - "name": "35", - "countries": [ - "SYR" - ] - }, - "lib_521": { - "name": "521", - "countries": [ - "LIB" - ] - }, - "grg_dioskuria": { - "name": "Dioskuria", - "countries": [ - "GRG" - ] - }, - "grc_p77_plotarchis sakipis": { - "name": "Plotarchis_Sakipis", - "countries": [ - "GRC" - ] - }, - "grc_p72_ypoploiarchos votsis": { - "name": "Ypoploiarchos_Votsis", - "countries": [ - "GRC" - ] - }, - "egp_601": { - "name": "601", - "countries": [ - "EGP" - ] - }, - "irn_215": { - "name": "215", - "countries": [ - "IRN" - ] - }, - "ger_s50_panther": { - "name": "S50_Panther", - "countries": [ - "GER" - ] - }, - "lib_520": { - "name": "520", - "countries": [ - "LIB" - ] - }, - "grc_p73_antiploiarchos pezopoulos": { - "name": "Antiploiarchos_Pezopoulos", - "countries": [ - "GRC" - ] - }, - "ger_s54_elster": { - "name": "S54_Elster", - "countries": [ - "GER" - ] - }, - "ger_s58_pinguin": { - "name": "S58_Pinguin", - "countries": [ - "GER" - ] - }, - "grc_p74_plotarchis vlachavas": { - "name": "Plotarchis_Vlachavas", - "countries": [ - "GRC" - ] - }, - "ger_s52_storch": { - "name": "S52_Storch", - "countries": [ - "GER" - ] - }, - "ger_s57_weihe": { - "name": "S57_Weihe", - "countries": [ - "GER" - ] - }, - "egp_604": { - "name": "604", - "countries": [ - "EGP" - ] - }, - "ger_s53_pelikan": { - "name": "S53_Pelikan", - "countries": [ - "GER" - ] - }, - "lib_522": { - "name": "522", - "countries": [ - "LIB" - ] - }, - "ger_s56_dommel": { - "name": "S56_Dommel", - "countries": [ - "GER" - ] - }, - "irn_216": { - "name": "216", - "countries": [ - "IRN" - ] - }, - "ger_s59_reiher": { - "name": "S59_Reiher", - "countries": [ - "GER" - ] - }, - "lib_519": { - "name": "519", - "countries": [ - "LIB" - ] - }, - "syr_34": { - "name": "34", - "countries": [ - "SYR" - ] - }, - "irn_218": { - "name": "218", - "countries": [ - "IRN" - ] - }, - "grc_p76_ypoploiarchos tournas": { - "name": "Ypoploiarchos_Tournas", - "countries": [ - "GRC" - ] - }, - "grc_p75_plotarchis maridakis": { - "name": "Plotarchis_Maridakis", - "countries": [ - "GRC" - ] - }, - "ger_s55_alk": { - "name": "S55_Alk", - "countries": [ - "GER" - ] - }, - "grg_305": { - "name": "305", - "countries": [ - "GRG" - ] - }, - "egp_602": { - "name": "602", - "countries": [ - "EGP" - ] - }, - "irn_212": { - "name": "212", - "countries": [ - "IRN" - ] - }, - "grg_304": { - "name": "304", - "countries": [ - "GRG" - ] - }, - "irn_214": { - "name": "214", - "countries": [ - "IRN" - ] - }, - "irn_219": { - "name": "219", - "countries": [ - "IRN" - ] - }, - "syr_36": { - "name": "36", - "countries": [ - "SYR" - ] - }, - "lib_518": { - "name": "518", - "countries": [ - "LIB" - ] - }, - "egp_605": { - "name": "605", - "countries": [ - "EGP" - ] - }, - "ger_s51_haher": { - "name": "S51_Haher", - "countries": [ - "GER" - ] - }, - "egp_603": { - "name": "603", - "countries": [ - "EGP" - ] - } - } - }, - "Seawise_Giant": { - "name": "Seawise_Giant", - "coalition": "blue", - "type": "Tanker", - "era": "Late Cold War", - "label": "Tanker Seawise Giant", - "shortLabel": "Seawise Giant", - "range": "", - "filename": "", - "enabled": true - }, - "Ship_Tilde_Supply": { - "name": "Ship_Tilde_Supply", - "coalition": "blue", - "type": "Transport", - "era": "Late Cold War", - "label": "Supply Ship MV Tilde", - "shortLabel": "Supply Ship Tilde", - "range": "", - "filename": "", - "enabled": true - }, - "Stennis": { - "name": "Stennis", - "coalition": "blue", - "type": "Aircraft Carrier", - "era": "Late Cold War", - "label": "CVN-74 John C. Stennis", - "shortLabel": "CVN-74", - "range": "Medium", - "filename": "", - "enabled": true - }, - "TICONDEROG": { - "name": "TICONDEROG", - "coalition": "blue", - "type": "Cruiser", - "era": "Late Cold War", - "label": "Ticonderoga", - "shortLabel": "Ticonderoga", - "range": "Medium", - "filename": "", - "enabled": true, - "liveries": { - "vellagulf": { - "name": "USS Vella Gulf CG-72", - "countries": [ - "USA" - ] - }, - "huecity": { - "name": "USS Hue City CG-66", - "countries": [ - "USA" - ] - }, - "capestgeorge": { - "name": "USS Cape St. George CG-71", - "countries": [ - "USA" - ] - }, - "lakeerie": { - "name": "USS Lake Erie CG-70", - "countries": [ - "USA" - ] - }, - "chosin": { - "name": "USS Chosin CG-65", - "countries": [ - "USA" - ] - }, - "normandy": { - "name": "USS Normandy CG-60", - "countries": [ - "USA" - ] - }, - "portroyal": { - "name": "USS Port Royal CG-73", - "countries": [ - "USA" - ] - }, - "shiloh": { - "name": "USS Shiloh CG-67", - "countries": [ - "USA" - ] - }, - "viksburg": { - "name": "USS Viksburg CG-69", - "countries": [ - "USA" - ] - }, - "anzio": { - "name": "USS Anzio CG-68", - "countries": [ - "USA" - ] - } - } - }, - "Type_052B": { - "name": "Type_052B", - "coalition": "red", - "type": "Destroyer", - "era": "Modern", - "label": "052B DDG-168 Guangzhou", - "shortLabel": "Type 52B", - "range": "Short", - "filename": "", - "enabled": true, - "liveries": { - "general": { - "name": "General", - "countries": "All" - }, - "ddg-169": { - "name": "DDG-169 Wuhan", - "countries": [ - "CHN" - ] - }, - "ddg-168": { - "name": "DDG-168 Guangzhou", - "countries": [ - "CHN" - ] - } - } - }, - "Type_052C": { - "name": "Type_052C", - "coalition": "red", - "type": "Destroyer", - "era": "Modern", - "label": "052C DDG-171 Haikou", - "shortLabel": "Type 52C", - "range": "Short", - "filename": "", - "enabled": true, - "liveries": { - "ddg-171": { - "name": "DDG-171 Haikou", - "countries": [ - "CHN" - ] - }, - "general": { - "name": "General", - "countries": "All" - }, - "ddg-151": { - "name": "DDG-151 Zhengzhou", - "countries": [ - "CHN" - ] - }, - "ddg-170": { - "name": "DDG-170 Lanzhou", - "countries": [ - "CHN" - ] - }, - "default": { - "name": "DDG-150 Changchun", - "countries": [ - "CHN" - ] - }, - "ddg-152": { - "name": "DDG-152 Jinan", - "countries": [ - "CHN" - ] - }, - "ddg-153": { - "name": "DDG-153 Xi'an", - "countries": [ - "CHN" - ] - } - } - }, - "Type_054A": { - "name": "", - "coalition": "red", - "type": "Frigate", - "era": "Modern", - "label": "054A FFG-538 Yantai", - "shortLabel": "Type 54A", - "range": "Medium", - "filename": "", - "enabled": true, - "liveries": { - "ffg-573": { - "name": "FFG-573 Liuzhou", - "countries": [ - "CHN" - ] - }, - "ffg-578": { - "name": "FFG-578 Yangzhou", - "countries": [ - "CHN" - ] - }, - "ffg-531": { - "name": "FFG-531 Xiangtan", - "countries": [ - "CHN" - ] - }, - "ffg-550": { - "name": "FFG-550 Weifang", - "countries": [ - "CHN" - ] - }, - "ffg-536": { - "name": "FFG-536 Xuchang", - "countries": [ - "CHN" - ] - }, - "ffg-549": { - "name": "FFG-549 Changzhou", - "countries": [ - "CHN" - ] - }, - "ffg-574": { - "name": "FFG-574 Sanya", - "countries": [ - "CHN" - ] - }, - "default": { - "name": "FFG-515 Binzhou", - "countries": [ - "CHN" - ] - }, - "ffg-576": { - "name": "FFG-576 Daqing", - "countries": [ - "CHN" - ] - }, - "ffg-599": { - "name": "FFG-599 Anyang", - "countries": [ - "CHN" - ] - }, - "ffg-547": { - "name": "FFG-547 Linyi", - "countries": [ - "CHN" - ] - }, - "ffg-571": { - "name": "FFG-571 Yuncheng", - "countries": [ - "CHN" - ] - }, - "ffg-546": { - "name": "FFG-546 Yancheng", - "countries": [ - "CHN" - ] - }, - "ffg-579": { - "name": "FFG-579 Handan", - "countries": [ - "CHN" - ] - }, - "ffg-532": { - "name": "FFG-532 Jingzhou", - "countries": [ - "CHN" - ] - }, - "ffg-569": { - "name": "FFG-569 Yulin", - "countries": [ - "CHN" - ] - }, - "ffg-538": { - "name": "FFG-538 Yantai", - "countries": [ - "CHN" - ] - }, - "ffg-577": { - "name": "FFG-577 Huanggang", - "countries": [ - "CHN" - ] - }, - "general": { - "name": "General", - "countries": "All" - }, - "ffg-572": { - "name": "FFG-572 Hengshui", - "countries": [ - "CHN" - ] - }, - "ffg-539": { - "name": "FFG-539 Wuhu", - "countries": [ - "CHN" - ] - }, - "ffg-548": { - "name": "FFG-548 Yiyang", - "countries": [ - "CHN" - ] - }, - "ffg-575": { - "name": "FFG-575 Yueyang", - "countries": [ - "CHN" - ] - }, - "ffg-598": { - "name": "FFG-598 Rizhao", - "countries": [ - "CHN" - ] - }, - "ffg-500": { - "name": "FFG-500 Xianning", - "countries": [ - "CHN" - ] - } - } - }, - "Type_071": { - "name": "Type_071", - "coalition": "red", - "type": "Transport", - "era": "Modern", - "label": "Type 071", - "shortLabel": "Type 071", - "range": "", - "filename": "", - "enabled": true, - "liveries": { - "lpd-978": { - "name": "978 Wuzhi Shan", - "countries": [ - "CHN" - ] - }, - "lpd-989": { - "name": "989 Changbai Shan", - "countries": [ - "CHN" - ] - }, - "default": { - "name": "998 Kunlun Shan", - "countries": [ - "CHN" - ] - }, - "lpd-999": { - "name": "999 Jinggang Shan", - "countries": [ - "CHN" - ] - }, - "lpd-988": { - "name": "988 Yimeng Shan", - "countries": [ - "CHN" - ] - }, - "lpd-980": { - "name": "980 Longhu Shan", - "countries": [ - "CHN" - ] - } - } - }, - "Type_093": { - "name": "Type_093", - "coalition": "red", - "type": "Submarine", - "era": "Modern", - "label": "Type 093", - "shortLabel": "Type 093", - "range": "", - "filename": "", - "enabled": true, - "liveries": { - "periscope_state_1": { - "name": "Periscope State 1", - "countries": "All" - } - } - }, - "USS_Arleigh_Burke_IIa": { - "name": "USS_Arleigh_Burke_IIa", - "coalition": "blue", - "type": "Destroyer", - "era": "Late Cold War", - "label": "DDG Arleigh Burke lla", - "shortLabel": "DDG Arleigh Burke", - "range": "Medium", - "filename": "", - "enabled": true, - "liveries": { - "ddg-107_uss_gravely": { - "name": "DDG-107 USS Gravely", - "countries": [ - "USA" - ] - }, - "ddg-112_uss_michael_murphy": { - "name": "DDG-112 USS Michael Murphy", - "countries": [ - "USA" - ] - }, - "ddg-101_uss_gridley": { - "name": "DDG-101 USS Gridley", - "countries": [ - "USA" - ] - }, - "ddg-106_uss_stockdale": { - "name": "DDG-106 USS Stockdale", - "countries": [ - "USA" - ] - }, - "ddg-115_uss_rafael_peralta": { - "name": "DDG-115 USS Rafael Peralta", - "countries": [ - "USA" - ] - }, - "ddg-114_uss_ralph_johnson": { - "name": "DDG-114 USS Ralph Johnson", - "countries": [ - "USA" - ] - }, - "ddg-116_uss_thomas_hudner": { - "name": "DDG-116 USS Thomas Hudner", - "countries": [ - "USA" - ] - }, - "ddg-113_uss_john_finn": { - "name": "DDG-113 USS John Finn", - "countries": [ - "USA" - ] - }, - "ddg-108_uss_wayne_e.meyer": { - "name": "DDG-108 USS Wayne E. Meyer", - "countries": [ - "USA" - ] - }, - "ddg-110_uss_william_p.lawrence": { - "name": "DDG-110 USS William P. Lawrence", - "countries": [ - "USA" - ] - }, - "ddg-103_uss_truxtun": { - "name": "DDG-103 USS Truxtun", - "countries": [ - "USA" - ] - }, - "ddg-109_uss_jason_dunham": { - "name": "DDG-109 USS Jason Dunham", - "countries": [ - "USA" - ] - }, - "ddg-105_uss_dewey": { - "name": "DDG-105 USS Dewey", - "countries": [ - "USA" - ] - }, - "ddg-104_uss_sterett": { - "name": "DDG-104 USS Sterett", - "countries": [ - "USA" - ] - }, - "ddg-102_uss_sampson": { - "name": "DDG-102 USS Sampson", - "countries": [ - "USA" - ] - }, - "ddg-111_uss_spruance": { - "name": "DDG-111 USS Spruance", - "countries": [ - "USA" - ] - } - } - }, - "ara_vdm": { - "name": "ara_vdm", - "coalition": "", - "type": "Aircraft Carrier", - "era": "Mid Cold War", - "label": "ARA Vienticinco de Mayo", - "shortLabel": "ARA Vienticinco de Mayo", - "range": "", - "filename": "", - "enabled": true - }, - "hms_invincible": { - "name": "hms_invincible", - "coalition": "blue", - "type": "Aircraft Carrier", - "era": "Mid Cold War", - "label": "HMS Invincible (R05)", - "shortLabel": "HMS Invincible", - "range": "", - "filename": "", - "enabled": true - }, - "leander-gun-achilles": { - "name": "leander-gun-achilles", - "coalition": "blue", - "type": "Frigate", - "era": "Mid Cold War", - "label": "HMS Achilles (F12)", - "shortLabel": "HMS Achilles", - "range": "", - "filename": "", - "enabled": true - }, - "leander-gun-andromeda": { - "name": "leander-gun-andromeda", - "coalition": "blue", - "type": "Frigate", - "era": "Mid Cold War", - "label": "HMS Andromeda (F57)", - "shortLabel": "HMS Andromeda", - "range": "", - "filename": "", - "enabled": true - }, - "leander-gun-ariadne": { - "name": "leander-gun-ariadne", - "coalition": "blue", - "type": "Frigate", - "era": "Mid Cold War", - "label": "HMS Ariadne (F72)", - "shortLabel": "HMS Ariadne", - "range": "", - "filename": "", - "enabled": true - }, - "leander-gun-condell": { - "name": "leander-gun-condell", - "coalition": "", - "type": "Frigate", - "era": "Mid Cold War", - "label": "Almirante Condell PFG-06", - "shortLabel": "Almirante Condell", - "range": "", - "filename": "", - "enabled": true - }, - "leander-gun-lynch": { - "name": "leander-gun-lynch", - "coalition": "", - "type": "Frigate", - "era": "Mid Cold War", - "label": "CNS Almirante Lynch (PFG-07)", - "shortLabel": "CNS Almirante Lynch", - "range": "", - "filename": "", - "enabled": true - }, - "santafe": { - "name": "santafe", - "coalition": "", - "type": "Submarine", - "era": "Early Cold War", - "label": "ARA Santa Fe S-21", - "shortLabel": "ARA Santa", - "range": "", - "filename": "", - "enabled": true - }, - "speedboat": { - "name": "speedboat", - "coalition": "", - "era": "", - "label": "Boat Armed Hi-speed", - "shortLabel": "Boat Armed Hi-speed", - "type": "Speedboat", - "enabled": true, - "liveries": {} - }, - "VINSON": { - "name": "VINSON", - "coalition": "", - "era": "", - "label": "CVN-70 Carl Vinson", - "shortLabel": "CVN-70 Carl Vinson", - "type": "Aircraft Carrier", - "enabled": true, - "liveries": {} - }, - "PERRY": { - "name": "perry", - "coalition": "blue", - "type": "Frigate", - "era": "Mid Cold War", - "label": "Oliver H. Perry", - "shortLabel": "Oliver H. Perry", - "range": "Medium", - "filename": "", - "enabled": true, - "liveries": { - "gary": { - "name": "USS Gary FFG-51", - "countries": "All" - }, - "carr": { - "name": "USS Carr FFG-52", - "countries": "All" - }, - "reubenjames": { - "name": "USS Reuben James FFG-57", - "countries": "All" - }, - "hawes": { - "name": "USS Hawes FFG-53", - "countries": "All" - }, - "ford": { - "name": "USS Ford FFG-54", - "countries": "All" - }, - "elrod": { - "name": "USS Elrod FFG-55", - "countries": "All" - }, - "vandergrift": { - "name": "USS Vandergrift FFG-48", - "countries": "All" - }, - "rentz": { - "name": "USS Rentz FFG-46", - "countries": "All" - }, - "nicholas": { - "name": "USS Nicholas FFG-47", - "countries": "All" - }, - "kauffman": { - "name": "USS Kauffman FFG-59", - "countries": "All" - } - } - }, - "ALBATROS": { - "name": "albatros", - "coalition": "red", - "type": "Frigade", - "era": "Early Cold War", - "label": "Albatros (Grisha-5)", - "shortLabel": "Albatros", - "range": "", - "filename": "", - "enabled": true, - "liveries": { - "141": { - "name": "141", - "countries": "All" - }, - "142": { - "name": "142", - "countries": "All" - }, - "143": { - "name": "143", - "countries": "All" - }, - "144": { - "name": "144", - "countries": "All" - }, - "145": { - "name": "145", - "countries": "All" - }, - "146": { - "name": "146", - "countries": "All" - }, - "147": { - "name": "147", - "countries": "All" - }, - "148": { - "name": "148", - "countries": "All" - }, - "149": { - "name": "149", - "countries": "All" - } - } - }, - "KUZNECOW": { - "name": "kuznecow", - "coalition": "red", - "type": "Aircraft Carrier", - "era": "Late Cold War", - "label": "Admiral Kuznetsov", - "shortLabel": "Admiral Kuznetsov", - "range": "Medium", - "filename": "", - "enabled": true - }, - "MOLNIYA": { - "name": "molniya", - "coalition": "", - "type": "Corvette", - "era": "Late Cold War", - "label": "Molniya (Tarantul-3)", - "shortLabel": "Molniya", - "range": "Short", - "filename": "", - "enabled": true, - "liveries": { - "952": { - "name": "952", - "countries": "All" - }, - "953": { - "name": "953", - "countries": "All" - }, - "954": { - "name": "954", - "countries": "All" - } - } - }, - "MOSCOW": { - "name": "moscow", - "coalition": "red", - "type": "Cruiser", - "era": "Late Cold War", - "label": "Moscow", - "shortLabel": "Moscow", - "range": "Medium", - "filename": "", - "enabled": true, - "liveries": { - "default": { - "name": "default", - "countries": "All" - }, - "cow1": { - "name": "cow1", - "countries": "All" - }, - "cow3": { - "name": "cow3", - "countries": "All" - }, - "cow2": { - "name": "cow2", - "countries": "All" - } - } - }, - "NEUSTRASH": { - "name": "neustrash", - "coalition": "red", - "type": "Frigate", - "era": "Late Cold War", - "label": "Neustrashimy", - "shortLabel": "Neustrashimy", - "range": "Short", - "filename": "", - "enabled": true - }, - "PIOTR": { - "name": "PIOTR", - "coalition": "", - "era": "", - "label": "Battlecruiser 1144.2 Pyotr Velikiy", - "shortLabel": "Battlecruiser 1144.2 Pyotr Velikiy", - "type": "Cruiser", - "enabled": true, - "liveries": {} - }, - "REZKY": { - "name": "Rezky (Krivak-2)", - "coalition": "red", - "type": "Frigate", - "era": "Early Cold War", - "label": "Rezky (Krivak-2)", - "shortLabel": "Rezky", - "range": "Short", - "filename": "", - "enabled": true - }, - "ELNYA": { - "name": "elnya", - "coalition": "red", - "type": "Tanker", - "era": "Late Cold War", - "label": "Elnya tanker", - "shortLabel": "Elnya tanker", - "range": "", - "filename": "", - "enabled": true, - "liveries": { - "952": { - "name": "952", - "countries": "All" - }, - "953": { - "name": "953", - "countries": "All" - }, - "954": { - "name": "954", - "countries": "All" - } - } - }, - "Dry-cargo ship-2": { - "name": "Dry-cargo ship-2", - "coalition": "", - "era": "", - "label": "Cargo Ivanov", - "shortLabel": "Cargo Ivanov", - "type": "Cargo", - "enabled": true, - "liveries": {} - }, - "Dry-cargo ship-1": { - "name": "Dry-cargo ship-1", - "coalition": "", - "era": "", - "label": "Bulker Yakushev", - "shortLabel": "Bulker Yakushev", - "type": "Cargo", - "enabled": true, - "liveries": {} - }, - "ZWEZDNY": { - "name": "zwezdny", - "coalition": "", - "type": "Civilian Boat", - "era": "Modern", - "label": "Zwezdny", - "shortLabel": "Zwezdny", - "range": "", - "filename": "", - "enabled": true - }, - "KILO": { - "name": "kilo", - "coalition": "red", - "type": "Submarine", - "era": "Late Cold War", - "label": "Project 636 Varshavyanka Basic", - "shortLabel": "Varshavyanka Basic", - "range": "Medium", - "filename": "", - "enabled": true - }, - "IMPROVED_KILO": { - "name": "IMPROVED_KILO", - "coalition": "", - "era": "", - "label": "SSK 636 Improved Kilo", - "shortLabel": "SSK 636 Improved Kilo", - "type": "Submarine", - "enabled": true, - "liveries": {} - }, - "SOM": { - "name": "SOM", - "coalition": "", - "era": "", - "label": "SSK 641B Tango", - "shortLabel": "SSK 641B Tango", - "type": "SOM", - "enabled": true, - "liveries": {} - }, - "Forrestal": { - "name": "Forrestal", - "coalition": "", - "era": "", - "label": "CV-59 Forrestal", - "shortLabel": "CV-59 Forrestal", - "type": "Forrestal", - "enabled": true, - "liveries": {} - }, - "LST_Mk2": { - "name": "LST_Mk2", - "coalition": "", - "era": "", - "label": "LST Mk.II", - "shortLabel": "LST Mk.II", - "type": "LST_Mk2", - "enabled": true, - "liveries": {} - }, - "USS_Samuel_Chase": { - "name": "USS_Samuel_Chase", - "coalition": "", - "era": "", - "label": "LS Samuel Chase", - "shortLabel": "LS Samuel Chase", - "type": "USS_Samuel_Chase", - "enabled": true, - "liveries": {} - }, - "Higgins_boat": { - "name": "Higgins_boat", - "coalition": "", - "era": "", - "label": "Boat LCVP Higgins", - "shortLabel": "Boat LCVP Higgins", - "type": "Higgins_boat", - "enabled": true, - "liveries": {} - }, - "Uboat_VIIC": { - "name": "Uboat_VIIC", - "coalition": "", - "era": "", - "label": "U-boat VIIC U-flak", - "shortLabel": "U-boat VIIC U-flak", - "type": "Uboat_VIIC", - "enabled": true, - "liveries": {} - }, - "Schnellboot_type_S130": { - "name": "Schnellboot_type_S130", - "coalition": "", - "era": "", - "label": "Boat Schnellboot type S130", - "shortLabel": "Boat Schnellboot type S130", - "type": "Schnellboot_type_S130", - "enabled": true, - "liveries": {} - } + "BDK-775": { + "name": "BDK-775", + "coalition": "blue", + "type": "Landing Craft", + "era": "Mid Cold War", + "label": "LS Ropucha", + "shortLabel": "LS Ropucha", + "range": "", + "filename": "", + "enabled": true, + "acquisitionRange": 25000, + "engagementRange": 6000 + }, + "CVN_71": { + "name": "CVN_71", + "coalition": "blue", + "type": "Super Aircraft Carrier", + "era": "Late Cold War", + "label": "CVN-71 Theodore Roosevelt", + "shortLabel": "CVN-71", + "range": "Short", + "filename": "", + "enabled": true, + "acquisitionRange": 50000, + "engagementRange": 25000 + }, + "CVN_72": { + "name": "CVN_72", + "coalition": "blue", + "type": "Super Aircraft Carrier", + "era": "Late Cold War", + "label": "CVN-72 Abraham Lincoln", + "shortLabel": "CVN-72", + "range": "Short", + "filename": "", + "enabled": true, + "acquisitionRange": 50000, + "engagementRange": 25000 + }, + "CVN_73": { + "name": "CVN_73", + "coalition": "blue", + "type": "Super Aircraft Carrier", + "era": "Late Cold War", + "label": "CVN-73 George Washington", + "shortLabel": "CVN-73", + "range": "Medium", + "filename": "", + "enabled": true, + "acquisitionRange": 50000, + "engagementRange": 25000 + }, + "CVN_75": { + "name": "CVN_75", + "coalition": "blue", + "type": "Aircraft Carrier", + "era": "Late Cold War", + "label": "CVN-75 Harry S. Truman", + "shortLabel": "CVN-75", + "range": "Medium", + "filename": "", + "enabled": true, + "liveries": { + "autumn": { + "name": "Autumn", + "countries": "All" + }, + "winter": { + "name": "Winter", + "countries": "All" + }, + "summer": { + "name": "Summer", + "countries": "All" + }, + "spring": { + "name": "Spring", + "countries": "All" + }, + "desert": { + "name": "Desert", + "countries": "All" + } + }, + "acquisitionRange": 50000, + "engagementRange": 25000 + }, + "CV_1143_5": { + "name": "CV_1143_5", + "coalition": "red", + "type": "Aircraft Carrier", + "era": "Modern", + "label": "CV Admiral Kuznetsov(2017)", + "shortLabel": "Admiral Kuznetsov(2017)", + "range": "Medium", + "filename": "", + "enabled": true, + "acquisitionRange": 25000, + "engagementRange": 12000 + }, + "CastleClass_01": { + "name": "CastleClass_01", + "coalition": "blue", + "type": "Patrol", + "era": "Mid Cold War", + "label": "HMS Leeds Castle (P-258)", + "shortLabel": "HMS Leeds Castle (P-258)", + "range": "", + "filename": "", + "enabled": true, + "liveries": { + "dumbarton": { + "name": "Dumbarton", + "countries": "All" + } + }, + "acquisitionRange": 25000, + "engagementRange": 3000 + }, + "HandyWind": { + "name": "HandyWind", + "coalition": "blue", + "type": "Cargoship", + "era": "Late Cold War", + "label": "Bulker Handy Wind", + "shortLabel": "Bulker Handy Wind", + "range": "", + "filename": "", + "enabled": true, + "liveries": { + "noname": { + "name": "NoName", + "countries": "All" + }, + "handy_wind": { + "name": "Handy Wind", + "countries": "All" + }, + "baltic_cove": { + "name": "Baltic Cove", + "countries": "All" + }, + "baltic_wind": { + "name": "Baltic Wind", + "countries": "All" + } + }, + "acquisitionRange": 0, + "engagementRange": 0 + }, + "HarborTug": { + "name": "HarborTug", + "coalition": "", + "type": "Tug", + "era": "Mid Cold War", + "label": "Harbor Tug", + "shortLabel": "Harbor Tug", + "range": "", + "filename": "", + "enabled": true, + "liveries": { + "harbor tug blue": { + "name": "Harbor Tug Blue", + "countries": "All" + }, + "harbor tug red": { + "name": "Harbor Tug Red", + "countries": "All" + }, + "harbor tug black": { + "name": "Harbor Tug Black", + "countries": "All" + }, + "harbor tug green": { + "name": "Harbor Tug Green", + "countries": "All" + } + }, + "acquisitionRange": 0, + "engagementRange": 0 + }, + "LHA_Tarawa": { + "name": "LHA_Tarawa", + "coalition": "blue", + "type": "Aircraft Carrier", + "era": "Mid Cold War", + "label": "LHA-1 Tarawa", + "shortLabel": "LHA-1 Tarawa", + "range": "Short", + "filename": "", + "enabled": true, + "acquisitionRange": 150000, + "engagementRange": 20000 + }, + "La_Combattante_II": { + "name": "La_Combattante_II", + "coalition": "blue", + "type": "Fast Attack Craft", + "era": "Mid Cold War", + "label": "FAC La Combattante lla", + "shortLabel": "FAC La Combattante", + "range": "", + "filename": "", + "enabled": true, + "liveries": { + "irn_217": { + "name": "217", + "countries": [ + "IRN" + ] + }, + "syr_35": { + "name": "35", + "countries": [ + "SYR" + ] + }, + "lib_521": { + "name": "521", + "countries": [ + "LIB" + ] + }, + "grg_dioskuria": { + "name": "Dioskuria", + "countries": [ + "GRG" + ] + }, + "grc_p77_plotarchis sakipis": { + "name": "Plotarchis_Sakipis", + "countries": [ + "GRC" + ] + }, + "grc_p72_ypoploiarchos votsis": { + "name": "Ypoploiarchos_Votsis", + "countries": [ + "GRC" + ] + }, + "egp_601": { + "name": "601", + "countries": [ + "EGP" + ] + }, + "irn_215": { + "name": "215", + "countries": [ + "IRN" + ] + }, + "ger_s50_panther": { + "name": "S50_Panther", + "countries": [ + "GER" + ] + }, + "lib_520": { + "name": "520", + "countries": [ + "LIB" + ] + }, + "grc_p73_antiploiarchos pezopoulos": { + "name": "Antiploiarchos_Pezopoulos", + "countries": [ + "GRC" + ] + }, + "ger_s54_elster": { + "name": "S54_Elster", + "countries": [ + "GER" + ] + }, + "ger_s58_pinguin": { + "name": "S58_Pinguin", + "countries": [ + "GER" + ] + }, + "grc_p74_plotarchis vlachavas": { + "name": "Plotarchis_Vlachavas", + "countries": [ + "GRC" + ] + }, + "ger_s52_storch": { + "name": "S52_Storch", + "countries": [ + "GER" + ] + }, + "ger_s57_weihe": { + "name": "S57_Weihe", + "countries": [ + "GER" + ] + }, + "egp_604": { + "name": "604", + "countries": [ + "EGP" + ] + }, + "ger_s53_pelikan": { + "name": "S53_Pelikan", + "countries": [ + "GER" + ] + }, + "lib_522": { + "name": "522", + "countries": [ + "LIB" + ] + }, + "ger_s56_dommel": { + "name": "S56_Dommel", + "countries": [ + "GER" + ] + }, + "irn_216": { + "name": "216", + "countries": [ + "IRN" + ] + }, + "ger_s59_reiher": { + "name": "S59_Reiher", + "countries": [ + "GER" + ] + }, + "lib_519": { + "name": "519", + "countries": [ + "LIB" + ] + }, + "syr_34": { + "name": "34", + "countries": [ + "SYR" + ] + }, + "irn_218": { + "name": "218", + "countries": [ + "IRN" + ] + }, + "grc_p76_ypoploiarchos tournas": { + "name": "Ypoploiarchos_Tournas", + "countries": [ + "GRC" + ] + }, + "grc_p75_plotarchis maridakis": { + "name": "Plotarchis_Maridakis", + "countries": [ + "GRC" + ] + }, + "ger_s55_alk": { + "name": "S55_Alk", + "countries": [ + "GER" + ] + }, + "grg_305": { + "name": "305", + "countries": [ + "GRG" + ] + }, + "egp_602": { + "name": "602", + "countries": [ + "EGP" + ] + }, + "irn_212": { + "name": "212", + "countries": [ + "IRN" + ] + }, + "grg_304": { + "name": "304", + "countries": [ + "GRG" + ] + }, + "irn_214": { + "name": "214", + "countries": [ + "IRN" + ] + }, + "irn_219": { + "name": "219", + "countries": [ + "IRN" + ] + }, + "syr_36": { + "name": "36", + "countries": [ + "SYR" + ] + }, + "lib_518": { + "name": "518", + "countries": [ + "LIB" + ] + }, + "egp_605": { + "name": "605", + "countries": [ + "EGP" + ] + }, + "ger_s51_haher": { + "name": "S51_Haher", + "countries": [ + "GER" + ] + }, + "egp_603": { + "name": "603", + "countries": [ + "EGP" + ] + } + }, + "acquisitionRange": 19000, + "engagementRange": 4000 + }, + "Seawise_Giant": { + "name": "Seawise_Giant", + "coalition": "blue", + "type": "Tanker", + "era": "Late Cold War", + "label": "Tanker Seawise Giant", + "shortLabel": "Seawise Giant", + "range": "", + "filename": "", + "enabled": true, + "acquisitionRange": 0, + "engagementRange": 0 + }, + "Ship_Tilde_Supply": { + "name": "Ship_Tilde_Supply", + "coalition": "blue", + "type": "Transport", + "era": "Late Cold War", + "label": "Supply Ship MV Tilde", + "shortLabel": "Supply Ship Tilde", + "range": "", + "filename": "", + "enabled": true, + "acquisitionRange": 0, + "engagementRange": 0 + }, + "Stennis": { + "name": "Stennis", + "coalition": "blue", + "type": "Aircraft Carrier", + "era": "Late Cold War", + "label": "CVN-74 John C. Stennis", + "shortLabel": "CVN-74", + "range": "Medium", + "filename": "", + "enabled": true, + "acquisitionRange": 50000, + "engagementRange": 25000 + }, + "TICONDEROG": { + "name": "TICONDEROG", + "coalition": "blue", + "type": "Cruiser", + "era": "Late Cold War", + "label": "Ticonderoga", + "shortLabel": "Ticonderoga", + "range": "Medium", + "filename": "", + "enabled": true, + "liveries": { + "vellagulf": { + "name": "USS Vella Gulf CG-72", + "countries": [ + "USA" + ] + }, + "huecity": { + "name": "USS Hue City CG-66", + "countries": [ + "USA" + ] + }, + "capestgeorge": { + "name": "USS Cape St. George CG-71", + "countries": [ + "USA" + ] + }, + "lakeerie": { + "name": "USS Lake Erie CG-70", + "countries": [ + "USA" + ] + }, + "chosin": { + "name": "USS Chosin CG-65", + "countries": [ + "USA" + ] + }, + "normandy": { + "name": "USS Normandy CG-60", + "countries": [ + "USA" + ] + }, + "portroyal": { + "name": "USS Port Royal CG-73", + "countries": [ + "USA" + ] + }, + "shiloh": { + "name": "USS Shiloh CG-67", + "countries": [ + "USA" + ] + }, + "viksburg": { + "name": "USS Viksburg CG-69", + "countries": [ + "USA" + ] + }, + "anzio": { + "name": "USS Anzio CG-68", + "countries": [ + "USA" + ] + } + }, + "acquisitionRange": 150000, + "engagementRange": 100000 + }, + "Type_052B": { + "name": "Type_052B", + "coalition": "red", + "type": "Destroyer", + "era": "Modern", + "label": "052B DDG-168 Guangzhou", + "shortLabel": "Type 52B", + "range": "Short", + "filename": "", + "enabled": true, + "liveries": { + "general": { + "name": "General", + "countries": "All" + }, + "ddg-169": { + "name": "DDG-169 Wuhan", + "countries": [ + "CHN" + ] + }, + "ddg-168": { + "name": "DDG-168 Guangzhou", + "countries": [ + "CHN" + ] + } + }, + "acquisitionRange": 100000, + "engagementRange": 30000 + }, + "Type_052C": { + "name": "Type_052C", + "coalition": "red", + "type": "Destroyer", + "era": "Modern", + "label": "052C DDG-171 Haikou", + "shortLabel": "Type 52C", + "range": "Short", + "filename": "", + "enabled": true, + "liveries": { + "ddg-171": { + "name": "DDG-171 Haikou", + "countries": [ + "CHN" + ] + }, + "general": { + "name": "General", + "countries": "All" + }, + "ddg-151": { + "name": "DDG-151 Zhengzhou", + "countries": [ + "CHN" + ] + }, + "ddg-170": { + "name": "DDG-170 Lanzhou", + "countries": [ + "CHN" + ] + }, + "default": { + "name": "DDG-150 Changchun", + "countries": [ + "CHN" + ] + }, + "ddg-152": { + "name": "DDG-152 Jinan", + "countries": [ + "CHN" + ] + }, + "ddg-153": { + "name": "DDG-153 Xi'an", + "countries": [ + "CHN" + ] + } + }, + "acquisitionRange": 260000, + "engagementRange": 100000 + }, + "Type_054A": { + "name": "", + "coalition": "red", + "type": "Frigate", + "era": "Modern", + "label": "054A FFG-538 Yantai", + "shortLabel": "Type 54A", + "range": "Medium", + "filename": "", + "enabled": true, + "liveries": { + "ffg-573": { + "name": "FFG-573 Liuzhou", + "countries": [ + "CHN" + ] + }, + "ffg-578": { + "name": "FFG-578 Yangzhou", + "countries": [ + "CHN" + ] + }, + "ffg-531": { + "name": "FFG-531 Xiangtan", + "countries": [ + "CHN" + ] + }, + "ffg-550": { + "name": "FFG-550 Weifang", + "countries": [ + "CHN" + ] + }, + "ffg-536": { + "name": "FFG-536 Xuchang", + "countries": [ + "CHN" + ] + }, + "ffg-549": { + "name": "FFG-549 Changzhou", + "countries": [ + "CHN" + ] + }, + "ffg-574": { + "name": "FFG-574 Sanya", + "countries": [ + "CHN" + ] + }, + "default": { + "name": "FFG-515 Binzhou", + "countries": [ + "CHN" + ] + }, + "ffg-576": { + "name": "FFG-576 Daqing", + "countries": [ + "CHN" + ] + }, + "ffg-599": { + "name": "FFG-599 Anyang", + "countries": [ + "CHN" + ] + }, + "ffg-547": { + "name": "FFG-547 Linyi", + "countries": [ + "CHN" + ] + }, + "ffg-571": { + "name": "FFG-571 Yuncheng", + "countries": [ + "CHN" + ] + }, + "ffg-546": { + "name": "FFG-546 Yancheng", + "countries": [ + "CHN" + ] + }, + "ffg-579": { + "name": "FFG-579 Handan", + "countries": [ + "CHN" + ] + }, + "ffg-532": { + "name": "FFG-532 Jingzhou", + "countries": [ + "CHN" + ] + }, + "ffg-569": { + "name": "FFG-569 Yulin", + "countries": [ + "CHN" + ] + }, + "ffg-538": { + "name": "FFG-538 Yantai", + "countries": [ + "CHN" + ] + }, + "ffg-577": { + "name": "FFG-577 Huanggang", + "countries": [ + "CHN" + ] + }, + "general": { + "name": "General", + "countries": "All" + }, + "ffg-572": { + "name": "FFG-572 Hengshui", + "countries": [ + "CHN" + ] + }, + "ffg-539": { + "name": "FFG-539 Wuhu", + "countries": [ + "CHN" + ] + }, + "ffg-548": { + "name": "FFG-548 Yiyang", + "countries": [ + "CHN" + ] + }, + "ffg-575": { + "name": "FFG-575 Yueyang", + "countries": [ + "CHN" + ] + }, + "ffg-598": { + "name": "FFG-598 Rizhao", + "countries": [ + "CHN" + ] + }, + "ffg-500": { + "name": "FFG-500 Xianning", + "countries": [ + "CHN" + ] + } + }, + "acquisitionRange": 160000, + "engagementRange": 45000 + }, + "Type_071": { + "name": "Type_071", + "coalition": "red", + "type": "Transport", + "era": "Modern", + "label": "Type 071", + "shortLabel": "Type 071", + "range": "", + "filename": "", + "enabled": true, + "liveries": { + "lpd-978": { + "name": "978 Wuzhi Shan", + "countries": [ + "CHN" + ] + }, + "lpd-989": { + "name": "989 Changbai Shan", + "countries": [ + "CHN" + ] + }, + "default": { + "name": "998 Kunlun Shan", + "countries": [ + "CHN" + ] + }, + "lpd-999": { + "name": "999 Jinggang Shan", + "countries": [ + "CHN" + ] + }, + "lpd-988": { + "name": "988 Yimeng Shan", + "countries": [ + "CHN" + ] + }, + "lpd-980": { + "name": "980 Longhu Shan", + "countries": [ + "CHN" + ] + } + }, + "acquisitionRange": 300000, + "engagementRange": 150000 + }, + "Type_093": { + "name": "Type_093", + "coalition": "red", + "type": "Submarine", + "era": "Modern", + "label": "Type 093", + "shortLabel": "Type 093", + "range": "", + "filename": "", + "enabled": true, + "liveries": { + "periscope_state_1": { + "name": "Periscope State 1", + "countries": "All" + } + }, + "acquisitionRange": 40000, + "engagementRange": 40000 + }, + "USS_Arleigh_Burke_IIa": { + "name": "USS_Arleigh_Burke_IIa", + "coalition": "blue", + "type": "Destroyer", + "era": "Late Cold War", + "label": "DDG Arleigh Burke lla", + "shortLabel": "DDG Arleigh Burke", + "range": "Medium", + "filename": "", + "enabled": true, + "liveries": { + "ddg-107_uss_gravely": { + "name": "DDG-107 USS Gravely", + "countries": [ + "USA" + ] + }, + "ddg-112_uss_michael_murphy": { + "name": "DDG-112 USS Michael Murphy", + "countries": [ + "USA" + ] + }, + "ddg-101_uss_gridley": { + "name": "DDG-101 USS Gridley", + "countries": [ + "USA" + ] + }, + "ddg-106_uss_stockdale": { + "name": "DDG-106 USS Stockdale", + "countries": [ + "USA" + ] + }, + "ddg-115_uss_rafael_peralta": { + "name": "DDG-115 USS Rafael Peralta", + "countries": [ + "USA" + ] + }, + "ddg-114_uss_ralph_johnson": { + "name": "DDG-114 USS Ralph Johnson", + "countries": [ + "USA" + ] + }, + "ddg-116_uss_thomas_hudner": { + "name": "DDG-116 USS Thomas Hudner", + "countries": [ + "USA" + ] + }, + "ddg-113_uss_john_finn": { + "name": "DDG-113 USS John Finn", + "countries": [ + "USA" + ] + }, + "ddg-108_uss_wayne_e.meyer": { + "name": "DDG-108 USS Wayne E. Meyer", + "countries": [ + "USA" + ] + }, + "ddg-110_uss_william_p.lawrence": { + "name": "DDG-110 USS William P. Lawrence", + "countries": [ + "USA" + ] + }, + "ddg-103_uss_truxtun": { + "name": "DDG-103 USS Truxtun", + "countries": [ + "USA" + ] + }, + "ddg-109_uss_jason_dunham": { + "name": "DDG-109 USS Jason Dunham", + "countries": [ + "USA" + ] + }, + "ddg-105_uss_dewey": { + "name": "DDG-105 USS Dewey", + "countries": [ + "USA" + ] + }, + "ddg-104_uss_sterett": { + "name": "DDG-104 USS Sterett", + "countries": [ + "USA" + ] + }, + "ddg-102_uss_sampson": { + "name": "DDG-102 USS Sampson", + "countries": [ + "USA" + ] + }, + "ddg-111_uss_spruance": { + "name": "DDG-111 USS Spruance", + "countries": [ + "USA" + ] + } + }, + "acquisitionRange": 150000, + "engagementRange": 100000 + }, + "ara_vdm": { + "name": "ara_vdm", + "coalition": "", + "type": "Aircraft Carrier", + "era": "Mid Cold War", + "label": "ARA Vienticinco de Mayo", + "shortLabel": "ARA Vienticinco de Mayo", + "range": "", + "filename": "", + "enabled": true, + "acquisitionRange": 18000, + "engagementRange": 5000 + }, + "hms_invincible": { + "name": "hms_invincible", + "coalition": "blue", + "type": "Aircraft Carrier", + "era": "Mid Cold War", + "label": "HMS Invincible (R05)", + "shortLabel": "HMS Invincible", + "range": "", + "filename": "", + "enabled": true, + "acquisitionRange": 100000, + "engagementRange": 74000 + }, + "leander-gun-achilles": { + "name": "leander-gun-achilles", + "coalition": "blue", + "type": "Frigate", + "era": "Mid Cold War", + "label": "HMS Achilles (F12)", + "shortLabel": "HMS Achilles", + "range": "", + "filename": "", + "enabled": true, + "acquisitionRange": 180000, + "engagementRange": 8000 + }, + "leander-gun-andromeda": { + "name": "leander-gun-andromeda", + "coalition": "blue", + "type": "Frigate", + "era": "Mid Cold War", + "label": "HMS Andromeda (F57)", + "shortLabel": "HMS Andromeda", + "range": "", + "filename": "", + "enabled": true, + "acquisitionRange": 180000, + "engagementRange": 140000 + }, + "leander-gun-ariadne": { + "name": "leander-gun-ariadne", + "coalition": "blue", + "type": "Frigate", + "era": "Mid Cold War", + "label": "HMS Ariadne (F72)", + "shortLabel": "HMS Ariadne", + "range": "", + "filename": "", + "enabled": true, + "acquisitionRange": 150000, + "engagementRange": 100000 + }, + "leander-gun-condell": { + "name": "leander-gun-condell", + "coalition": "", + "type": "Frigate", + "era": "Mid Cold War", + "label": "Almirante Condell PFG-06", + "shortLabel": "Almirante Condell", + "range": "", + "filename": "", + "enabled": true, + "acquisitionRange": 150000, + "engagementRange": 100000 + }, + "leander-gun-lynch": { + "name": "leander-gun-lynch", + "coalition": "", + "type": "Frigate", + "era": "Mid Cold War", + "label": "CNS Almirante Lynch (PFG-07)", + "shortLabel": "CNS Almirante Lynch", + "range": "", + "filename": "", + "enabled": true, + "acquisitionRange": 180000, + "engagementRange": 140000 + }, + "santafe": { + "name": "santafe", + "coalition": "", + "type": "Submarine", + "era": "Early Cold War", + "label": "ARA Santa Fe S-21", + "shortLabel": "ARA Santa", + "range": "", + "filename": "", + "enabled": true, + "acquisitionRange": 0, + "engagementRange": 0 + }, + "speedboat": { + "name": "speedboat", + "coalition": "", + "era": "", + "label": "Boat Armed Hi-speed", + "shortLabel": "Boat Armed Hi-speed", + "type": "Speedboat", + "enabled": true, + "liveries": {}, + "acquisitionRange": 5000, + "engagementRange": 1000 + }, + "VINSON": { + "name": "VINSON", + "coalition": "", + "era": "", + "label": "CVN-70 Carl Vinson", + "shortLabel": "CVN-70 Carl Vinson", + "type": "Aircraft Carrier", + "enabled": true, + "liveries": {}, + "acquisitionRange": 30000, + "engagementRange": 15000 + }, + "PERRY": { + "name": "perry", + "coalition": "blue", + "type": "Frigate", + "era": "Mid Cold War", + "label": "Oliver H. Perry", + "shortLabel": "Oliver H. Perry", + "range": "Medium", + "filename": "", + "enabled": true, + "liveries": { + "gary": { + "name": "USS Gary FFG-51", + "countries": "All" + }, + "carr": { + "name": "USS Carr FFG-52", + "countries": "All" + }, + "reubenjames": { + "name": "USS Reuben James FFG-57", + "countries": "All" + }, + "hawes": { + "name": "USS Hawes FFG-53", + "countries": "All" + }, + "ford": { + "name": "USS Ford FFG-54", + "countries": "All" + }, + "elrod": { + "name": "USS Elrod FFG-55", + "countries": "All" + }, + "vandergrift": { + "name": "USS Vandergrift FFG-48", + "countries": "All" + }, + "rentz": { + "name": "USS Rentz FFG-46", + "countries": "All" + }, + "nicholas": { + "name": "USS Nicholas FFG-47", + "countries": "All" + }, + "kauffman": { + "name": "USS Kauffman FFG-59", + "countries": "All" + } + }, + "acquisitionRange": 150000, + "engagementRange": 100000 + }, + "ALBATROS": { + "name": "albatros", + "coalition": "red", + "type": "Frigade", + "era": "Early Cold War", + "label": "Albatros (Grisha-5)", + "shortLabel": "Albatros", + "range": "", + "filename": "", + "enabled": true, + "liveries": { + "141": { + "name": "141", + "countries": "All" + }, + "142": { + "name": "142", + "countries": "All" + }, + "143": { + "name": "143", + "countries": "All" + }, + "144": { + "name": "144", + "countries": "All" + }, + "145": { + "name": "145", + "countries": "All" + }, + "146": { + "name": "146", + "countries": "All" + }, + "147": { + "name": "147", + "countries": "All" + }, + "148": { + "name": "148", + "countries": "All" + }, + "149": { + "name": "149", + "countries": "All" + } + }, + "acquisitionRange": 30000, + "engagementRange": 16000 + }, + "KUZNECOW": { + "name": "kuznecow", + "coalition": "red", + "type": "Aircraft Carrier", + "era": "Late Cold War", + "label": "Admiral Kuznetsov", + "shortLabel": "Admiral Kuznetsov", + "range": "Medium", + "filename": "", + "enabled": true, + "acquisitionRange": 25000, + "engagementRange": 12000 + }, + "MOLNIYA": { + "name": "molniya", + "coalition": "", + "type": "Corvette", + "era": "Late Cold War", + "label": "Molniya (Tarantul-3)", + "shortLabel": "Molniya", + "range": "Short", + "filename": "", + "enabled": true, + "liveries": { + "952": { + "name": "952", + "countries": "All" + }, + "953": { + "name": "953", + "countries": "All" + }, + "954": { + "name": "954", + "countries": "All" + } + }, + "acquisitionRange": 21000, + "engagementRange": 2000 + }, + "MOSCOW": { + "name": "moscow", + "coalition": "red", + "type": "Cruiser", + "era": "Late Cold War", + "label": "Moscow", + "shortLabel": "Moscow", + "range": "Medium", + "filename": "", + "enabled": true, + "liveries": { + "default": { + "name": "default", + "countries": "All" + }, + "cow1": { + "name": "cow1", + "countries": "All" + }, + "cow3": { + "name": "cow3", + "countries": "All" + }, + "cow2": { + "name": "cow2", + "countries": "All" + } + }, + "acquisitionRange": 160000, + "engagementRange": 75000 + }, + "NEUSTRASH": { + "name": "neustrash", + "coalition": "red", + "type": "Frigate", + "era": "Late Cold War", + "label": "Neustrashimy", + "shortLabel": "Neustrashimy", + "range": "Short", + "filename": "", + "enabled": true, + "acquisitionRange": 27000, + "engagementRange": 12000 + }, + "PIOTR": { + "name": "PIOTR", + "coalition": "", + "era": "", + "label": "Battlecruiser 1144.2 Pyotr Velikiy", + "shortLabel": "Battlecruiser 1144.2 Pyotr Velikiy", + "type": "Cruiser", + "enabled": true, + "liveries": {}, + "acquisitionRange": 250000, + "engagementRange": 190000 + }, + "REZKY": { + "name": "Rezky (Krivak-2)", + "coalition": "red", + "type": "Frigate", + "era": "Early Cold War", + "label": "Rezky (Krivak-2)", + "shortLabel": "Rezky", + "range": "Short", + "filename": "", + "enabled": true, + "acquisitionRange": 30000, + "engagementRange": 16000 + }, + "ELNYA": { + "name": "elnya", + "coalition": "red", + "type": "Tanker", + "era": "Late Cold War", + "label": "Elnya tanker", + "shortLabel": "Elnya tanker", + "range": "", + "filename": "", + "enabled": true, + "liveries": { + "952": { + "name": "952", + "countries": "All" + }, + "953": { + "name": "953", + "countries": "All" + }, + "954": { + "name": "954", + "countries": "All" + } + }, + "acquisitionRange": 0, + "engagementRange": 0 + }, + "Dry-cargo ship-2": { + "name": "Dry-cargo ship-2", + "coalition": "", + "era": "", + "label": "Cargo Ivanov", + "shortLabel": "Cargo Ivanov", + "type": "Cargo", + "enabled": true, + "liveries": {}, + "acquisitionRange": 0, + "engagementRange": 0 + }, + "Dry-cargo ship-1": { + "name": "Dry-cargo ship-1", + "coalition": "", + "era": "", + "label": "Bulker Yakushev", + "shortLabel": "Bulker Yakushev", + "type": "Cargo", + "enabled": true, + "liveries": {}, + "acquisitionRange": 0, + "engagementRange": 0 + }, + "ZWEZDNY": { + "name": "zwezdny", + "coalition": "", + "type": "Civilian Boat", + "era": "Modern", + "label": "Zwezdny", + "shortLabel": "Zwezdny", + "range": "", + "filename": "", + "enabled": true, + "acquisitionRange": 0, + "engagementRange": 0 + }, + "KILO": { + "name": "kilo", + "coalition": "red", + "type": "Submarine", + "era": "Late Cold War", + "label": "Project 636 Varshavyanka Basic", + "shortLabel": "Varshavyanka Basic", + "range": "Medium", + "filename": "", + "enabled": true, + "acquisitionRange": 0, + "engagementRange": 0 + }, + "IMPROVED_KILO": { + "name": "IMPROVED_KILO", + "coalition": "", + "era": "", + "label": "SSK 636 Improved Kilo", + "shortLabel": "SSK 636 Improved Kilo", + "type": "Submarine", + "enabled": true, + "liveries": {}, + "acquisitionRange": 0, + "engagementRange": 0 + }, + "SOM": { + "name": "SOM", + "coalition": "", + "era": "", + "label": "SSK 641B Tango", + "shortLabel": "SSK 641B Tango", + "type": "SOM", + "enabled": true, + "liveries": {}, + "acquisitionRange": 0, + "engagementRange": 0 + }, + "Forrestal": { + "name": "Forrestal", + "coalition": "", + "era": "", + "label": "CV-59 Forrestal", + "shortLabel": "CV-59 Forrestal", + "type": "Forrestal", + "enabled": true, + "liveries": {}, + "acquisitionRange": 50000, + "engagementRange": 25000 + }, + "LST_Mk2": { + "name": "LST_Mk2", + "coalition": "", + "era": "", + "label": "LST Mk.II", + "shortLabel": "LST Mk.II", + "type": "LST_Mk2", + "enabled": true, + "liveries": {}, + "acquisitionRange": 0, + "engagementRange": 4000 + }, + "USS_Samuel_Chase": { + "name": "USS_Samuel_Chase", + "coalition": "", + "era": "", + "label": "LS Samuel Chase", + "shortLabel": "LS Samuel Chase", + "type": "USS_Samuel_Chase", + "enabled": true, + "liveries": {}, + "acquisitionRange": 0, + "engagementRange": 7000 + }, + "Higgins_boat": { + "name": "Higgins_boat", + "coalition": "", + "era": "", + "label": "Boat LCVP Higgins", + "shortLabel": "Boat LCVP Higgins", + "type": "Higgins_boat", + "enabled": true, + "liveries": {}, + "acquisitionRange": 3000, + "engagementRange": 1000 + }, + "Uboat_VIIC": { + "name": "Uboat_VIIC", + "coalition": "", + "era": "", + "label": "U-boat VIIC U-flak", + "shortLabel": "U-boat VIIC U-flak", + "type": "Uboat_VIIC", + "enabled": true, + "liveries": {}, + "acquisitionRange": 20000, + "engagementRange": 4000 + }, + "Schnellboot_type_S130": { + "name": "Schnellboot_type_S130", + "coalition": "", + "era": "", + "label": "Boat Schnellboot type S130", + "shortLabel": "Boat Schnellboot type S130", + "type": "Schnellboot_type_S130", + "enabled": true, + "liveries": {}, + "acquisitionRange": 10000, + "engagementRange": 4000 + } } \ No newline at end of file diff --git a/client/src/constants/constants.ts b/client/src/constants/constants.ts index 4d3006cc..62071065 100644 --- a/client/src/constants/constants.ts +++ b/client/src/constants/constants.ts @@ -144,19 +144,21 @@ export const mapLayers = { export const IDLE = "Idle"; export const MOVE_UNIT = "Move unit"; export const COALITIONAREA_DRAW_POLYGON = "Draw Coalition Area"; -export const visibilityControls: string[] = ["human", "dcs", "aircraft", "groundunit-sam", "groundunit-other", "navyunit", "airbase"]; -export const visibilityControlsTypes: string[][] = [["human"], ["dcs"], ["aircraft"], ["groundunit-sam", "groundunit-sam-radar", "groundunit-sam-launcher"], ["groundunit-other", "groundunit-ewr"], ["navyunit"], ["airbase"]]; -export const visibilityControlsTooltips: string[] = ["Toggle human players visibility", "Toggle DCS controlled units visibility", "Toggle aircrafts visibility", "Toggle SAM units visibility", "Toggle ground units (not SAM) visibility", "Toggle navy units visibility", "Toggle airbases visibility"]; +export const visibilityControls: string[] = ["human", "dcs", "aircraft", "helicopter", "groundunit-sam", "groundunit-other", "navyunit", "airbase"]; +export const visibilityControlsTypes: string[][] = [["human"], ["dcs"], ["aircraft"], ["helicopter"], ["groundunit-sam", "groundunit-sam-radar", "groundunit-sam-launcher"], ["groundunit-other", "groundunit-ewr"], ["navyunit"], ["airbase"]]; +export const visibilityControlsTooltips: string[] = ["Toggle human players visibility", "Toggle DCS controlled units visibility", "Toggle aircrafts visibility", "Toggle helicopter visibility", "Toggle SAM units visibility", "Toggle ground units (not SAM) visibility", "Toggle navy units visibility", "Toggle airbases visibility"]; export const IADSTypes = ["AAA", "MANPADS", "SAM Site", "Radar"]; export const IADSDensities: {[key: string]: number}= {"AAA": 0.8, "MANPADS": 0.3, "SAM Site": 0.1, "Radar": 0.05}; -export const HIDE_GROUP_MEMBERS = "Hide group members when zoomed out"; -export const SHOW_UNIT_LABELS = "Show unit labels"; -export const SHOW_UNIT_CONTACTS = "Show selected units contact lines"; -export const SHOW_UNITS_RINGS = "Show selected units threat range rings"; -export const SHOW_UNIT_PATHS = "Show selected unit paths"; -export const SHOW_UNIT_TARGETS = "Show selected unit targets"; +export const HIDE_GROUP_MEMBERS = "Hide group members when zoomed out"; +export const SHOW_UNIT_LABELS = "Show unit labels (L)"; +export const SHOW_UNITS_ENGAGEMENT_RINGS = "Show units threat range rings (Q)"; +export const HIDE_UNITS_SHORT_RANGE_RINGS = "Hide short range units threat range rings (R)"; +export const SHOW_UNITS_ACQUISITION_RINGS = "Show units detection range rings (E)"; +export const SHOW_UNIT_CONTACTS = "Show selected units contact lines"; +export const SHOW_UNIT_PATHS = "Show selected unit paths"; +export const SHOW_UNIT_TARGETS = "Show selected unit targets"; export enum DataIndexes { startOfData = 0, diff --git a/client/src/contextmenus/contextmenu.ts b/client/src/contextmenus/contextmenu.ts index 39d5bf08..fb923e10 100644 --- a/client/src/contextmenus/contextmenu.ts +++ b/client/src/contextmenus/contextmenu.ts @@ -29,6 +29,7 @@ export class ContextMenu { this.#x = x; this.#y = y; this.clip(); + this.getContainer()?.dispatchEvent(new Event("show")); } /** Hide the contextmenu @@ -36,6 +37,7 @@ export class ContextMenu { */ hide() { this.#container?.classList.toggle("hide", true); + this.getContainer()?.dispatchEvent(new Event("hide")); } /** diff --git a/client/src/contextmenus/mapcontextmenu.ts b/client/src/contextmenus/mapcontextmenu.ts index 2f3c3689..72c73ec9 100644 --- a/client/src/contextmenus/mapcontextmenu.ts +++ b/client/src/contextmenus/mapcontextmenu.ts @@ -79,7 +79,15 @@ export class MapContextMenu extends ContextMenu { this.#groundUnitSpawnMenu.getContainer().addEventListener("hide", () => this.hide()); this.#navyUnitSpawnMenu.getContainer().addEventListener("hide", () => this.hide()); - this.hide(); + this.getContainer()?.addEventListener("show", () => this.#aircraftSpawnMenu.showCirclesPreviews()); + this.getContainer()?.addEventListener("show", () => this.#helicopterSpawnMenu.showCirclesPreviews()); + this.getContainer()?.addEventListener("show", () => this.#groundUnitSpawnMenu.showCirclesPreviews()); + this.getContainer()?.addEventListener("show", () => this.#navyUnitSpawnMenu.showCirclesPreviews()); + + this.getContainer()?.addEventListener("hide", () => this.#aircraftSpawnMenu.clearCirclesPreviews()); + this.getContainer()?.addEventListener("hide", () => this.#helicopterSpawnMenu.clearCirclesPreviews()); + this.getContainer()?.addEventListener("hide", () => this.#groundUnitSpawnMenu.clearCirclesPreviews()); + this.getContainer()?.addEventListener("hide", () => this.#navyUnitSpawnMenu.clearCirclesPreviews()); } /** Show the contextmenu on top of the map, usually at the location where the user has clicked on it. @@ -189,6 +197,11 @@ export class MapContextMenu extends ContextMenu { this.#groundUnitSpawnMenu.reset(); this.#navyUnitSpawnMenu.reset(); + this.#aircraftSpawnMenu.clearCirclesPreviews(); + this.#helicopterSpawnMenu.clearCirclesPreviews(); + this.#groundUnitSpawnMenu.clearCirclesPreviews(); + this.#navyUnitSpawnMenu.clearCirclesPreviews(); + this.setVisibleSubMenu(null); this.clip(); } diff --git a/client/src/controls/unitspawnmenu.ts b/client/src/controls/unitspawnmenu.ts index 26d8df63..4b5d88c8 100644 --- a/client/src/controls/unitspawnmenu.ts +++ b/client/src/controls/unitspawnmenu.ts @@ -1,4 +1,4 @@ -import { LatLng } from "leaflet"; +import { Circle, LatLng } from "leaflet"; import { Dropdown } from "./dropdown"; import { Slider } from "./slider"; import { UnitDatabase } from "../unit/databases/unitdatabase"; @@ -45,6 +45,10 @@ export class UnitSpawnMenu { #unitImageEl: HTMLImageElement; #unitLoadoutListEl: HTMLDivElement; + /* Range circle previews */ + #engagementCircle: Circle; + #acquisitionCircle: Circle; + constructor(ID: string, unitDatabase: UnitDatabase, orderByRole: boolean) { this.#container = document.getElementById(ID) as HTMLElement; this.#unitDatabase = unitDatabase; @@ -154,6 +158,8 @@ export class UnitSpawnMenu { this.#container.dispatchEvent(new Event("resize")); this.#computeSpawnPoints(); + + this.showCirclesPreviews(); }) this.#container.addEventListener("unitLoadoutChanged", () => { @@ -183,6 +189,13 @@ export class UnitSpawnMenu { this.#container.addEventListener("unitLiveryChanged", () => { }) + + document.addEventListener('activeCoalitionChanged', () => { + this.showCirclesPreviews(); + }); + + this.#engagementCircle = new Circle(this.spawnOptions.latlng, { radius: 0, weight: 4, opacity: 0.8, fillOpacity: 0, dashArray: "4 8" }); + this.#acquisitionCircle = new Circle(this.spawnOptions.latlng, { radius: 0, weight: 2, opacity: 0.8, fillOpacity: 0, dashArray: "8 12" }); } getContainer() { @@ -205,6 +218,8 @@ export class UnitSpawnMenu { this.setCountries(); this.#container.dispatchEvent(new Event("resize")); + + this.clearCirclesPreviews(); } setCountries() { @@ -225,12 +240,61 @@ export class UnitSpawnMenu { // this.resetUnitLabel(); } + showCirclesPreviews() { + this.clearCirclesPreviews(); + + var acquisitionRange = this.#unitDatabase.getByName(this.spawnOptions.name)?.acquisitionRange ?? 0; + var engagementRange = this.#unitDatabase.getByName(this.spawnOptions.name)?.engagementRange ?? 0; + + this.#acquisitionCircle.setRadius(acquisitionRange); + this.#engagementCircle.setRadius(engagementRange); + this.#acquisitionCircle.setLatLng(this.spawnOptions.latlng); + this.#engagementCircle.setLatLng(this.spawnOptions.latlng); + + switch (getApp().getActiveCoalition()) { + case "red": + this.#acquisitionCircle.options.color = "#D42121"; + break; + case "blue": + this.#acquisitionCircle.options.color = "#017DC1"; + break; + default: + this.#acquisitionCircle.options.color = "#111111" + break; + } + + switch (getApp().getActiveCoalition()) { + case "red": + this.#engagementCircle.options.color = "#FF5858"; + break; + case "blue": + this.#engagementCircle.options.color = "#3BB9FF"; + break; + default: + this.#engagementCircle.options.color = "#CFD9E8" + break; + } + + if (engagementRange > 0) + this.#engagementCircle.addTo(getApp().getMap()); + + if (acquisitionRange > 0) + this.#acquisitionCircle.addTo(getApp().getMap()); + } + + clearCirclesPreviews() { + this.#engagementCircle.removeFrom(getApp().getMap()); + this.#acquisitionCircle.removeFrom(getApp().getMap()); + } + setAirbase(airbase: Airbase | undefined) { this.spawnOptions.airbase = airbase; } setLatLng(latlng: LatLng) { this.spawnOptions.latlng = latlng; + + this.showCirclesPreviews(); } setMaxUnitCount(maxUnitCount: number) { diff --git a/client/src/dom.d.ts b/client/src/dom.d.ts index 4d8080e9..15e260f5 100644 --- a/client/src/dom.d.ts +++ b/client/src/dom.d.ts @@ -21,6 +21,7 @@ interface CustomEventMap { "mapVisibilityOptionsChanged": CustomEvent<>, "commandModeOptionsChanged": CustomEvent<>, "contactsUpdated": CustomEvent, + "activeCoalitionChanged": CustomEvent<> } declare global { diff --git a/client/src/map/map.ts b/client/src/map/map.ts index 84dd7e91..32a6c92d 100644 --- a/client/src/map/map.ts +++ b/client/src/map/map.ts @@ -12,7 +12,7 @@ import { DestinationPreviewMarker } from "./markers/destinationpreviewmarker"; import { TemporaryUnitMarker } from "./markers/temporaryunitmarker"; import { ClickableMiniMap } from "./clickableminimap"; import { SVGInjector } from '@tanem/svg-injector' -import { mapLayers, mapBounds, minimapBoundaries, IDLE, COALITIONAREA_DRAW_POLYGON, visibilityControls, visibilityControlsTooltips, MOVE_UNIT, SHOW_UNIT_CONTACTS, HIDE_GROUP_MEMBERS, SHOW_UNIT_PATHS, SHOW_UNIT_TARGETS, visibilityControlsTypes, SHOW_UNIT_LABELS, SHOW_UNITS_RINGS } from "../constants/constants"; +import { mapLayers, mapBounds, minimapBoundaries, IDLE, COALITIONAREA_DRAW_POLYGON, visibilityControls, visibilityControlsTooltips, MOVE_UNIT, SHOW_UNIT_CONTACTS, HIDE_GROUP_MEMBERS, SHOW_UNIT_PATHS, SHOW_UNIT_TARGETS, visibilityControlsTypes, SHOW_UNIT_LABELS, SHOW_UNITS_ENGAGEMENT_RINGS, SHOW_UNITS_ACQUISITION_RINGS, HIDE_UNITS_SHORT_RANGE_RINGS } from "../constants/constants"; import { TargetMarker } from "./markers/targetmarker"; import { CoalitionArea } from "./coalitionarea/coalitionarea"; import { CoalitionAreaContextMenu } from "../contextmenus/coalitionareacontextmenu"; @@ -214,7 +214,9 @@ export class Map extends L.Map { this.addVisibilityOption(SHOW_UNIT_PATHS, true); this.addVisibilityOption(SHOW_UNIT_TARGETS, true); this.addVisibilityOption(SHOW_UNIT_LABELS, true); - this.addVisibilityOption(SHOW_UNITS_RINGS, true); + this.addVisibilityOption(SHOW_UNITS_ENGAGEMENT_RINGS, true); + this.addVisibilityOption(SHOW_UNITS_ACQUISITION_RINGS, true); + this.addVisibilityOption(HIDE_UNITS_SHORT_RANGE_RINGS, true); } addVisibilityOption(option: string, defaultValue: boolean) { diff --git a/client/src/olympusapp.ts b/client/src/olympusapp.ts index c073695a..413fc815 100644 --- a/client/src/olympusapp.ts +++ b/client/src/olympusapp.ts @@ -18,7 +18,7 @@ import { Manager } from "./other/manager"; import { SVGInjector } from "@tanem/svg-injector"; import { ServerManager } from "./server/servermanager"; -import { BLUE_COMMANDER, GAME_MASTER, RED_COMMANDER } from "./constants/constants"; +import { BLUE_COMMANDER, GAME_MASTER, HIDE_UNITS_SHORT_RANGE_RINGS, RED_COMMANDER, SHOW_UNITS_ACQUISITION_RINGS, SHOW_UNITS_ENGAGEMENT_RINGS, SHOW_UNIT_LABELS } from "./constants/constants"; import { aircraftDatabase } from "./unit/databases/aircraftdatabase"; import { helicopterDatabase } from "./unit/databases/helicopterdatabase"; import { groundUnitDatabase } from "./unit/databases/groundunitdatabase"; @@ -94,8 +94,10 @@ export class OlympusApp { * @param newActiveCoalition */ setActiveCoalition(newActiveCoalition: string) { - if (this.getMissionManager().getCommandModeOptions().commandMode == GAME_MASTER) + if (this.getMissionManager().getCommandModeOptions().commandMode == GAME_MASTER) { this.#activeCoalition = newActiveCoalition; + document.dispatchEvent(new CustomEvent("activeCoalitionChanged")); + } } /** @@ -257,7 +259,7 @@ export class OlympusApp { }).addKeyboardShortcut("toggleUnitLabels", { "altKey": false, "callback": () => { - const chk = document.querySelector(`label[title="Show unit labels"] input[type="checkbox"]`); + const chk = document.querySelector(`label[title="${SHOW_UNIT_LABELS}"] input[type="checkbox"]`); if (chk instanceof HTMLElement) { chk.click(); } @@ -265,6 +267,39 @@ export class OlympusApp { "code": "KeyL", "ctrlKey": false, "shiftKey": false + }).addKeyboardShortcut("toggleAcquisitionRings", { + "altKey": false, + "callback": () => { + const chk = document.querySelector(`label[title="${SHOW_UNITS_ACQUISITION_RINGS}"] input[type="checkbox"]`); + if (chk instanceof HTMLElement) { + chk.click(); + } + }, + "code": "KeyE", + "ctrlKey": false, + "shiftKey": false + }).addKeyboardShortcut("toggleEngagementRings", { + "altKey": false, + "callback": () => { + const chk = document.querySelector(`label[title="${SHOW_UNITS_ENGAGEMENT_RINGS}"] input[type="checkbox"]`); + if (chk instanceof HTMLElement) { + chk.click(); + } + }, + "code": "KeyQ", + "ctrlKey": false, + "shiftKey": false + }).addKeyboardShortcut("toggleHideShortEngagementRings", { + "altKey": false, + "callback": () => { + const chk = document.querySelector(`label[title="${HIDE_UNITS_SHORT_RANGE_RINGS}"] input[type="checkbox"]`); + if (chk instanceof HTMLElement) { + chk.click(); + } + }, + "code": "KeyR", + "ctrlKey": false, + "shiftKey": false }); ["KeyW", "KeyA", "KeyS", "KeyD", "ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown"].forEach(code => { diff --git a/client/src/panels/unitcontrolpanel.ts b/client/src/panels/unitcontrolpanel.ts index 1ca60845..65afd984 100644 --- a/client/src/panels/unitcontrolpanel.ts +++ b/client/src/panels/unitcontrolpanel.ts @@ -101,7 +101,7 @@ export class UnitControlPanel extends Panel { this.#advancedSettingsDialog.classList.remove("hide"); }); /* This is for when a ctrl-click happens on the map for deselection and we need to remove the selected unit from the panel */ - document.addEventListener( "unitDeselection", ( ev:CustomEventInit ) => { + document.addEventListener( "unitsDeselection", ( ev:CustomEventInit ) => { this.getElement().querySelector( `button[data-unit-id="${ev.detail.ID}"]` )?.remove(); this.#updateRapidControls(); }); diff --git a/client/src/unit/unit.ts b/client/src/unit/unit.ts index 6d04a463..9743f64e 100644 --- a/client/src/unit/unit.ts +++ b/client/src/unit/unit.ts @@ -5,7 +5,7 @@ import { CustomMarker } from '../map/markers/custommarker'; import { SVGInjector } from '@tanem/svg-injector'; import { UnitDatabase } from './databases/unitdatabase'; import { TargetMarker } from '../map/markers/targetmarker'; -import { DLINK, DataIndexes, GAME_MASTER, HIDE_GROUP_MEMBERS, IDLE, IRST, MOVE_UNIT, OPTIC, RADAR, ROEs, RWR, SHOW_UNIT_CONTACTS, SHOW_UNITS_RINGS, SHOW_UNIT_PATHS, SHOW_UNIT_TARGETS, VISUAL, emissionsCountermeasures, reactionsToThreat, states } from '../constants/constants'; +import { DLINK, DataIndexes, GAME_MASTER, HIDE_GROUP_MEMBERS, IDLE, IRST, MOVE_UNIT, OPTIC, RADAR, ROEs, RWR, SHOW_UNIT_CONTACTS, SHOW_UNITS_ENGAGEMENT_RINGS, SHOW_UNIT_PATHS, SHOW_UNIT_TARGETS, VISUAL, emissionsCountermeasures, reactionsToThreat, states, SHOW_UNITS_ACQUISITION_RINGS, HIDE_UNITS_SHORT_RANGE_RINGS } from '../constants/constants'; import { DataExtractor } from '../server/dataextractor'; import { groundUnitDatabase } from './databases/groundunitdatabase'; import { navyUnitDatabase } from './databases/navyunitdatabase'; @@ -152,8 +152,8 @@ export class Unit extends CustomMarker { this.#pathPolyline.addTo(getApp().getMap()); this.#targetPositionMarker = new TargetMarker(new LatLng(0, 0)); this.#targetPositionPolyline = new Polyline([], { color: '#FF0000', weight: 3, opacity: 0.5, smoothFactor: 1 }); - this.#engagementCircle = new Circle(this.getPosition(), { radius: 0, weight: 4, opacity: 0.5, fillOpacity: 0, dashArray: "4 8" }); - this.#acquisitionCircle = new Circle(this.getPosition(), { radius: 0, weight: 1, opacity: 0.5, fillOpacity: 0, dashArray: "8 4 2 4 2 4" }); + this.#engagementCircle = new Circle(this.getPosition(), { radius: 0, weight: 4, opacity: 1, fillOpacity: 0, dashArray: "4 8" }); + this.#acquisitionCircle = new Circle(this.getPosition(), { radius: 0, weight: 2, opacity: 1, fillOpacity: 0, dashArray: "8 12" }); this.on('click', (e) => this.#onClick(e)); this.on('dblclick', (e) => this.#onDoubleClick(e)); @@ -181,12 +181,10 @@ export class Unit extends CustomMarker { document.addEventListener("mapVisibilityOptionsChanged", (ev: CustomEventInit) => { this.#updateMarker(); - if (this.getSelected()) { + this.#drawRanges(); + + if (this.getSelected()) this.drawLines(); - this.#drawRanges(); - } else { - this.#clearRanges(); - } }); } @@ -211,7 +209,7 @@ export class Unit extends CustomMarker { case DataIndexes.country: this.#country = dataExtractor.extractUInt8(); break; case DataIndexes.name: this.#name = dataExtractor.extractString(); break; case DataIndexes.unitName: this.#unitName = dataExtractor.extractString(); break; - case DataIndexes.groupName: this.#groupName = dataExtractor.extractString(); break; + case DataIndexes.groupName: this.#groupName = dataExtractor.extractString(); updateMarker = true; break; case DataIndexes.state: this.#state = enumToState(dataExtractor.extractUInt8()); updateMarker = true; break; case DataIndexes.task: this.#task = dataExtractor.extractString(); break; case DataIndexes.hasTask: this.#hasTask = dataExtractor.extractBool(); break; @@ -240,7 +238,7 @@ export class Unit extends CustomMarker { case DataIndexes.ammo: this.#ammo = dataExtractor.extractAmmo(); break; case DataIndexes.contacts: this.#contacts = dataExtractor.extractContacts(); document.dispatchEvent(new CustomEvent("contactsUpdated", { detail: this })); break; case DataIndexes.activePath: this.#activePath = dataExtractor.extractActivePath(); break; - case DataIndexes.isLeader: this.#isLeader = dataExtractor.extractBool(); break; + case DataIndexes.isLeader: this.#isLeader = dataExtractor.extractBool(); updateMarker = true; break; case DataIndexes.operateAs: this.#operateAs = enumToCoalition(dataExtractor.extractUInt8()); break; } } @@ -349,7 +347,6 @@ export class Unit extends CustomMarker { } else { this.#clearContacts(); - this.#clearRanges(); this.#clearPath(); this.#clearTarget(); } @@ -406,7 +403,7 @@ export class Unit extends CustomMarker { } getGroupMembers() { - return Object.values(getApp().getUnitsManager().getUnits()).filter((unit: Unit) => { return unit != this && unit.#groupName === this.#groupName; }); + return Object.values(getApp().getUnitsManager().getUnits()).filter((unit: Unit) => { return unit != this && unit.getGroupName() === this.getGroupName(); }); } belongsToCommandedCoalition() { @@ -532,6 +529,8 @@ export class Unit extends CustomMarker { } this.getElement()?.appendChild(el); + + this.#drawRanges(); } /********************** Visibility *************************/ @@ -563,6 +562,12 @@ export class Unit extends CustomMarker { if (getApp().getMap().hasLayer(this) && this.getHidden()) { getApp().getMap().removeLayer(this); } + + if (!this.getHidden()) { + this.#drawRanges(); + } else { + this.#clearRanges(); + } } getHidden() { @@ -757,7 +762,6 @@ export class Unit extends CustomMarker { coalition = "blue"; else if (this.getCoalition() == "blue") coalition = "red"; - //TODO getApp().getServerManager().scenicAAA(this.ID, coalition); } @@ -767,7 +771,6 @@ export class Unit extends CustomMarker { coalition = "blue"; else if (this.getCoalition() == "blue") coalition = "red"; - //TODO getApp().getServerManager().missOnPurpose(this.ID, coalition); } @@ -820,11 +823,6 @@ export class Unit extends CustomMarker { getApp().getUnitsManager().deselectAllUnits(); this.setSelected(!this.getSelected()); - const detail = { "detail": { "unit": this } }; - if (this.getSelected()) - document.dispatchEvent(new CustomEvent("unitSelected", detail)); - else - document.dispatchEvent(new CustomEvent("unitDeselection", { "detail": this })); } } @@ -893,14 +891,14 @@ export class Unit extends CustomMarker { var options: { [key: string]: { text: string, tooltip: string } } = {}; options = { - 'trail': { text: "Trail", tooltip: "Follow unit in trail formation" }, - 'echelon-lh': { text: "Echelon (LH)", tooltip: "Follow unit in echelon left formation" }, - 'echelon-rh': { text: "Echelon (RH)", tooltip: "Follow unit in echelon right formation" }, - 'line-abreast-lh': { text: "Line abreast (LH)", tooltip: "Follow unit in line abreast left formation" }, - 'line-abreast-rh': { text: "Line abreast (RH)", tooltip: "Follow unit in line abreast right formation" }, - 'front': { text: "Front", tooltip: "Fly in front of unit" }, - 'diamond': { text: "Diamond", tooltip: "Follow unit in diamond formation" }, - 'custom': { text: "Custom", tooltip: "Set a custom formation position" }, + 'trail': { text: "Trail", tooltip: "Follow unit in trail formation" }, + 'echelon-lh': { text: "Echelon (LH)", tooltip: "Follow unit in echelon left formation" }, + 'echelon-rh': { text: "Echelon (RH)", tooltip: "Follow unit in echelon right formation" }, + 'line-abreast-lh': { text: "Line abreast (LH)", tooltip: "Follow unit in line abreast left formation" }, + 'line-abreast-rh': { text: "Line abreast (RH)", tooltip: "Follow unit in line abreast right formation" }, + 'front': { text: "Front", tooltip: "Fly in front of unit" }, + 'diamond': { text: "Diamond", tooltip: "Follow unit in diamond formation" }, + 'custom': { text: "Custom", tooltip: "Set a custom formation position" }, } getApp().getMap().getUnitContextMenu().setOptions(options, (option: string) => { @@ -995,9 +993,9 @@ export class Unit extends CustomMarker { element.querySelector(".unit")?.toggleAttribute("data-is-dead", !this.#alive); /* Set current unit state */ - if (this.#human) // Unit is human + if (this.#human) // Unit is human element.querySelector(".unit")?.setAttribute("data-state", "human"); - else if (!this.#controlled) // Unit is under DCS control (not Olympus) + else if (!this.#controlled) // Unit is under DCS control (not Olympus) element.querySelector(".unit")?.setAttribute("data-state", "dcs"); else if ((this.getCategory() == "Aircraft" || this.getCategory() == "Helicopter") && !this.#hasTask) element.querySelector(".unit")?.setAttribute("data-state", "no-task"); @@ -1052,7 +1050,6 @@ export class Unit extends CustomMarker { if (hotgroupEl) hotgroupEl.innerText = String(this.#hotgroup); } - } /* Set vertical offset for altitude stacking */ @@ -1061,37 +1058,7 @@ export class Unit extends CustomMarker { /* Circles don't like to be updated when the map is zooming */ if (!getApp().getMap().isZooming()) { - var engagementRange = 0; - var acquisitionRange = 0; - - /* Get the acquisition and engagement ranges of the entire group, not for each unit */ - if (this.getIsLeader()) { - var engagementRange = this.getDatabase()?.getByName(this.getName())?.engagementRange?? 0; - var acquisitionRange = this.getDatabase()?.getByName(this.getName())?.acquisitionRange?? 0; - - this.getGroupMembers().forEach((unit: Unit) => { - let unitEngagementRange = unit.getDatabase()?.getByName(unit.getName())?.engagementRange?? 0; - let unitAcquisitionRange = unit.getDatabase()?.getByName(unit.getName())?.acquisitionRange?? 0; - - if (unitEngagementRange > engagementRange) - engagementRange = unitEngagementRange; - - if (unitAcquisitionRange > acquisitionRange) - acquisitionRange = unitAcquisitionRange; - }) - } - - if (engagementRange !== this.#engagementCircle.getRadius()) - this.#engagementCircle.setRadius(engagementRange); - - if (acquisitionRange !== this.#acquisitionCircle.getRadius()) - this.#acquisitionCircle.setRadius(acquisitionRange); - - - if (this.getSelected()) - this.#drawRanges(); - else - this.#clearRanges(); + this.#drawRanges(); } } } @@ -1186,23 +1153,83 @@ export class Unit extends CustomMarker { } #drawRanges() { - if (getApp().getMap().getVisibilityOptions()[SHOW_UNITS_RINGS] && this.getIsLeader()) { - if (!getApp().getMap().hasLayer(this.#acquisitionCircle)) { - this.#acquisitionCircle.addTo(getApp().getMap()); - this.#acquisitionCircle.options.color = this.getCoalition() == "red" ? "#FFAAAA": "#AAAAFF"; - } - - this.#acquisitionCircle.setLatLng(this.getPosition()); + var engagementRange = 0; + var acquisitionRange = 0; - if (!getApp().getMap().hasLayer(this.#engagementCircle)) { - this.#engagementCircle.addTo(getApp().getMap()); - this.#engagementCircle.options.color = this.getCoalition(); + /* Get the acquisition and engagement ranges of the entire group, not for each unit */ + if (this.getIsLeader()) { + var engagementRange = this.getDatabase()?.getByName(this.getName())?.engagementRange?? 0; + var acquisitionRange = this.getDatabase()?.getByName(this.getName())?.acquisitionRange?? 0; + + this.getGroupMembers().forEach((unit: Unit) => { + if (unit.getAlive()) { + let unitEngagementRange = unit.getDatabase()?.getByName(unit.getName())?.engagementRange?? 0; + let unitAcquisitionRange = unit.getDatabase()?.getByName(unit.getName())?.acquisitionRange?? 0; + + if (unitEngagementRange > engagementRange) + engagementRange = unitEngagementRange; + + if (unitAcquisitionRange > acquisitionRange) + acquisitionRange = unitAcquisitionRange; + } + }) + + if (acquisitionRange !== this.#acquisitionCircle.getRadius()) + this.#acquisitionCircle.setRadius(acquisitionRange); + + if (engagementRange !== this.#engagementCircle.getRadius()) + this.#engagementCircle.setRadius(engagementRange); + + this.#engagementCircle.options.fillOpacity = this.getSelected()? 0.3: 0; + + /* Acquisition circles */ + var shortRangeCheck = (engagementRange > nmToM(3) && acquisitionRange > nmToM(3) || !getApp().getMap().getVisibilityOptions()[HIDE_UNITS_SHORT_RANGE_RINGS]); + + if (getApp().getMap().getVisibilityOptions()[SHOW_UNITS_ACQUISITION_RINGS] && shortRangeCheck && (this.belongsToCommandedCoalition() || this.getDetectionMethods().some(value => [VISUAL, OPTIC, IRST, RWR].includes(value)))) { + if (!getApp().getMap().hasLayer(this.#acquisitionCircle)) { + this.#acquisitionCircle.addTo(getApp().getMap()); + switch (this.getCoalition()) { + case "red": + this.#acquisitionCircle.options.color = "#D42121"; + break; + case "blue": + this.#acquisitionCircle.options.color = "#017DC1"; + break; + default: + this.#acquisitionCircle.options.color = "#111111" + break; + } + } + this.#acquisitionCircle.setLatLng(this.getPosition()); + } + else { + if (getApp().getMap().hasLayer(this.#acquisitionCircle)) + this.#acquisitionCircle.removeFrom(getApp().getMap()); } - this.#engagementCircle.setLatLng(this.getPosition()); - } - else { - this.#clearRanges(); + /* Engagement circles */ + if (getApp().getMap().getVisibilityOptions()[SHOW_UNITS_ENGAGEMENT_RINGS] && shortRangeCheck && (this.belongsToCommandedCoalition() || this.getDetectionMethods().some(value => [VISUAL, OPTIC, IRST, RWR].includes(value)))) { + if (!getApp().getMap().hasLayer(this.#engagementCircle)) { + this.#engagementCircle.addTo(getApp().getMap()); + switch (this.getCoalition()) { + case "red": + this.#engagementCircle.options.color = "#FF5858"; + break; + case "blue": + this.#engagementCircle.options.color = "#3BB9FF"; + break; + default: + this.#engagementCircle.options.color = "#CFD9E8" + break; + } + } + this.#engagementCircle.setLatLng(this.getPosition()); + } + else { + if (getApp().getMap().hasLayer(this.#engagementCircle)) + this.#engagementCircle.removeFrom(getApp().getMap()); + } + } } diff --git a/client/src/unit/unitsmanager.ts b/client/src/unit/unitsmanager.ts index 0631214e..65696f21 100644 --- a/client/src/unit/unitsmanager.ts +++ b/client/src/unit/unitsmanager.ts @@ -23,6 +23,7 @@ export class UnitsManager { #units: { [ID: number]: Unit }; #copiedUnits: UnitData[]; #selectionEventDisabled: boolean = false; + #deselectionEventDisabled: boolean = false; #requestDetectionUpdate: boolean = false; constructor() { @@ -1048,8 +1049,16 @@ export class UnitsManager { getApp().getMap().setState(IDLE); document.dispatchEvent(new CustomEvent("clearSelection")); } - else - document.dispatchEvent(new CustomEvent("unitsDeselection", { detail: this.getSelectedUnits() })); + else { + /* Disable the firing of the selection event for a certain amount of time. This avoids firing many events if many units are selected */ + if (!this.#deselectionEventDisabled) { + window.setTimeout(() => { + document.dispatchEvent(new CustomEvent("unitsDeselection", { detail: this.getSelectedUnits() })); + this.#deselectionEventDisabled = false; + }, 100); + this.#deselectionEventDisabled = true; + } + } } #showActionMessage(units: Unit[], message: string) { diff --git a/scripts/python/.vscode/launch.json b/scripts/python/.vscode/launch.json index f60a1b52..5f47cb45 100644 --- a/scripts/python/.vscode/launch.json +++ b/scripts/python/.vscode/launch.json @@ -11,7 +11,7 @@ "program": "${file}", "console": "integratedTerminal", "justMyCode": true, - "args": ["groundunit"] + "args": ["navyunit"] } ] } \ No newline at end of file