ATC now 'live'; added visual improvemnts.

This commit is contained in:
PeekabooSteam 2023-05-20 22:17:04 +01:00
parent 2b155c4ed3
commit 05a8085e06
4 changed files with 32 additions and 16 deletions

View File

@ -1,4 +1,8 @@
.ol-strip-board .ol-dialog-header {
align-items: center;
display:flex;
justify-content: space-between;
}
.ol-strip-board-strips {
display:flex;
@ -178,6 +182,7 @@
.ol-strip-board-add-flight .ol-auto-suggest[data-has-suggestions] {
display:flex;
row-gap: 4px;
}
.ol-strip-board-add-flight .ol-auto-suggest[data-has-suggestions] a {
@ -192,4 +197,9 @@
[data-board-type="tower"] {
right:10px;
top:10px;
}
[data-board-type="tower"] .ol-auto-suggest {
top:30px;
translate:0;
}

View File

@ -1,7 +1,7 @@
export interface FeatureSwitchInterface {
"defaultEnabled": boolean, // default on/off state (if allowed by masterSwitch)
"defaultEnabled": boolean, // default on/off state (if allowed by forceState)
"forceState": number, // -1 don't force; 0 force off; 1 force on
"label": string,
"masterSwitch": boolean, // on/off regardless of user preference
"name": string,
"onEnabled"?: CallableFunction,
"options"?: object,
@ -13,8 +13,8 @@ class FeatureSwitch {
// From config param
defaultEnabled;
forceState = -1;
label;
masterSwitch;
name;
onEnabled;
removeArtifactsIfDisabled = true;
@ -26,8 +26,8 @@ class FeatureSwitch {
constructor( config:FeatureSwitchInterface ) {
this.defaultEnabled = config.defaultEnabled;
this.forceState = config.forceState;
this.label = config.label;
this.masterSwitch = config.masterSwitch;
this.name = config.name;
this.onEnabled = config.onEnabled;
@ -47,10 +47,14 @@ class FeatureSwitch {
isEnabled() {
if ( !this.masterSwitch ) {
if ( this.forceState === 0 ) {
return false;
}
if ( this.forceState === 1 ) {
return true;
}
return this.userPreference;
}
@ -62,37 +66,37 @@ export class FeatureSwitches {
new FeatureSwitch({
"defaultEnabled": false,
"forceState": -1,
"label": "AIC",
"masterSwitch": true,
"name": "aic"
}),
new FeatureSwitch({
"defaultEnabled": false,
"forceState": -1,
"label": "AI Formations",
"masterSwitch": true,
"name": "ai-formations",
"removeArtifactsIfDisabled": false
}),
new FeatureSwitch({
"defaultEnabled": false,
"forceState": 1,
"label": "ATC",
"masterSwitch": true,
"name": "atc"
}),
new FeatureSwitch({
"defaultEnabled": false,
"forceState": -1,
"label": "Force show unit control panel",
"masterSwitch": true,
"name": "forceShowUnitControlPanel"
}),
new FeatureSwitch({
"defaultEnabled": true,
"forceState": -1,
"label": "Show splash screen",
"masterSwitch": true,
"name": "splashScreen"
})

View File

@ -128,8 +128,13 @@ export class MissionHandler
getNowDate() {
const date = this.getDate();
const time = this.getTime();
if ( !date ) {
return new Date();
}
let year = date.Year;
let month = date.Month - 1;

View File

@ -1,9 +1,10 @@
<div id="<%= boardId %>" class="ol-panel ol-dialog ol-strip-board ol-draggable" data-board-type="<%= boardType %>" data-feature-switch="atc">
<div id="<%= boardId %>" class="ol-panel ol-dialog ol-strip-board ol-draggable hide" data-board-type="<%= boardType %>" data-feature-switch="atc">
<div class="ol-dialog-close" data-on-click="closeDialog"></div>
<div class="ol-dialog-header">
<h3><%= boardType %></h3>
<%- include('addflight.ejs') %>
<div class="ol-strip-board-clock"></div>
</div>
@ -18,8 +19,4 @@
<div class="ol-strip-board-strips ol-sortable"></div>
</div>
<div class="ol-dialog-footer">
<%- include('addflight.ejs') %>
</div>
</div>