From 0fc8bbe1edef52df3cbf898cb7bdbdce6ffd831a Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Wed, 27 Jan 2021 03:08:46 +0100 Subject: [PATCH] Show 'about mapcomplete' on index --- Logic/UIEventSource.ts | 7 ++++++- State.ts | 3 --- index.ts | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Logic/UIEventSource.ts b/Logic/UIEventSource.ts index 18d13a5..3744ab2 100644 --- a/Logic/UIEventSource.ts +++ b/Logic/UIEventSource.ts @@ -1,3 +1,5 @@ +import {Utils} from "../Utils"; + export class UIEventSource { public data: T; @@ -6,7 +8,10 @@ export class UIEventSource { private static allSources : UIEventSource[] = UIEventSource.PrepPerf(); - static PrepPerf(){ + static PrepPerf() : UIEventSource[]{ + if(Utils.runningFromConsole){ + return []; + } // @ts-ignore window.mcperf = () => { console.log(UIEventSource.allSources.length, "uieventsources created"); diff --git a/State.ts b/State.ts index 520eb09..9e99056 100644 --- a/State.ts +++ b/State.ts @@ -28,9 +28,6 @@ export default class State { // The singleton of the global state public static state: State; - public static runningFromConsole: boolean = false; - - public readonly layoutToUse = new UIEventSource(undefined); diff --git a/index.ts b/index.ts index df1456f..48eb22d 100644 --- a/index.ts +++ b/index.ts @@ -118,10 +118,10 @@ if (layoutFromBase64.startsWith("wiki:")) { } else { // We fall through: no theme loaded: just show a few buttons State.state = new State(undefined); - new Combine([new MoreScreen(true) - .SetStyle("pointer-events: all;"), - Translations.t.general.openStreetMapIntro + new Combine([new MoreScreen(true), + Translations.t.general.aboutMapcomplete ]).SetClass("block m-5 lg:w-3/4 lg:ml-40") + .SetStyle("pointer-events: all;") .AttachTo("topleft-tools"); } window.addEventListener('contextmenu', function (e) { // Not compatible with IE < 9