Ejemplo n.º 1
0
        private async void InitializeCustomGameAux(InitializeCustomGameMessage message)
        {
            if (message.InMission)
            {
                MBDebug.Print("Client: I have received InitializeCustomGameMessage with mission " + message.GameType + " " + message.Map + ". Loading it...", debugFilter: 17179869184UL);
                if (Module.CurrentModule.StartMultiplayerGame(message.GameType, message.Map))
                {
                    ;
                }
            }
            else
            {
                await Task.Delay(200);

                while (!(GameStateManager.Current.ActiveState is LobbyGameStateCustomGameClient))
                {
                    await Task.Delay(1);
                }
                LoadingWindow.DisableGlobalLoadingWindow();
                MBDebug.Print("Client: I have received InitializeCustomGameMessage with no mission. Sending confirmation to server.", debugFilter: 17179869184UL);
                GameNetwork.BeginModuleEventAsClient();
                GameNetwork.WriteMessage((GameNetworkMessage) new FinishedLoading());
                GameNetwork.EndModuleEventAsClient();
                GameNetwork.SyncRelevantGameOptionsToServer();
            }
        }
 protected override void OnActivate()
 {
     this.LoadMovie();
     this._dataSource?.SetActiveState(true);
     LoadingWindow.DisableGlobalLoadingWindow();
     base.OnActivate();
 }
Ejemplo n.º 3
0
 public static void Destroy()
 {
     if (LoadingWindow._loadingWindowState)
     {
         LoadingWindow.DisableGlobalLoadingWindow();
     }
     LoadingWindow._loadingWindowManager = (ILoadingWindowManager)null;
 }
Ejemplo n.º 4
0
 protected override void OnFrameTick(float dt)
 {
     base.OnFrameTick(dt);
     LoadingWindow.DisableGlobalLoadingWindow();
     if (_gauntletLayer.Input.IsHotKeyReleased("Exit") || _gauntletLayer.Input.IsGameKeyReleased(34))
     {
         CloseWangScreen();
     }
 }
 protected override void OnFrameTick(float dt)
 {
     base.OnFrameTick(dt);
     LoadingWindow.DisableGlobalLoadingWindow();
     // || gauntletLayer.Input.IsGameKeyReleased(34)
     if (_gauntletLayer is not null && _gauntletLayer.Input.IsHotKeyReleased("Exit"))
     {
         _dataSource.ExecuteCancel();
     }
 protected override void OnFinalize()
 {
     base.OnFinalize();
     if (LoadingWindow.GetGlobalLoadingWindowState())
     {
         LoadingWindow.DisableGlobalLoadingWindow();
     }
     Game.Current.GameStateManager.ActiveStateDisabledByUser = this._oldGameStateManagerDisabledStatus;
 }
 protected override void OnFrameTick(float dt)
 {
     base.OnFrameTick(dt);
     LoadingWindow.DisableGlobalLoadingWindow();            //关闭加载界面
     if (this._gauntletLayer.Input.IsHotKeyReleased("Exit") || this._gauntletLayer.Input.IsGameKeyReleased(36))
     {
         this.CloseScreen();
     }
 }
        protected override void OnFinalize()
        {
            base.OnFinalize();
            if (LoadingWindow.GetGlobalLoadingWindowState())
            {
                LoadingWindow.DisableGlobalLoadingWindow();
            }

            this._dataSource    = null;
            this._gauntletLayer = null;
        }
Ejemplo n.º 9
0
        protected override void OnFinalize()
        {
            base.OnFinalize();

            _bannerEditorLayer.OnFinalize();
            if (LoadingWindow.GetGlobalLoadingWindowState())
            {
                LoadingWindow.DisableGlobalLoadingWindow();
            }
            TaleWorlds.Core.Game.Current.GameStateManager.ActiveStateDisabledByUser = _oldGameStateManagerDisabledStatus;
        }
Ejemplo n.º 10
0
 private async void HandleServerEventUnloadMissionAux()
 {
     GameNetwork.MyPeer.IsSynchronized = false;
     this.CurrentIntermissionTimer     = 0.0f;
     this.ClientIntermissionState      = MultiplayerIntermissionState.Idle;
     BannerlordNetwork.EndMultiplayerLobbyMission();
     while (Mission.Current != null)
     {
         await Task.Delay(1);
     }
     LoadingWindow.DisableGlobalLoadingWindow();
     MBDebug.Print("Client: I finished HandleServerEventUnloadMissionAux. Sending confirmation to server.", debugFilter: 17179869184UL);
     GameNetwork.BeginModuleEventAsClient();
     GameNetwork.WriteMessage((GameNetworkMessage) new FinishedLoading());
     GameNetwork.EndModuleEventAsClient();
 }
        private void TogglePause()
        {
            if (Game.Current == null)
            {
                return;
            }

            var isPaused = Game.Current.GameStateManager.ActiveStateDisabledByUser;

            Game.Current.GameStateManager.ActiveStateDisabledByUser = !isPaused;

            if (isPaused)
            {
                LoadingWindow.DisableGlobalLoadingWindow();
            }
            else
            {
                LoadingWindow.EnableGlobalLoadingWindow();
            }
        }
Ejemplo n.º 12
0
        protected override void OnFrameTick(float dt)
        {
            base.OnFrameTick(dt);
            if (!this._closed)
            {
                LoadingWindow.DisableGlobalLoadingWindow();
            }
            this._dataSource.IsFiveStackModifierActive = this._gauntletLayer.Input.IsHotKeyDown("FiveStackModifier");

            MainApp.Instance.OnInventoryScreenFrame(this._dataSource);

            if (this._gauntletLayer.Input.IsHotKeyReleased("SwitchAlternative") && this._dataSource != null)
            {
                this._dataSource.CompareNextItem();
            }
            else
            {
                if (!this._gauntletLayer.Input.IsHotKeyReleased("Exit") && !this._gauntletLayer.Input.IsGameKeyReleased(31))
                {
                    return;
                }
                this.ExecuteCancel();
            }
        }
Ejemplo n.º 13
0
 public static void TickSceneEditorPresentation(float dt)
 {
     MBAPI.IMBEditor.TickSceneEditorPresentation(dt);
     LoadingWindow.DisableGlobalLoadingWindow();
 }