mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Merge branch 'main' of https://github.com/Pax1601/DCSOlympus
This commit is contained in:
commit
ec9ef2b0fb
@ -35,7 +35,7 @@ class DemoDataGenerator {
|
||||
|
||||
|
||||
let baseData = { alive: true, human: false, controlled: true, coalition: 2, country: 0, unitName: "Cool guy", groupName: "Cool group 1", state: 13, task: "Being cool!",
|
||||
hasTask: true, position: { lat: 37, lng: -116, alt: 1000 }, speed: 200, horizontalVelocity: 200, verticalVelicity: 0, heading: 45, isActiveTanker: false, isActiveAWACS: false, onOff: true, followRoads: false, fuel: 50,
|
||||
hasTask: true, position: { lat: 37, lng: -116, alt: 1000 }, speed: 200, horizontalVelocity: 200, verticalVelicity: 0, heading: 45, track: 45, isActiveTanker: false, isActiveAWACS: 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: 0,
|
||||
@ -165,48 +165,50 @@ class DemoDataGenerator {
|
||||
if (req.query["time"] == 0){
|
||||
for (let idx in DEMO_UNIT_DATA) {
|
||||
const unit = DEMO_UNIT_DATA[idx];
|
||||
var dataIndex = 1;
|
||||
array = this.concat(array, this.uint32ToByteArray(idx));
|
||||
array = this.appendString(array, unit.category, 1);
|
||||
array = this.appendUint8(array, unit.alive, 2);
|
||||
array = this.appendUint8(array, unit.human, 3);
|
||||
array = this.appendUint8(array, unit.controlled, 4);
|
||||
array = this.appendUint16(array, unit.coalition, 5);
|
||||
array = this.appendUint8(array, unit.country, 6);
|
||||
array = this.appendString(array, unit.name, 7);
|
||||
array = this.appendString(array, unit.unitName, 8);
|
||||
array = this.appendString(array, unit.groupName, 9);
|
||||
array = this.appendUint8(array, unit.state, 10);
|
||||
array = this.appendString(array, unit.task, 11);
|
||||
array = this.appendUint8(array, unit.hasTask, 12);
|
||||
array = this.appendCoordinates(array, unit.position, 13);
|
||||
array = this.appendDouble(array, unit.speed, 14);
|
||||
array = this.appendDouble(array, unit.horizontalVelocity, 15);
|
||||
array = this.appendDouble(array, unit.verticalVelicity, 16);
|
||||
array = this.appendDouble(array, unit.heading, 17);
|
||||
array = this.appendUint8(array, unit.isActiveTanker, 18);
|
||||
array = this.appendUint8(array, unit.isActiveAWACS, 19);
|
||||
array = this.appendUint8(array, unit.onOff, 20);
|
||||
array = this.appendUint8(array, unit.followRoads, 21);
|
||||
array = this.appendUint16(array, unit.fuel, 22);
|
||||
array = this.appendDouble(array, unit.desiredSpeed, 23);
|
||||
array = this.appendUint8(array, unit.desiredSpeedType, 24);
|
||||
array = this.appendDouble(array, unit.desiredAltitude, 25);
|
||||
array = this.appendUint8(array, unit.desiredAltitudeType, 26);
|
||||
array = this.appendUint32(array, unit.leaderID, 27);
|
||||
array = this.appendOffset(array, unit.formationOffset, 28);
|
||||
array = this.appendUint32(array, unit.targetID, 29);
|
||||
array = this.appendCoordinates(array, unit.targetPosition, 30);
|
||||
array = this.appendUint8(array, unit.ROE, 31);
|
||||
array = this.appendUint8(array, unit.reactionToThreat, 32);
|
||||
array = this.appendUint8(array, unit.emissionsCountermeasures, 33);
|
||||
array = this.appendTACAN(array, unit.TACAN, 34);
|
||||
array = this.appendRadio(array, unit.radio, 35);
|
||||
array = this.appendRadio(array, unit.generalSettings, 36);
|
||||
array = this.appendAmmo(array, unit.ammo, 37);
|
||||
array = this.appendContacts(array, unit.contacts, 38);
|
||||
array = this.appendActivePath(array, unit.activePath, 39);
|
||||
array = this.appendUint8(array, unit.isLeader, 40);
|
||||
array = this.appendUint8(array, unit.operateAs, 41);
|
||||
array = this.appendString(array, unit.category, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.alive, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.human, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.controlled, dataIndex); dataIndex++;
|
||||
array = this.appendUint16(array, unit.coalition, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.country, dataIndex); dataIndex++;
|
||||
array = this.appendString(array, unit.name, dataIndex); dataIndex++;
|
||||
array = this.appendString(array, unit.unitName, dataIndex); dataIndex++;
|
||||
array = this.appendString(array, unit.groupName, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.state, dataIndex); dataIndex++;
|
||||
array = this.appendString(array, unit.task, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.hasTask, dataIndex); dataIndex++;
|
||||
array = this.appendCoordinates(array, unit.position, dataIndex); dataIndex++;
|
||||
array = this.appendDouble(array, unit.speed, dataIndex); dataIndex++;
|
||||
array = this.appendDouble(array, unit.horizontalVelocity, dataIndex); dataIndex++;
|
||||
array = this.appendDouble(array, unit.verticalVelicity, dataIndex); dataIndex++;
|
||||
array = this.appendDouble(array, unit.heading, dataIndex); dataIndex++;
|
||||
array = this.appendDouble(array, unit.track, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.isActiveTanker, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.isActiveAWACS, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.onOff, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.followRoads, dataIndex); dataIndex++;
|
||||
array = this.appendUint16(array, unit.fuel, dataIndex); dataIndex++;
|
||||
array = this.appendDouble(array, unit.desiredSpeed, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.desiredSpeedType, dataIndex); dataIndex++;
|
||||
array = this.appendDouble(array, unit.desiredAltitude, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.desiredAltitudeType, dataIndex); dataIndex++;
|
||||
array = this.appendUint32(array, unit.leaderID, dataIndex); dataIndex++;
|
||||
array = this.appendOffset(array, unit.formationOffset, dataIndex); dataIndex++;
|
||||
array = this.appendUint32(array, unit.targetID, dataIndex); dataIndex++;
|
||||
array = this.appendCoordinates(array, unit.targetPosition, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.ROE, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.reactionToThreat, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.emissionsCountermeasures, dataIndex); dataIndex++;
|
||||
array = this.appendTACAN(array, unit.TACAN, dataIndex); dataIndex++;
|
||||
array = this.appendRadio(array, unit.radio, dataIndex); dataIndex++;
|
||||
array = this.appendRadio(array, unit.generalSettings, dataIndex); dataIndex++;
|
||||
array = this.appendAmmo(array, unit.ammo, dataIndex); dataIndex++;
|
||||
array = this.appendContacts(array, unit.contacts, dataIndex); dataIndex++;
|
||||
array = this.appendActivePath(array, unit.activePath, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.isLeader, dataIndex); dataIndex++;
|
||||
array = this.appendUint8(array, unit.operateAs, dataIndex); dataIndex++;
|
||||
array = this.concat(array, this.uint8ToByteArray(255));
|
||||
}
|
||||
}
|
||||
|
||||
@ -200,12 +200,6 @@
|
||||
display: flex;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
50% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
[data-object|="unit"][data-has-low-fuel] .unit-fuel, [data-object|="unit"][data-has-low-health] .unit-health {
|
||||
animation: pulse 1.5s linear infinite;
|
||||
}
|
||||
|
||||
@ -50,15 +50,6 @@
|
||||
animation: pulse 1s infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
#connection-status-panel[data-is-paused] #connection-status-light {
|
||||
background: var(--accent-amber);
|
||||
}
|
||||
@ -62,9 +62,6 @@ body.feature-forceShowUnitControlPanel #unit-control-panel {
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#unit-control-panel {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
@ -828,11 +828,11 @@ nav.ol-panel> :last-child {
|
||||
justify-content: space-between;
|
||||
min-height: 75px;
|
||||
text-indent: 85px;
|
||||
row-gap: 5px;
|
||||
}
|
||||
|
||||
#splash-content #app-summary>* {
|
||||
height: fit-content;
|
||||
line-height: 25px;
|
||||
padding: 2px;
|
||||
white-space: nowrap;
|
||||
width: fit-content;
|
||||
@ -840,6 +840,15 @@ nav.ol-panel> :last-child {
|
||||
|
||||
#splash-content .app-version {
|
||||
font-size: 11px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
#splash-content .new-version {
|
||||
animation: pulse 1.5s linear infinite;
|
||||
}
|
||||
|
||||
#splash-content .app-version:first-of-type {
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
#splash-content #legal-stuff {
|
||||
@ -903,13 +912,7 @@ nav.ol-panel> :last-child {
|
||||
#loading-screen div {
|
||||
color: white;
|
||||
font-size: 18px;
|
||||
animation: blinker 3s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes blinker {
|
||||
50% {
|
||||
opacity: 0;
|
||||
}
|
||||
animation: pulse 3s linear infinite;
|
||||
}
|
||||
|
||||
.fade-out {
|
||||
@ -1676,4 +1679,10 @@ input[type=number]::-webkit-outer-spin-button {
|
||||
|
||||
.file-import-export .ol-dialog-footer button:first-of-type{
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
50% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@ -29,9 +29,12 @@ import { UnitListPanel } from "./panels/unitlistpanel";
|
||||
import { ContextManager } from "./context/contextmanager";
|
||||
import { Context } from "./context/context";
|
||||
|
||||
var VERSION = "v0.4.8-alpha";
|
||||
|
||||
export class OlympusApp {
|
||||
/* Global data */
|
||||
#activeCoalition: string = "blue";
|
||||
#latestVersion: string|undefined = undefined;
|
||||
|
||||
/* Main leaflet map, extended by custom methods */
|
||||
#map: Map | null = null;
|
||||
@ -178,7 +181,6 @@ export class OlympusApp {
|
||||
|
||||
start() {
|
||||
/* Initialize base functionalitites */
|
||||
|
||||
this.#contextManager = new ContextManager();
|
||||
this.#contextManager.add( "olympus", {} );
|
||||
|
||||
@ -245,8 +247,26 @@ export class OlympusApp {
|
||||
let loadingScreen = document.getElementById("loading-screen") as HTMLElement;
|
||||
loadingScreen.classList.add("fade-out");
|
||||
window.setInterval(() => { loadingScreen.classList.add("hide"); }, 1000);
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
/* Check if we are running the latest version */
|
||||
const request = new Request("https://raw.githubusercontent.com/Pax1601/DCSOlympus/main/version.json");
|
||||
fetch(request).then((response) => {
|
||||
if (response.status === 200) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error("Error connecting to Github to retrieve latest version");
|
||||
}
|
||||
}).then((res) => {
|
||||
this.#latestVersion = res["version"];
|
||||
const latestVersionSpan = document.getElementById("latest-version") as HTMLElement;
|
||||
if (latestVersionSpan) {
|
||||
latestVersionSpan.innerHTML = this.#latestVersion ?? "Unknown";
|
||||
if (this.#latestVersion !== VERSION) {
|
||||
latestVersionSpan.classList.add("new-version");
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
#setupEvents() {
|
||||
@ -436,7 +456,6 @@ export class OlympusApp {
|
||||
console.error("Unable to find login form.");
|
||||
}
|
||||
|
||||
|
||||
/* Reload the page, used to mimic a restart of the app */
|
||||
document.addEventListener("reloadPage", () => {
|
||||
location.reload();
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
<h2>DCS Olympus</h2>
|
||||
<h4>Dynamic Unit Command</h4>
|
||||
<div class="app-version">Version <span class="app-version-number">v0.4.8-alpha</span></div>
|
||||
<div class="app-version">Latest version <span id="latest-version" class="app-version-number"></span></div>
|
||||
</div>
|
||||
|
||||
<form id="authentication-form">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user