mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Moved tanker/AWACS button to control panel
This commit is contained in:
parent
ebee6610a3
commit
867d7697d2
@ -2,11 +2,11 @@ var basicAuth = require('express-basic-auth')
|
||||
var enc = new TextEncoder();
|
||||
|
||||
const DEMO_UNIT_DATA = {
|
||||
["1"]:{ category: "Aircraft", alive: true, human: false, controlled: true, coalition: 2, country: 0, name: "KC-135", unitName: "Cool guy 1-1 who also has a very long name", groupName: "Cool group 1", state: 3, task: "Being cool!",
|
||||
["1"]:{ category: "Aircraft", alive: true, human: false, controlled: true, coalition: 2, country: 0, name: "KC-135", unitName: "Cool guy 1-1 who also has a very long name", groupName: "Cool group 1", state: 1, task: "Being cool!",
|
||||
hasTask: true, position: { lat: 37, lng: -116, alt: 1000 }, speed: 200, heading: 45, isTanker: true, 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 },
|
||||
targetID: 2,
|
||||
targetID: 0,
|
||||
targetPosition: { lat: 0, lng: 0, alt: 0 },
|
||||
ROE: 1,
|
||||
reactionToThreat: 1,
|
||||
@ -18,8 +18,8 @@ const DEMO_UNIT_DATA = {
|
||||
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",
|
||||
hasTask: false, position: { lat: 36.9, lng: -116, alt: 1000 }, speed: 200, heading: 315 * Math.PI / 180, isTanker: false, isAWACS: false, onOff: true, followRoads: false, fuel: 50,
|
||||
["2"]:{ category: "Aircraft", alive: true, human: false, controlled: true, coalition: 1, country: 0, name: "E-3A", unitName: "Cool guy 1-2", groupName: "Cool group 2", state: 1, task: "Being cool",
|
||||
hasTask: true, position: { lat: 36.9, lng: -116, alt: 1000 }, speed: 200, heading: 315 * Math.PI / 180, isTanker: false, isAWACS: true, onOff: true, followRoads: false, fuel: 50,
|
||||
desiredSpeed: 300, desiredSpeedType: 1, desiredAltitude: 1000, desiredAltitudeType: 1, leaderID: 0,
|
||||
formationOffset: { x: 0, y: 0, z: 0 },
|
||||
targetID: 0,
|
||||
@ -49,7 +49,7 @@ const DEMO_UNIT_DATA = {
|
||||
contacts: [{ID: 1, detectionMethod: 16}],
|
||||
activePath: [ ]
|
||||
}, ["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,
|
||||
hasTask: false, position: { lat: 37.2, lng: -116.1, alt: 1000 }, speed: 200, heading: 315 * Math.PI / 180, isTanker: false, isAWACS: false, onOff: false, followRoads: false, fuel: 50,
|
||||
desiredSpeed: 300, desiredSpeedType: 1, desiredAltitude: 1000, desiredAltitudeType: 1, leaderID: 0,
|
||||
formationOffset: { x: 0, y: 0, z: 0 },
|
||||
targetID: 0,
|
||||
@ -66,7 +66,7 @@ const DEMO_UNIT_DATA = {
|
||||
isLeader: true,
|
||||
operateAs: 2
|
||||
}, ["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,
|
||||
hasTask: false, position: { lat: 37.21, lng: -116.1, alt: 1000 }, speed: 200, heading: 315 * Math.PI / 180, isTanker: false, isAWACS: false, onOff: false, followRoads: false, fuel: 50,
|
||||
desiredSpeed: 300, desiredSpeedType: 1, desiredAltitude: 1000, desiredAltitudeType: 1, leaderID: 0,
|
||||
formationOffset: { x: 0, y: 0, z: 0 },
|
||||
targetID: 0,
|
||||
|
||||
5408
client/package-lock.json
generated
5408
client/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -299,11 +299,14 @@
|
||||
background-image: url("/resources/theme/images/states/off.svg");
|
||||
}
|
||||
|
||||
|
||||
[data-object|="unit"][data-state="tanker"] .unit-state {
|
||||
background-image: url("/resources/theme/images/states/tanker.svg");
|
||||
}
|
||||
|
||||
[data-object|="unit"][data-state="AWACS"] .unit-state {
|
||||
background-image: url("/resources/theme/images/states/awacs.svg");
|
||||
}
|
||||
|
||||
|
||||
/*** Dead unit ***/
|
||||
[data-object|="unit"][data-is-dead] .unit-selected-spotlight,
|
||||
|
||||
@ -239,16 +239,18 @@ body.feature-forceShowUnitControlPanel #unit-control-panel {
|
||||
#unit-control-panel:not([data-show-roe]) #roe,
|
||||
#unit-control-panel:not([data-show-threat]) #threat,
|
||||
#unit-control-panel:not([data-show-emissions-countermeasures]) #emissions-countermeasures,
|
||||
#unit-control-panel:not([data-show-tanker-button]) #tanker-on,
|
||||
#unit-control-panel:not([data-show-AWACS-button]) #AWACS-on,
|
||||
#unit-control-panel:not([data-show-on-off]) #ai-on-off,
|
||||
#unit-control-panel:not([data-show-follow-roads]) #follow-roads,
|
||||
#unit-control-panel:not([data-show-operate-as]) #operate-as,
|
||||
#unit-control-panel:not([data-show-advanced-settings-button]) #advanced-settings-button,
|
||||
#advanced-settings-dialog:not([data-show-settings]) #general-settings,
|
||||
#advanced-settings-dialog:not([data-show-tasking]) #tasking,
|
||||
#advanced-settings-dialog:not([data-show-tanker]) #tanker-checkbox,
|
||||
#advanced-settings-dialog:not([data-show-AWACS]) #AWACS-checkbox,
|
||||
/*#advanced-settings-dialog:not([data-show-tanker]) #tanker-checkbox,
|
||||
#advanced-settings-dialog:not([data-show-AWACS]) #AWACS-checkbox,*/
|
||||
#advanced-settings-dialog:not([data-show-TACAN]) #TACAN-options,
|
||||
#advanced-settings-dialog:not([data-show-radio]) #radio-options,
|
||||
#advanced-settings-dialog:not([data-show-air-unit-checkboxes]) .air-unit-checkbox {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
115
client/public/themes/olympus/images/states/awacs.svg
Normal file
115
client/public/themes/olympus/images/states/awacs.svg
Normal file
@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="19"
|
||||
height="15"
|
||||
viewBox="0 0 19 15"
|
||||
fill="none"
|
||||
version="1.1"
|
||||
id="svg6"
|
||||
sodipodi:docname="awacs.svg"
|
||||
inkscape:version="1.2.2 (732a01da63, 2022-12-09)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs10" />
|
||||
<sodipodi:namedview
|
||||
id="namedview8"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="55.289474"
|
||||
inkscape:cx="15.961447"
|
||||
inkscape:cy="9.2422656"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1377"
|
||||
inkscape:window-x="1912"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg6"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:deskcolor="#d1d1d1" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:4.1;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path900"
|
||||
sodipodi:type="arc"
|
||||
sodipodi:cx="9.5228071"
|
||||
sodipodi:cy="13.755494"
|
||||
sodipodi:rx="2.5"
|
||||
sodipodi:ry="2.5"
|
||||
sodipodi:start="4.0142573"
|
||||
sodipodi:end="5.4105207"
|
||||
sodipodi:arc-type="arc"
|
||||
d="m 7.9158381,11.840383 a 2.5,2.5 0 0 1 3.2139379,0"
|
||||
sodipodi:open="true" />
|
||||
<path
|
||||
style="fill:none;stroke:#ffffff;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path900-1"
|
||||
sodipodi:type="arc"
|
||||
sodipodi:cx="9.5228071"
|
||||
sodipodi:cy="13.755494"
|
||||
sodipodi:rx="2.5"
|
||||
sodipodi:ry="2.5"
|
||||
sodipodi:start="4.0142573"
|
||||
sodipodi:end="5.4105207"
|
||||
sodipodi:arc-type="arc"
|
||||
d="m 7.9158381,11.840383 a 2.5,2.5 0 0 1 3.2139379,0"
|
||||
sodipodi:open="true" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:4.1;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path900-5"
|
||||
sodipodi:type="arc"
|
||||
sodipodi:cx="9.5228071"
|
||||
sodipodi:cy="13.755494"
|
||||
sodipodi:rx="7"
|
||||
sodipodi:ry="7"
|
||||
sodipodi:start="4.0142573"
|
||||
sodipodi:end="5.4105207"
|
||||
sodipodi:arc-type="arc"
|
||||
d="m 5.023294,8.3931829 a 7,7 0 0 1 8.999026,2e-7"
|
||||
sodipodi:open="true" />
|
||||
<path
|
||||
style="fill:none;stroke:#ffffff;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path900-1-7"
|
||||
sodipodi:type="arc"
|
||||
sodipodi:cx="9.5228071"
|
||||
sodipodi:cy="13.755494"
|
||||
sodipodi:rx="7"
|
||||
sodipodi:ry="7"
|
||||
sodipodi:start="4.0142573"
|
||||
sodipodi:end="5.4105207"
|
||||
sodipodi:arc-type="arc"
|
||||
d="m 5.023294,8.3931829 a 7,7 0 0 1 8.999026,2e-7"
|
||||
sodipodi:open="true" />
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:4.1;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path900-5-1"
|
||||
sodipodi:type="arc"
|
||||
sodipodi:cx="9.5228071"
|
||||
sodipodi:cy="13.755494"
|
||||
sodipodi:rx="11.5"
|
||||
sodipodi:ry="11.5"
|
||||
sodipodi:start="4.0142573"
|
||||
sodipodi:end="5.4105207"
|
||||
sodipodi:arc-type="arc"
|
||||
d="m 2.1307496,4.945983 a 11.5,11.5 0 0 1 14.7841154,2e-7"
|
||||
sodipodi:open="true" />
|
||||
<path
|
||||
style="fill:none;stroke:#ffffff;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path900-1-7-8"
|
||||
sodipodi:type="arc"
|
||||
sodipodi:cx="9.5228071"
|
||||
sodipodi:cy="13.755494"
|
||||
sodipodi:rx="11.5"
|
||||
sodipodi:ry="11.5"
|
||||
sodipodi:start="4.0142573"
|
||||
sodipodi:end="5.4105207"
|
||||
sodipodi:arc-type="arc"
|
||||
d="m 2.1307496,4.945983 a 11.5,11.5 0 0 1 14.7841154,2e-7"
|
||||
sodipodi:open="true" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.8 KiB |
@ -12,6 +12,8 @@ import { GeneralSettings, Radio, TACAN } from "../interfaces";
|
||||
|
||||
export class UnitControlPanel extends Panel {
|
||||
#altitudeSlider: Slider;
|
||||
#tankerSwitch: Switch;
|
||||
#AWACSSwitch: Switch;
|
||||
#altitudeTypeSwitch: Switch;
|
||||
#speedSlider: Slider;
|
||||
#speedTypeSwitch: Switch;
|
||||
@ -58,6 +60,24 @@ export class UnitControlPanel extends Panel {
|
||||
this.getElement().querySelector("#reaction-to-threat-buttons-container")?.append(...this.#optionButtons["reactionToThreat"]);
|
||||
this.getElement().querySelector("#emissions-countermeasures-buttons-container")?.append(...this.#optionButtons["emissionsCountermeasures"]);
|
||||
|
||||
/* Tanker */
|
||||
this.#tankerSwitch = new Switch("tanker-on-switch", (value: boolean) => {
|
||||
// TODO: split setAdvancedOptions into setIsTanker, setIsAWACS, setAdvancedOptions
|
||||
var selectedUnits = getApp().getUnitsManager().getSelectedUnits();
|
||||
selectedUnits.forEach((unit: Unit) => {
|
||||
unit.setAdvancedOptions(value, unit.getIsAWACS(), unit.getTACAN(), unit.getRadio(), unit.getGeneralSettings());
|
||||
});
|
||||
});
|
||||
|
||||
/* AWACS */
|
||||
this.#AWACSSwitch = new Switch("AWACS-on-switch", (value: boolean) => {
|
||||
// TODO: split setAdvancedOptions into setIsTanker, setIsAWACS, setAdvancedOptions
|
||||
var selectedUnits = getApp().getUnitsManager().getSelectedUnits();
|
||||
selectedUnits.forEach((unit: Unit) => {
|
||||
unit.setAdvancedOptions(unit.getIsTanker(), value, unit.getTACAN(), unit.getRadio(), unit.getGeneralSettings());
|
||||
});
|
||||
});
|
||||
|
||||
/* On off switch */
|
||||
this.#onOffSwitch = new Switch("on-off-switch", (value: boolean) => {
|
||||
getApp().getUnitsManager().selectedUnitsSetOnOff(value);
|
||||
@ -114,6 +134,8 @@ export class UnitControlPanel extends Panel {
|
||||
super.show();
|
||||
this.#speedTypeSwitch.resetExpectedValue();
|
||||
this.#altitudeTypeSwitch.resetExpectedValue();
|
||||
this.#tankerSwitch.resetExpectedValue();
|
||||
this.#AWACSSwitch.resetExpectedValue();
|
||||
this.#onOffSwitch.resetExpectedValue();
|
||||
this.#followRoadsSwitch.resetExpectedValue();
|
||||
this.#altitudeSlider.resetExpectedValue();
|
||||
@ -162,16 +184,31 @@ export class UnitControlPanel extends Panel {
|
||||
const element = this.getElement();
|
||||
if (element != null && this.#units.length > 0) {
|
||||
/* Toggle visibility of control elements */
|
||||
var tanker = getApp().getUnitsManager().getSelectedUnitsVariable((unit: Unit) => {return unit.canFulfillRole("Tanker")});
|
||||
var AWACS = getApp().getUnitsManager().getSelectedUnitsVariable((unit: Unit) => {return unit.canFulfillRole("AWACS")});
|
||||
var isTanker = getApp().getUnitsManager().getSelectedUnitsVariable((unit: Unit) => {return unit.getIsTanker()});
|
||||
var isAWACS = getApp().getUnitsManager().getSelectedUnitsVariable((unit: Unit) => {return unit.getIsAWACS()});
|
||||
|
||||
element.toggleAttribute("data-show-categories-tooltip", this.#selectedUnitsTypes.length > 1);
|
||||
element.toggleAttribute("data-show-speed-slider", this.#selectedUnitsTypes.length == 1);
|
||||
element.toggleAttribute("data-show-altitude-slider", this.#selectedUnitsTypes.length == 1 && (this.#selectedUnitsTypes.includes("Aircraft") || this.#selectedUnitsTypes.includes("Helicopter")));
|
||||
element.toggleAttribute("data-show-roe", true);
|
||||
element.toggleAttribute("data-show-roe", !tanker && !AWACS);
|
||||
element.toggleAttribute("data-show-threat", (this.#selectedUnitsTypes.includes("Aircraft") || this.#selectedUnitsTypes.includes("Helicopter")) && !(this.#selectedUnitsTypes.includes("GroundUnit") || this.#selectedUnitsTypes.includes("NavyUnit")));
|
||||
element.toggleAttribute("data-show-emissions-countermeasures", (this.#selectedUnitsTypes.includes("Aircraft") || this.#selectedUnitsTypes.includes("Helicopter")) && !(this.#selectedUnitsTypes.includes("GroundUnit") || this.#selectedUnitsTypes.includes("NavyUnit")));
|
||||
element.toggleAttribute("data-show-tanker-button", getApp().getUnitsManager().getSelectedUnitsVariable((unit: Unit) => {return unit.canFulfillRole("Tanker")}) === true);
|
||||
element.toggleAttribute("data-show-AWACS-button", getApp().getUnitsManager().getSelectedUnitsVariable((unit: Unit) => {return unit.canFulfillRole("AWACS")}) === true);
|
||||
element.toggleAttribute("data-show-on-off", (this.#selectedUnitsTypes.includes("GroundUnit") || this.#selectedUnitsTypes.includes("NavyUnit")) && !(this.#selectedUnitsTypes.includes("Aircraft") || this.#selectedUnitsTypes.includes("Helicopter")));
|
||||
element.toggleAttribute("data-show-follow-roads", (this.#selectedUnitsTypes.length == 1 && this.#selectedUnitsTypes.includes("GroundUnit")));
|
||||
element.toggleAttribute("data-show-operate-as", getApp().getUnitsManager().getSelectedUnitsVariable((unit: Unit) => {return unit.getCoalition()}) === "neutral");
|
||||
element.toggleAttribute("data-show-advanced-settings-button", this.#units.length == 1);
|
||||
|
||||
if (this.#units.length == 1) {
|
||||
if (AWACS)
|
||||
element.toggleAttribute("data-show-advanced-settings-button", isAWACS);
|
||||
else if (tanker)
|
||||
element.toggleAttribute("data-show-advanced-settings-button", isTanker);
|
||||
else
|
||||
element.toggleAttribute("data-show-advanced-settings-button", true);
|
||||
}
|
||||
|
||||
if (this.#selectedUnitsTypes.length == 1) {
|
||||
/* Flight controls */
|
||||
@ -179,6 +216,8 @@ export class UnitControlPanel extends Panel {
|
||||
var desiredAltitudeType = getApp().getUnitsManager().getSelectedUnitsVariable((unit: Unit) => {return unit.getDesiredAltitudeType()});
|
||||
var desiredSpeed = getApp().getUnitsManager().getSelectedUnitsVariable((unit: Unit) => {return unit.getDesiredSpeed()});
|
||||
var desiredSpeedType = getApp().getUnitsManager().getSelectedUnitsVariable((unit: Unit) => {return unit.getDesiredSpeedType()});
|
||||
var isTanker = getApp().getUnitsManager().getSelectedUnitsVariable((unit: Unit) => {return unit.getIsTanker()});
|
||||
var isAWACS = getApp().getUnitsManager().getSelectedUnitsVariable((unit: Unit) => {return unit.getIsAWACS()});
|
||||
var onOff = getApp().getUnitsManager().getSelectedUnitsVariable((unit: Unit) => {return unit.getOnOff()});
|
||||
var followRoads = getApp().getUnitsManager().getSelectedUnitsVariable((unit: Unit) => {return unit.getFollowRoads()});
|
||||
var operateAs = getApp().getUnitsManager().getSelectedUnitsVariable((unit: Unit) => {return unit.getOperateAs()});
|
||||
@ -217,6 +256,8 @@ export class UnitControlPanel extends Panel {
|
||||
button.classList.toggle("selected", this.#units.every((unit: Unit) => unit.getEmissionsCountermeasures() === button.value))
|
||||
});
|
||||
|
||||
this.#tankerSwitch.setValue(isTanker, false);
|
||||
this.#AWACSSwitch.setValue(isAWACS, false);
|
||||
this.#onOffSwitch.setValue(onOff, false);
|
||||
this.#followRoadsSwitch.setValue(followRoads, false);
|
||||
this.#operateAsSwitch.setValue(operateAs? operateAs === "blue": undefined, false);
|
||||
@ -288,8 +329,8 @@ export class UnitControlPanel extends Panel {
|
||||
const prohibitAACheckbox = this.#advancedSettingsDialog.querySelector("#prohibit-AA-checkbox")?.querySelector("input") as HTMLInputElement;
|
||||
const prohibitAGCheckbox = this.#advancedSettingsDialog.querySelector("#prohibit-AG-checkbox")?.querySelector("input") as HTMLInputElement;
|
||||
const prohibitAirWpnCheckbox = this.#advancedSettingsDialog.querySelector("#prohibit-air-wpn-checkbox")?.querySelector("input") as HTMLInputElement;
|
||||
const tankerCheckbox = this.#advancedSettingsDialog.querySelector("#tanker-checkbox")?.querySelector("input") as HTMLInputElement;
|
||||
const AWACSCheckbox = this.#advancedSettingsDialog.querySelector("#AWACS-checkbox")?.querySelector("input") as HTMLInputElement;
|
||||
//const tankerCheckbox = this.#advancedSettingsDialog.querySelector("#tanker-checkbox")?.querySelector("input") as HTMLInputElement;
|
||||
//const AWACSCheckbox = this.#advancedSettingsDialog.querySelector("#AWACS-checkbox")?.querySelector("input") as HTMLInputElement;
|
||||
const TACANCheckbox = this.#advancedSettingsDialog.querySelector("#TACAN-checkbox")?.querySelector("input") as HTMLInputElement;
|
||||
const TACANChannelInput = this.#advancedSettingsDialog.querySelector("#TACAN-channel")?.querySelector("input") as HTMLInputElement;
|
||||
const TACANCallsignInput = this.#advancedSettingsDialog.querySelector("#tacan-callsign")?.querySelector("input") as HTMLInputElement;
|
||||
@ -323,8 +364,8 @@ export class UnitControlPanel extends Panel {
|
||||
prohibitAirWpnCheckbox.checked = unit.getGeneralSettings().prohibitAirWpn;
|
||||
|
||||
// Tasking
|
||||
tankerCheckbox.checked = unit.getIsTanker();
|
||||
AWACSCheckbox.checked = unit.getIsAWACS();
|
||||
//tankerCheckbox.checked = unit.getIsTanker();
|
||||
//AWACSCheckbox.checked = unit.getIsAWACS();
|
||||
|
||||
// TACAN
|
||||
TACANCheckbox.checked = unit.getTACAN().isOn;
|
||||
@ -358,8 +399,8 @@ export class UnitControlPanel extends Panel {
|
||||
const prohibitAACheckbox = this.#advancedSettingsDialog.querySelector("#prohibit-AA-checkbox")?.querySelector("input") as HTMLInputElement;
|
||||
const prohibitAGCheckbox = this.#advancedSettingsDialog.querySelector("#prohibit-AG-checkbox")?.querySelector("input") as HTMLInputElement;
|
||||
const prohibitAirWpnCheckbox = this.#advancedSettingsDialog.querySelector("#prohibit-air-wpn-checkbox")?.querySelector("input") as HTMLInputElement;
|
||||
const tankerCheckbox = this.#advancedSettingsDialog.querySelector("#tanker-checkbox")?.querySelector("input") as HTMLInputElement;
|
||||
const AWACSCheckbox = this.#advancedSettingsDialog.querySelector("#AWACS-checkbox")?.querySelector("input") as HTMLInputElement;
|
||||
//const tankerCheckbox = this.#advancedSettingsDialog.querySelector("#tanker-checkbox")?.querySelector("input") as HTMLInputElement;
|
||||
//const AWACSCheckbox = this.#advancedSettingsDialog.querySelector("#AWACS-checkbox")?.querySelector("input") as HTMLInputElement;
|
||||
const TACANCheckbox = this.#advancedSettingsDialog.querySelector("#TACAN-checkbox")?.querySelector("input") as HTMLInputElement;
|
||||
const TACANChannelInput = this.#advancedSettingsDialog.querySelector("#TACAN-channel")?.querySelector("input") as HTMLInputElement;
|
||||
const TACANCallsignInput = this.#advancedSettingsDialog.querySelector("#tacan-callsign")?.querySelector("input") as HTMLInputElement;
|
||||
@ -367,8 +408,8 @@ export class UnitControlPanel extends Panel {
|
||||
const radioCallsignNumberInput = this.#advancedSettingsDialog.querySelector("#radio-callsign-number")?.querySelector("input") as HTMLInputElement;
|
||||
|
||||
/* Tasking */
|
||||
const isTanker = tankerCheckbox.checked? true: false;
|
||||
const isAWACS = AWACSCheckbox.checked? true: false;
|
||||
//const isTanker = tankerCheckbox.checked? true: false;
|
||||
//const isAWACS = AWACSCheckbox.checked? true: false;
|
||||
|
||||
/* TACAN */
|
||||
const TACAN: TACAN = {
|
||||
@ -398,8 +439,9 @@ export class UnitControlPanel extends Panel {
|
||||
|
||||
/* Send command and close */
|
||||
var units = getApp().getUnitsManager().getSelectedUnits();
|
||||
// TODO: split setAdvancedOptions into setIsTanker, setIsAWACS, setAdvancedOptions
|
||||
if (units.length > 0)
|
||||
units[0].setAdvancedOptions(isTanker, isAWACS, TACAN, radio, generalSettings);
|
||||
units[0].setAdvancedOptions(units[0].getIsTanker(), units[0].getIsAWACS(), TACAN, radio, generalSettings);
|
||||
|
||||
this.#advancedSettingsDialog.classList.add("hide");
|
||||
}
|
||||
|
||||
@ -1015,6 +1015,8 @@ export class Unit extends CustomMarker {
|
||||
if (this.#onOff) {
|
||||
if (this.#isTanker)
|
||||
element.querySelector(".unit")?.setAttribute("data-state", "tanker");
|
||||
else if (this.#isAWACS)
|
||||
element.querySelector(".unit")?.setAttribute("data-state", "AWACS");
|
||||
else
|
||||
element.querySelector(".unit")?.setAttribute("data-state", this.#state.toLowerCase());
|
||||
}
|
||||
|
||||
@ -76,6 +76,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Tasking -->
|
||||
<!--
|
||||
<div id="tasking">
|
||||
<div class="ol-group">
|
||||
<h4>Tasking</h4>
|
||||
@ -96,6 +97,7 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<!-- TACAN options -->
|
||||
<div id="TACAN-options">
|
||||
|
||||
@ -61,6 +61,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="tanker-on" class="switch-control">
|
||||
<h4>Enable tanker</h4>
|
||||
<div id="tanker-on-switch" class="ol-switch"></div>
|
||||
<div>Instructs the unit to operate as AAR tanker. More options available in Settings dialog.</div>
|
||||
</div>
|
||||
|
||||
<div id="AWACS-on" class="switch-control">
|
||||
<h4>Enable AWACS</h4>
|
||||
<div id="AWACS-on-switch" class="ol-switch"></div>
|
||||
<div>Instructs the unit to operate as AWACS. More options available in Settings dialog.</div>
|
||||
</div>
|
||||
|
||||
<div id="operate-as" class="switch-control">
|
||||
<h4>Operate as</h4>
|
||||
<div id="operate-as-switch" class="ol-switch"></div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user