mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Front end tweaks
This commit is contained in:
parent
81871b596b
commit
3c11e1c2a1
@ -391,7 +391,7 @@ class DemoDataGenerator {
|
||||
}
|
||||
|
||||
ret.mission.commandModeOptions = {
|
||||
restrictSpawns: true,
|
||||
restrictSpawns: false,
|
||||
restrictToCoalition: true,
|
||||
setupTime: 0,
|
||||
spawnPoints: {
|
||||
|
||||
@ -954,6 +954,11 @@ nav.ol-panel> :last-child {
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
#command-mode-phase.no-restrictions::after {
|
||||
content: "No spawn restrictions";
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
#command-mode-toolbar .ol-button {
|
||||
border: 1px solid white;
|
||||
}
|
||||
@ -1359,4 +1364,12 @@ input[type=number]::-webkit-outer-spin-button {
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
fill: lightgray;
|
||||
}
|
||||
|
||||
.ol-log-entry:first-of-type {
|
||||
border-top: 1px solid #FFFFFF44;
|
||||
}
|
||||
|
||||
.ol-log-entry {
|
||||
border-bottom: 1px solid #FFFFFF44;
|
||||
}
|
||||
@ -85,8 +85,9 @@ export class MissionHandler {
|
||||
commandModePhaseEl.dataset.remainingTime = remainingTime;
|
||||
}
|
||||
|
||||
commandModePhaseEl.classList.toggle("setup-phase", this.#remainingSetupTime > 0);
|
||||
commandModePhaseEl.classList.toggle("game-commenced", this.#remainingSetupTime <= 0);
|
||||
commandModePhaseEl.classList.toggle("setup-phase", this.#remainingSetupTime > 0 && this.getCommandModeOptions().restrictSpawns);
|
||||
commandModePhaseEl.classList.toggle("game-commenced", this.#remainingSetupTime <= 0 || !this.getCommandModeOptions().restrictSpawns);
|
||||
commandModePhaseEl.classList.toggle("no-restrictions", !this.getCommandModeOptions().restrictSpawns);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -334,30 +334,64 @@ export function setCommandModeOptions(restrictSpawns: boolean, restrictToCoaliti
|
||||
}
|
||||
|
||||
export function startUpdate() {
|
||||
/* On the first connection, force request of full data */
|
||||
getAirbases((data: AirbasesData) => {
|
||||
checkSessionHash(data.sessionHash);
|
||||
getMissionHandler()?.updateAirbases(data);
|
||||
return data.time;
|
||||
});
|
||||
getBullseye((data: BullseyesData) => {
|
||||
checkSessionHash(data.sessionHash);
|
||||
getMissionHandler()?.updateBullseyes(data);
|
||||
return data.time;
|
||||
});
|
||||
getMission((data: MissionData) => {
|
||||
checkSessionHash(data.sessionHash);
|
||||
getMissionHandler()?.updateMission(data);
|
||||
return data.time;
|
||||
});
|
||||
getLogs((data: any) => {
|
||||
getLogPanel().appendLogs(data.logs)
|
||||
return data.time;
|
||||
});
|
||||
getUnits((buffer: ArrayBuffer) => {return getUnitsManager()?.update(buffer), true /* Does a full refresh */});
|
||||
window.setInterval(() => {
|
||||
if (!getPaused()) {
|
||||
getAirbases((data: AirbasesData) => {
|
||||
checkSessionHash(data.sessionHash);
|
||||
getMissionHandler()?.updateAirbases(data);
|
||||
return data.time;
|
||||
});
|
||||
}
|
||||
}, 10000);
|
||||
|
||||
requestUpdate();
|
||||
requestRefresh();
|
||||
window.setInterval(() => {
|
||||
if (!getPaused()){
|
||||
getBullseye((data: BullseyesData) => {
|
||||
checkSessionHash(data.sessionHash);
|
||||
getMissionHandler()?.updateBullseyes(data);
|
||||
return data.time;
|
||||
});
|
||||
}
|
||||
}, 10000);
|
||||
|
||||
window.setInterval(() => {
|
||||
if (!getPaused()) {
|
||||
getMission((data: MissionData) => {
|
||||
checkSessionHash(data.sessionHash);
|
||||
getMissionHandler()?.updateMission(data);
|
||||
return data.time;
|
||||
});
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
window.setInterval(() => {
|
||||
if (!getPaused()) {
|
||||
getLogs((data: any) => {
|
||||
checkSessionHash(data.sessionHash);
|
||||
getLogPanel().appendLogs(data.logs)
|
||||
return data.time;
|
||||
});
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
window.setInterval(() => {
|
||||
if (!getPaused()) {
|
||||
getUnits((buffer: ArrayBuffer) => {
|
||||
var time = getUnitsManager()?.update(buffer);
|
||||
return time;
|
||||
}, false);
|
||||
}
|
||||
}, 250);
|
||||
|
||||
window.setInterval(() => {
|
||||
if (!getPaused()) {
|
||||
getUnits((buffer: ArrayBuffer) => {
|
||||
var time = getUnitsManager()?.update(buffer);
|
||||
return time;
|
||||
}, false);
|
||||
getConnectionStatusPanel()?.update(getConnected());
|
||||
}
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
export function requestUpdate() {
|
||||
@ -365,38 +399,7 @@ export function requestUpdate() {
|
||||
if (!getPaused()) {
|
||||
getUnits((buffer: ArrayBuffer) => { return getUnitsManager()?.update(buffer); }, false);
|
||||
}
|
||||
window.setTimeout(() => requestUpdate(), getConnected() ? 250 : 1000);
|
||||
|
||||
getConnectionStatusPanel()?.update(getConnected());
|
||||
}
|
||||
|
||||
export function requestRefresh() {
|
||||
/* Main refresh rate = 5000ms. */
|
||||
if (!getPaused()) {
|
||||
getAirbases((data: AirbasesData) => {
|
||||
checkSessionHash(data.sessionHash);
|
||||
getMissionHandler()?.updateAirbases(data);
|
||||
return data.time;
|
||||
});
|
||||
getBullseye((data: BullseyesData) => {
|
||||
checkSessionHash(data.sessionHash);
|
||||
getMissionHandler()?.updateBullseyes(data);
|
||||
return data.time;
|
||||
});
|
||||
getMission((data: MissionData) => {
|
||||
checkSessionHash(data.sessionHash);
|
||||
getMissionHandler()?.updateMission(data);
|
||||
return data.time;
|
||||
});
|
||||
getLogs((data: any) => {
|
||||
getLogPanel().appendLogs(data.logs)
|
||||
return data.time;
|
||||
});
|
||||
|
||||
// Update the list of existing units
|
||||
getUnitDataTable()?.update();
|
||||
}
|
||||
window.setTimeout(() => requestRefresh(), 1000);
|
||||
window.setTimeout(() => requestUpdate(), getConnected() ? 250 : 1000);
|
||||
}
|
||||
|
||||
export function checkSessionHash(newSessionHash: string) {
|
||||
|
||||
@ -237,7 +237,7 @@
|
||||
<div class="ol-dialog-close" data-on-click="closeDialog"></div>
|
||||
|
||||
<div class="ol-dialog-header">
|
||||
<h3 id="unit-name">command-mode mode settings</h3>
|
||||
<h3 id="unit-name">Command mode settings</h3>
|
||||
</div>
|
||||
|
||||
<div class="ol-dialog-content">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user