Implemented buttons to apply advanced controls directly to units

This commit is contained in:
Pax1601
2023-11-08 23:33:27 +01:00
parent b9830f0190
commit 9caee0c77c
16 changed files with 276 additions and 95 deletions

View File

@@ -1,7 +1,7 @@
<div id="unit-control-panel" oncontextmenu="return false;">
<div class="ol-panel"><img src="resources/theme/images/icons/gamepad-solid.svg" inject-svg></div>
<div class="ol-panel ol-panel-padding-lg ol-scrollable" id="unit-control-panel-content">
<div class="ol-panel ol-panel-padding-lg" id="unit-control-panel-content">
<h3>Selected Units</h3>
<div id="unit-selection">
@@ -14,100 +14,108 @@
<hr />
<div id="flight-data">
<h4>Controls</h4>
<div id="speed-slider" class="ol-slider-container flight-control-ol-slider">
<dl class="ol-data-grid">
<dt>Speed</dt>
<dd>
<div class="ol-slider-value"></div>
<div id="speed-type-switch" class="ol-switch"></div>
</dd>
</dl>
<input type="range" min="0" max="100" value="0" class="ol-slider">
<div class="ol-slider-min-max"></div>
<div id="unit-controls" class="ol-scrollable">
<div id="flight-data">
<h4>Controls</h4>
<div id="speed-slider" class="ol-slider-container flight-control-ol-slider">
<dl class="ol-data-grid">
<dt>Speed</dt>
<dd>
<div class="ol-slider-value"></div>
<div id="speed-type-switch" class="ol-switch"></div>
</dd>
</dl>
<input type="range" min="0" max="100" value="0" class="ol-slider">
<div class="ol-slider-min-max"></div>
</div>
<div id="altitude-slider" class="ol-slider-container flight-control-ol-slider">
<dl class="ol-data-grid">
<dt> Altitude
</dt>
<dd>
<div class="ol-slider-value"></div>
<div id="altitude-type-switch" class="ol-switch"></div>
</dd>
</dl>
<input type="range" min="0" max="100" value="0" class="ol-slider">
<div class="ol-slider-min-max"></div>
</div>
<h5 id="categories-tooltip">Multiple categories selected</h5>
</div>
<div id="altitude-slider" class="ol-slider-container flight-control-ol-slider">
<dl class="ol-data-grid">
<dt> Altitude
</dt>
<dd>
<div class="ol-slider-value"></div>
<div id="altitude-type-switch" class="ol-switch"></div>
</dd>
</dl>
<input type="range" min="0" max="100" value="0" class="ol-slider">
<div class="ol-slider-min-max"></div>
<div id="roe">
<h4>Rules of engagement</h4>
<div id="roe-buttons-container" class="ol-group ol-button-box ol-option-button">
<!-- This is where the roe buttons will be shown -->
</div>
</div>
<h5 id="categories-tooltip">Multiple categories selected</h5>
</div>
<div id="roe">
<h4>Rules of engagement</h4>
<div id="roe-buttons-container" class="ol-group ol-button-box ol-option-button">
<!-- This is where the roe buttons will be shown -->
<div id="threat">
<h4>Reaction to threat</h4>
<div id="reaction-to-threat-buttons-container" class="ol-group ol-button-box ol-option-button">
<!-- This is where the reaction to threat buttons will be shown -->
</div>
</div>
</div>
<div id="threat">
<h4>Reaction to threat</h4>
<div id="reaction-to-threat-buttons-container" class="ol-group ol-button-box ol-option-button">
<!-- This is where the reaction to threat buttons will be shown -->
<div id="emissions-countermeasures">
<h4>Radar & ECM</h4>
<div id="emissions-countermeasures-buttons-container" class="ol-group ol-button-box ol-option-button">
<!-- This is where the emissions/countermeasures buttons will be shown -->
</div>
</div>
</div>
<div id="emissions-countermeasures">
<h4>Radar & ECM</h4>
<div id="emissions-countermeasures-buttons-container" class="ol-group ol-button-box ol-option-button">
<!-- This is where the emissions/countermeasures buttons will be shown -->
<div id="shots-scatter">
<h4>Shots scatter</h4>
<div id="shots-scatter-buttons-container" class="ol-group ol-button-box ol-option-button">
<!-- This is where the shots scatter buttons will be shown -->
</div>
</div>
</div>
<div id="shots-scatter">
<h4>Shots scatter</h4>
<div id="shots-scatter-buttons-container" class="ol-group ol-button-box ol-option-button">
<!-- This is where the shots scatter buttons will be shown -->
<div id="shots-intensity">
<h4>Shots intensity</h4>
<div id="shots-intensity-buttons-container" class="ol-group ol-button-box ol-option-button">
<!-- This is where the shots intensity buttons will be shown -->
</div>
</div>
</div>
<div id="shots-intensity">
<h4>Shots intensity</h4>
<div id="shots-intensity-buttons-container" class="ol-group ol-button-box ol-option-button">
<!-- This is where the shots intensity buttons will be shown -->
<div id="tanker-on" class="switch-control">
<h4>Enable tanker <img src="/resources/theme/images/icons/circle-question-regular.svg" title="Instructs the unit to operate as AAR tanker. A/A TACAN, radio frequency and callsign set in Settings dialog."></h4>
<div id="tanker-on-switch" class="ol-switch"></div>
</div>
</div>
<div id="tanker-on" class="switch-control">
<h4>Enable tanker <img src="/resources/theme/images/icons/circle-question-regular.svg" title="Instructs the unit to operate as AAR tanker. A/A TACAN, radio frequency and callsign set in Settings dialog."></h4>
<div id="tanker-on-switch" class="ol-switch"></div>
</div>
<div id="AWACS-on" class="switch-control">
<h4>Airborne Early Warning <img src="/resources/theme/images/icons/circle-question-regular.svg" title="Enables datalink and AI radio calls. Radio frequency and callsign set in Settings dialog."></h4>
<div id="AWACS-on-switch" class="ol-switch"></div>
</div>
<div id="AWACS-on" class="switch-control">
<h4>Airborne Early Warning <img src="/resources/theme/images/icons/circle-question-regular.svg" title="Enables datalink and AI radio calls. Radio frequency and callsign set in Settings dialog."></h4>
<div id="AWACS-on-switch" class="ol-switch"></div>
</div>
<div id="operate-as" class="switch-control">
<h4>Operate as <img src="/resources/theme/images/icons/circle-question-regular.svg" title="Determines if the unit will target red or blue units when performing scenic tasks."></h4>
<div id="operate-as-switch" class="ol-switch"></div>
</div>
<div id="operate-as" class="switch-control">
<h4>Operate as <img src="/resources/theme/images/icons/circle-question-regular.svg" title="Determines if the unit will target red or blue units when performing scenic tasks."></h4>
<div id="operate-as-switch" class="ol-switch"></div>
</div>
<div id="ai-on-off" class="switch-control">
<h4>Unit active <img src="/resources/theme/images/icons/circle-question-regular.svg" title="Toggling this disables unit AI completely. It will no longer move, react or emit radio waves."></h4>
<div id="on-off-switch" class="ol-switch" title=""></div>
</div>
<div id="ai-on-off" class="switch-control">
<h4>Unit active <img src="/resources/theme/images/icons/circle-question-regular.svg" title="Toggling this disables unit AI completely. It will no longer move, react or emit radio waves."></h4>
<div id="on-off-switch" class="ol-switch" title=""></div>
</div>
<div id="follow-roads" class="switch-control">
<h4>Follow roads <img src="/resources/theme/images/icons/circle-question-regular.svg" title=""></h4>
<div id="follow-roads-switch" class="ol-switch"></div>
<div id="follow-roads" class="switch-control">
<h4>Follow roads <img src="/resources/theme/images/icons/circle-question-regular.svg" title=""></h4>
<div id="follow-roads-switch" class="ol-switch"></div>
</div>
</div>
<hr />
<div id="advanced-settings-div">
<button id="advanced-settings-button" class="ol-button-settings" data-on-click="showAdvancedSettings">Settings</button>
<button class="ol-button-warning" data-on-click="deleteSelectedUnits"><img src="/resources/theme/images/icons/trash-can-regular.svg" inject-svg>Delete</button>
<button class="ol-button-warning" data-on-click="explodeSelectedUnits"><img src="/resources/theme/images/icons/explosion-solid.svg" inject-svg></button>
<button class="ol-button-warning" data-on-click="deleteSelectedUnits" title="Immediately remove the unit from the simulation"><img src="/resources/theme/images/icons/trash-can-regular.svg" inject-svg>Delete</button>
<div id="explosion-types-selector">
<button class="ol-button-warning" data-on-click="explodeSelectedUnits" data-on-click-params='{ "type": "secondary" }' title="Explode the unit (secondary explosions, the unit will keep exploding at interval simulating ammunition cooking)"><img src="/resources/theme/images/icons/secondaries.svg" inject-svg></button>
<button class="ol-button-warning" data-on-click="explodeSelectedUnits" data-on-click-params='{ "type": "phosphorous" }' title="Explode the unit (white phosphorous)"><img src="/resources/theme/images/icons/white-phosphorous.svg" inject-svg></button>
<button class="ol-button-warning" data-on-click="explodeSelectedUnits" data-on-click-params='{ "type": "napalm" }' title="Explode the unit (napalm)"><img src="/resources/theme/images/icons/napalm.svg" inject-svg></button>
<button class="ol-button-warning" data-on-click="explodeSelectedUnits" data-on-click-params='{ "type": "normal" }' title="Explode the unit (normal explosion)"><img src="/resources/theme/images/icons/explosion-solid.svg" inject-svg></button>
</div>
</div>
</div>
<div id="rapid-controls" class="ol-panel">