private void OnEscapeMenuToggled(bool isOpened)
 {
     if (isOpened)
     {
         if (!GameNetwork.IsMultiplayer)
         {
             MBCommon.PauseGameEngine();
         }
     }
     else
     {
         MBCommon.UnPauseGameEngine();
     }
     if (isOpened)
     {
         _dataSource    = new OptionsModOptionsViewModel(new OptionsVM(GameNetwork.IsMultiplayer, OnCloseOptions, OnKeybindRequest), new ModOptionsVM());
         _gauntletLayer = new GauntletLayer(ViewOrderPriorty, "GauntletLayer");
         _gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
         _gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericPanelGameKeyCategory"));
         _movie = _gauntletLayer.LoadMovie("OptionsWithModOptionsView_v3", _dataSource);
         MissionScreen.AddLayer(_gauntletLayer);
         _gauntletLayer.IsFocusLayer = true;
         ScreenManager.TrySetFocus(_gauntletLayer);
         return;
     }
     _gauntletLayer.InputRestrictions.ResetInputRestrictions();
     _gauntletLayer.IsFocusLayer = false;
     ScreenManager.TryLoseFocus(_gauntletLayer);
     MissionScreen.RemoveLayer(_gauntletLayer);
     _keybindingPopup?.OnToggle(false);
     _gauntletLayer = null !;
     _dataSource?.OnFinalize();
     _dataSource    = null !;
     _gauntletLayer = null !;
 }
Exemple #2
0
        protected override void OnAgentControllerChanged(Agent agent)
        {
            /*if (null == MissionScreen) {
             *  FocusOnAgent(agent);
             * }*/
            if (!enable)
            {
                return;
            }

            if (null == MissionScreen)
            {
                enable = false;
                return;
            }
            if (_showControlHintLayer != null && textHandler != null)
            {
                return;
            }
            _showControlHintLayer = new GauntletLayer(1);
            textHandler           = new KillInfoWriteHandler(true, GameLoadConfiguration.horizontalAlignment);
            _showControlHintLayer.LoadMovie("showControlHint", textHandler);
            MissionScreen.AddLayer(_showControlHintLayer);
            textHandler.SetShowText(true);
        }
Exemple #3
0
        public void CreateLayout()
        {
            SpriteData spriteData = UIResourceManager.SpriteData;
            TwoDimensionEngineResourceContext resourceContext = UIResourceManager.ResourceContext;
            ResourceDepot uiResourceDepot = UIResourceManager.UIResourceDepot;

            this._spriteCategory = spriteData.SpriteCategories["ui_crafting"];
            this._spriteCategory.Load((ITwoDimensionResourceContext)resourceContext, uiResourceDepot);

            this._gauntletLayer = new GauntletLayer(1, "GauntletLayer");
            this._gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
            this._gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericCampaignPanelsGameKeyCategory"));
            this._gauntletLayer.IsFocusLayer = true;
            //ScreenManager.TrySetFocus((ScreenLayer) this._gauntletLayer);
            MissionScreen.AddLayer((ScreenLayer)this._gauntletLayer);
            this._gauntletLayer.LoadMovie("ScrollGrid", new GameEntityVM());


            //this._testGlobalLayer = new testGlobalLayer();
            //this._testGlobalLayer.Initialize(); // screen where
            //MissionScreen.AddLayer(this._testGlobalLayer.Layer);
            //MissionScreen
            // ScreenManager.AddGlobalLayer(this._testGlobalLayer, true);
            //ScreenManager.TrySetFocus(this._testGlobalLayer.Layer);
        }
Exemple #4
0
        public override void OnMissionScreenInitialize()
        {
            base.OnMissionScreenInitialize();

            _layer = new GauntletLayer(20);
            _layer.LoadMovie(nameof(BattleMiniMapView), _dataSource);
            MissionScreen.AddLayer(_layer);
            _timer = new MissionTimer(0.05f);
        }
 public void Activate()
 {
     _dataSource    = new RTSCameraGameKeyConfigVM(AGameKeyCategoryManager.Get(), OnKeyBindRequest, Deactivate);
     _gauntletLayer = new GauntletLayer(ViewOrderPriorty)
     {
         IsFocusLayer = true
     };
     _gauntletLayer.LoadMovie("RTSCameraOptionsGameKeyPage", _dataSource);
     _gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericPanelGameKeyCategory"));
     _gauntletLayer.InputRestrictions.SetInputRestrictions();
     _gauntletLayer.IsFocusLayer = true;
     MissionScreen.AddLayer(_gauntletLayer);
     ScreenManager.TrySetFocus(_gauntletLayer);
 }
Exemple #6
0
 public void ActivateMenu()
 {
     IsActivated = true;
     _dataSource = GetDataSource();
     if (_dataSource == null)
     {
         return;
     }
     GauntletLayer = new GauntletLayer(ViewOrderPriorty)
     {
         IsFocusLayer = true
     };
     GauntletLayer.InputRestrictions.SetInputRestrictions();
     GauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericPanelGameKeyCategory"));
     _movie = GauntletLayer.LoadMovie(_movieName, _dataSource);
     MissionScreen.AddLayer(GauntletLayer);
     ScreenManager.TrySetFocus(GauntletLayer);
     PauseGame();
 }