From 26af842da6f48b68abb3d0611fb513e6dc8bbeeb Mon Sep 17 00:00:00 2001 From: hydrant Date: Wed, 1 May 2019 18:23:58 +0200 Subject: [PATCH] add global data (is logged in) --- ReallifeGamemode.Client/Login/main.ts | 4 +++- ReallifeGamemode.Client/global.d.ts | 3 ++- ReallifeGamemode.Client/index.ts | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ReallifeGamemode.Client/Login/main.ts b/ReallifeGamemode.Client/Login/main.ts index d04654f7..4733fe7f 100644 --- a/ReallifeGamemode.Client/Login/main.ts +++ b/ReallifeGamemode.Client/Login/main.ts @@ -4,7 +4,7 @@ * @copyright (c) 2008 - 2018 Life of German */ -export default function(): void { +export default function(globalData: GlobalData): void { var loginBrowser: BrowserMp; var loginCam: CameraMp = mp.cameras.new('login', new mp.Vector3(-1883.736, -781.4911, 78.27616), new mp.Vector3(3.185999, 0, -79.59519), 40); @@ -52,6 +52,8 @@ export default function(): void { mp.game.ui.displayHud(true); mp.game.ui.displayRadar(true); + globalData.LoggedIn = true; + loginCam.setActive(false); mp.game.cam.renderScriptCams(false, false, 0, true, false); }); diff --git a/ReallifeGamemode.Client/global.d.ts b/ReallifeGamemode.Client/global.d.ts index cd747289..359d27a7 100644 --- a/ReallifeGamemode.Client/global.d.ts +++ b/ReallifeGamemode.Client/global.d.ts @@ -2,7 +2,8 @@ InTuning: boolean, HideGui: boolean, Interaction: boolean, - InChat: boolean + InChat: boolean, + LoggedIn: boolean } declare interface FactionRanks { diff --git a/ReallifeGamemode.Client/index.ts b/ReallifeGamemode.Client/index.ts index 5224bf29..52447420 100644 --- a/ReallifeGamemode.Client/index.ts +++ b/ReallifeGamemode.Client/index.ts @@ -9,6 +9,7 @@ let globalData: GlobalData = { HideGui: false, Interaction: false, InChat: false, + LoggedIn = false }; import voice from './Voice/main'; @@ -66,7 +67,7 @@ import playerInteraction from './Interaction/playerinteraction'; playerInteraction(globalData); import Login from './Login/main'; -Login(); +Login(globalData); import dutyCloth from './Player/dutycloth'; dutyCloth();