mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
User now alerted when server is paused.
This commit is contained in:
@@ -17,3 +17,24 @@
|
|||||||
#connection-status-panel[data-is-connected] dd::after {
|
#connection-status-panel[data-is-connected] dd::after {
|
||||||
background: var(--accent-green);
|
background: var(--accent-green);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#connection-status-panel[data-is-paused] dt::before {
|
||||||
|
content: "Server paused";
|
||||||
|
}
|
||||||
|
|
||||||
|
#connection-status-panel[data-is-paused] dd {
|
||||||
|
animation: pulse 1s infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes pulse {
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#connection-status-panel[data-is-paused] dd::after {
|
||||||
|
background: var(--accent-amber);
|
||||||
|
}
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
--unit-background-red: #FF5858;
|
--unit-background-red: #FF5858;
|
||||||
|
|
||||||
/*** UI Colours **/
|
/*** UI Colours **/
|
||||||
|
--accent-amber: #ffd828;
|
||||||
--accent-green: #8bff63;
|
--accent-green: #8bff63;
|
||||||
--accent-light-blue: #5ca7ff;
|
--accent-light-blue: #5ca7ff;
|
||||||
--transparent-accent-light-blue: rgba(92, 167, 255, .33);
|
--transparent-accent-light-blue: rgba(92, 167, 255, .33);
|
||||||
|
|||||||
@@ -1,12 +1,36 @@
|
|||||||
|
import { getApp } from "..";
|
||||||
import { Panel } from "./panel";
|
import { Panel } from "./panel";
|
||||||
|
|
||||||
export class ConnectionStatusPanel extends Panel {
|
export class ConnectionStatusPanel extends Panel {
|
||||||
|
|
||||||
|
#previousMissionElapsedTime:number = 0;
|
||||||
|
|
||||||
constructor(ID: string) {
|
constructor(ID: string) {
|
||||||
super( ID );
|
super( ID );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
update(connected: boolean) {
|
update(connected: boolean) {
|
||||||
this.getElement().toggleAttribute( "data-is-connected", connected );
|
|
||||||
|
if ( connected ) {
|
||||||
|
|
||||||
|
const missionElapsedTime = getApp().getMissionManager().getDateAndTime().elapsedTime;
|
||||||
|
|
||||||
|
if ( missionElapsedTime === this.#previousMissionElapsedTime ) {
|
||||||
|
this.getElement().toggleAttribute( "data-is-connected", false );
|
||||||
|
this.getElement().toggleAttribute( "data-is-paused", true );
|
||||||
|
} else {
|
||||||
|
this.getElement().toggleAttribute( "data-is-connected", true );
|
||||||
|
this.getElement().toggleAttribute( "data-is-paused", false );
|
||||||
|
}
|
||||||
|
|
||||||
|
this.#previousMissionElapsedTime = missionElapsedTime;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.getElement().toggleAttribute( "data-is-connected", false );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user