mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
ATC clocks now synched to mission time
This commit is contained in:
@@ -16,6 +16,14 @@ export class MissionHandler
|
||||
#airbasesMarkers: {[name: string]: Airbase};
|
||||
#theatre : string = "";
|
||||
|
||||
// Time
|
||||
#date : any;
|
||||
#elapsedTime : any;
|
||||
#startTime : any;
|
||||
#time : any;
|
||||
|
||||
#updateTime : any;
|
||||
|
||||
constructor()
|
||||
{
|
||||
this.#bullseyes = undefined;
|
||||
@@ -50,7 +58,30 @@ export class MissionHandler
|
||||
|
||||
getInfoPopup().setText("Map set to " + this.#theatre);
|
||||
}
|
||||
|
||||
if ( "date" in data.mission ) {
|
||||
this.#date = data.mission.date;
|
||||
}
|
||||
|
||||
if ( "elapsedTime" in data.mission ) {
|
||||
this.#elapsedTime = data.mission.elapsedTime;
|
||||
}
|
||||
|
||||
if ( "startTime" in data.mission ) {
|
||||
this.#startTime = data.mission.startTime;
|
||||
}
|
||||
|
||||
if ( "time" in data.mission ) {
|
||||
this.#time = data.mission.time;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ( "time" in data ) {
|
||||
this.#updateTime = data.time;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
getBullseyes()
|
||||
@@ -90,6 +121,38 @@ export class MissionHandler
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
getDate() {
|
||||
return this.#date;
|
||||
}
|
||||
|
||||
|
||||
getNowDate() {
|
||||
const date = this.getDate();
|
||||
const time = this.getTime();
|
||||
|
||||
let year = date.Year;
|
||||
let month = date.Month - 1;
|
||||
|
||||
if ( month < 0 ) {
|
||||
month = 11;
|
||||
year--;
|
||||
}
|
||||
|
||||
return new Date( year, month, date.Day, time.h, time.m, time.s );
|
||||
}
|
||||
|
||||
|
||||
getTime() {
|
||||
return this.#time;
|
||||
}
|
||||
|
||||
|
||||
getUpdateTime() {
|
||||
return this.#updateTime;
|
||||
}
|
||||
|
||||
|
||||
#onAirbaseClick(e: any)
|
||||
{
|
||||
getMap().showAirbaseContextMenu(e, e.sourceTarget);
|
||||
|
||||
Reference in New Issue
Block a user