Exemple #1
0
        public override void OnEnabled(GameState previousState)
        {
            var settings     = _iocContainer.Get <SettingsComponent>();
            var inputManager = _iocContainer.Get <InputsManager>();

            inputManager.MouseManager.MouseCapture = false;
            settings.isGameRunning = this.PreviousGameState == StatesManager.GetByName("InGameMenu");
        }
Exemple #2
0
        public override void Initialize(SharpDX.Direct3D11.DeviceContext context)
        {
            var startUpComponent = _iocContainer.Get <StartUpComponent>();
            var inputsManager    = _iocContainer.Get <InputsManager>();

            _webApi = _iocContainer.Get <ClientWebApi>();

            inputsManager.KeyboardManager.IsRunning = true;

            //Get the list of Slides
            List <FileInfo> slides = new List <FileInfo>();

            foreach (var slide in Directory.GetFiles(@"Images\StartUpSlides\", "StartUpSlide*.*"))
            {
                slides.Add(new FileInfo(slide));
            }

            startUpComponent.SetSlideShows(slides.ToArray(), 3000);

            startUpComponent.SlideShowFinished += StartUpComponentSlideShowFinished;

            //Prepare Async SystemComponentState
            GameState systemComponentState = StatesManager.GetByName("SystemComponents");

            systemComponentState.StateInitialized += SystemComponentStateStateInitialized;

            StatesManager.PrepareStateAsync(systemComponentState);

            _webApi.TokenVerified += WebApiTokenVerified;
            if (!string.IsNullOrEmpty(ClientSettings.Current.Settings.Token))
            {
                _webApi.OauthVerifyTokenAsync(ClientSettings.Current.Settings.Token);
            }
            else
            {
                _nextState = "Login";
            }

            AddComponent(startUpComponent);
            AddComponent(inputsManager);
            base.Initialize(context);
        }
Exemple #3
0
 private void SystemComponentStateStateInitialized(object sender, EventArgs e)
 {
     StatesManager.GetByName("SystemComponents").StateInitialized -= SystemComponentStateStateInitialized;
     _systemComponentInitialized = true;
     CheckForLoginStartUp();
 }