protected override void OnSubModuleLoad()
        {
            base.OnSubModuleLoad();

            var category = HotKeyManager.GetCategory("CombatHotKeyCategory") as CombatHotKeyCategory;
            var method   = category.GetType().BaseType.GetMethod("RegisterGameKey", BindingFlags.Instance | BindingFlags.FlattenHierarchy | BindingFlags.NonPublic);
            var list     = category.PrivateValue <List <GameKey> >("_registeredGameKeys", typeof(GameKeyContext));

            list.AddRange(Enumerable.Repeat <GameKey>(null, 64));

            var nameText        = Module.CurrentModule.GlobalTextManager.GetGameText("str_key_name");
            var descriptionText = Module.CurrentModule.GlobalTextManager.GetGameText("str_key_description");

            foreach (var key in DirectionalAttackKeys.AllKeys)
            {
                nameText.AddVariationWithId(nameof(CombatHotKeyCategory) + "_" + (int)key, new TextObject(DirectionalAttackKeys.NameFor(key)), new List <GameTextManager.ChoiceTag>());
                descriptionText.AddVariationWithId(nameof(CombatHotKeyCategory) + "_" + (int)key, new TextObject(DirectionalAttackKeys.NameFor(key)), new List <GameTextManager.ChoiceTag>());

                method.Invoke(category, new object[]
                {
                    new GameKey(
                        (int)key,
                        DirectionalAttackKeys.NameFor(key),
                        "CombatHotKeyCategory",
                        InputKey.Numpad8 + ((int)key - (int)DirectionalAttackKeys.Key.AttackUp),
                        InputKey.Invalid,
                        GameKeyMainCategories.ActionCategory
                        ),
                    true
                });
            }

            new Harmony("net.shdw.BannerlordPlayerControlsMod").PatchAll();
            HotKeyManager.Load();
        }
Пример #2
0
        protected override void OnSubModuleLoad()
        {
            base.OnSubModuleLoad();

            playerZoomKey = HotKeyManager.GetCategory("CombatHotKeyCategory").RegisteredGameKeys
                            .SingleOrDefault(x => x != null && x.StringId == "Zoom");
        }
 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 !;
 }
        protected override void OnActivate()
        {
            base.OnActivate();
            SpriteData spriteData = UIResourceManager.SpriteData;
            TwoDimensionEngineResourceContext resourceContext = UIResourceManager.ResourceContext;
            ResourceDepot uIResourceDepot = UIResourceManager.UIResourceDepot;

            this._characterdeveloper = spriteData.SpriteCategories["ui_characterdeveloper"];
            this._characterdeveloper.Load(resourceContext, uIResourceDepot);

            //this._clanCategory = spriteData.SpriteCategories["ui_encyclopedia"];
            //this._clanCategory.Load(resourceContext, uIResourceDepot);

            this._clanCategory = spriteData.SpriteCategories["ui_clan"];
            this._clanCategory.Load(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(this._gauntletLayer);
            base.AddLayer(this._gauntletLayer);

            this._dataSource = new HereAdminDashBoardVM(this._heroAdminState.EditHero, OnCloseHereAdminDashBoard);

            this._gauntletLayer.LoadMovie("HeroAdminDashBoard", this._dataSource);
        }
Пример #5
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);
        }
Пример #6
0
        protected override void OnInitialize()
        {
            base.OnInitialize();
            SpriteData spriteData = UIResourceManager.SpriteData;
            TwoDimensionEngineResourceContext resourceContext = UIResourceManager.ResourceContext;
            ResourceDepot uIResourceDepot = UIResourceManager.UIResourceDepot;

            _clanCategory = spriteData.SpriteCategories["ui_clan"];
            _clanCategory.Load(resourceContext, uIResourceDepot);

            this._kingdomCategory = spriteData.SpriteCategories["ui_kingdom"];
            this._kingdomCategory.Load(resourceContext, uIResourceDepot);

            this._spriteCategory = spriteData.SpriteCategories["ui_options"];
            this._spriteCategory.Load(resourceContext, uIResourceDepot);


            _gauntletLayer = new GauntletLayer(1);
            _gauntletLayer.InputRestrictions.SetInputRestrictions();
            _gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericCampaignPanelsGameKeyCategory"));

            _gauntletLayer.IsFocusLayer = true;
            ScreenManager.TrySetFocus(_gauntletLayer);
            AddLayer(_gauntletLayer);
            _dataSource = new WangVM(CloseWangScreen, OpenPartyAsManage, OpenBannerEditorWithPlayerClan);
            _gauntletLayer.LoadMovie("WangScreen", _dataSource);
            //   Game.Current.EventManager.TriggerEvent(new TutorialContextChangedEvent(TutorialContexts.ClanScreen));
        }
Пример #7
0
        private static void Postfix(OptionsGauntletScreen __instance)
        {
            __instance.RemoveLayer(__instance.Layers.FirstOrDefault());

            SpriteData spriteData = UIResourceManager.SpriteData;
            TwoDimensionEngineResourceContext resourceContext = UIResourceManager.ResourceContext;
            ResourceDepot uiresourceDepot = UIResourceManager.UIResourceDepot;

            var _spriteCategory = spriteData.SpriteCategories["ui_options"];

            _spriteCategory.Load(resourceContext, uiresourceDepot);
            OptionsWithModsViewModel _dataSource = new OptionsWithModsViewModel(true, false, (requestedHotKeyToChange) =>
            {
                Set(__instance, "_currentGameKey", requestedHotKeyToChange);
                ((KeybindingPopup)Get(__instance, "_keybindingPopup")).OnToggle(true);
            }, null);
            GauntletLayer _gauntletLayer = new GauntletLayer(4000, "GauntletLayer");
            GauntletMovie _gauntletMovie = _gauntletLayer.LoadMovie("Options", _dataSource);

            _gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericPanelGameKeyCategory"));
            _gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
            _gauntletLayer.IsFocusLayer = true;
            KeybindingPopup _keybindingPopup = new KeybindingPopup(new Action <Key>((key) =>
            {
                GameKeyOptionVM _currentGameKey       = Get(__instance, "_currentGameKey") as GameKeyOptionVM;
                KeybindingPopup _keybindingPopupinner = Get(__instance, "_keybindingPopup") as KeybindingPopup;
                if (_dataSource.GameKeyOptionGroups.Groups.First((GameKeyGroupVM g) => g.GameKeys.Contains(_currentGameKey)).GameKeys.Any((GameKeyOptionVM k) => k.CurrentKey.InputKey == key.InputKey))
                {
                    InformationManager.AddQuickInformation(new TextObject("{=n4UUrd1p}Already in use", null), 0, null, "");
                    return;
                }
                if (_gauntletLayer.Input.IsHotKeyReleased("Exit"))
                {
                    _keybindingPopupinner.OnToggle(false);
                    return;
                }
                GameKeyOptionVM currentGameKey = _currentGameKey;
                if (currentGameKey != null)
                {
                    currentGameKey.Set(key.InputKey);
                }
                _currentGameKey = null;
                _keybindingPopupinner.OnToggle(false);
            }), __instance);

            __instance.AddLayer(_gauntletLayer);
            ScreenManager.TrySetFocus(_gauntletLayer);

            Set(__instance, "_spriteCategory", _spriteCategory);
            Set(__instance, "_dataSource", _dataSource);
            Set(__instance, "_gauntletLayer", _gauntletLayer);
            Set(__instance, "_gauntletMovie", _gauntletMovie);
            Set(__instance, "_keybindingPopup", _keybindingPopup);
        }
 protected override void OnInitialize()
 {
     base.OnInitialize();
     _dataSource    = new ModSettingsScreenVM();
     _gauntletLayer = new GauntletLayer(4000, "GauntletLayer");
     _gauntletMovie = _gauntletLayer.LoadMovie("ModOptionsScreen_v1", _dataSource);
     _gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericPanelGameKeyCategory"));
     _gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
     _gauntletLayer.IsFocusLayer = true;
     AddLayer(_gauntletLayer);
     ScreenManager.TrySetFocus(_gauntletLayer);
 }
 protected override void OnInitialize()
 {
     base.OnInitialize();
     gauntletLayer = new GauntletLayer(1);
     gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
     gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericCampaignPanelsGameKeyCategory"));
     gauntletLayer.IsFocusLayer = true;
     ScreenManager.TrySetFocus(gauntletLayer);
     AddLayer(gauntletLayer);
     vm    = new ModSettingsScreenVM();
     movie = gauntletLayer.LoadMovie("ModOptionsScreen", vm);
 }
        protected override void OnInitialize()
        {
            base.OnInitialize();

            gauntletLayer = new GauntletLayer(4500);
            gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
            gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("ChatLogHotKeyCategory"));
            ScreenManager.TrySetFocus(gauntletLayer);
            vm = new EditValueVM(settingProperty);
            AddLayer(gauntletLayer);
            movie = gauntletLayer.LoadMovie("EditValueView", vm);
        }
Пример #11
0
 protected override void OnInitialize()
 {
     base.OnInitialize();
     _dataSource    = new EditValueVM(_settingProperty);
     _gauntletLayer = new GauntletLayer(4000, "GauntletLayer");
     _gauntletMovie = _gauntletLayer.LoadMovie("EditValueView", _dataSource);
     _gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("ChatLogHotKeyCategory"));
     _gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
     _gauntletLayer.IsFocusLayer = true;
     AddLayer(_gauntletLayer);
     ScreenManager.TrySetFocus(_gauntletLayer);
 }
Пример #12
0
        void IGameStateListener.OnActivate()
        {
            base.OnActivate();
            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);
            this.AddLayer((ScreenLayer)this._gauntletLayer);

            this._dataSource = new MarketplaceVM();
            this._gauntletLayer.LoadMovie("ClanScreen2", this._dataSource);
        }
Пример #13
0
 public void OpenSettingView()
 {
     if (_settingLayer == null)
     {
         _settingLayer              = new GauntletLayer(200);
         _settingScreenVm           = new SettingScreenVM(this, _parentScreen);
         _settingMovie              = _settingLayer.LoadMovie("PartyEnhancementSettings", _settingScreenVm);
         _settingLayer.IsFocusLayer = true;
         ScreenManager.TrySetFocus(_settingLayer);
         _settingLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericPanelGameKeyCategory"));
         _parentScreen.AddLayer(_settingLayer);
         _settingLayer.InputRestrictions.SetInputRestrictions();
     }
 }
Пример #14
0
 public void OpenSubSetting(SettingSortVM sortVm)
 {
     if (_subSettingLayer == null)
     {
         _subSettingLayer = new GauntletLayer(300);
         _subScreen       = new SettingSortingOrderScreenVM(this, sortVm.SortingComparer);
         _currentMovie    = _subSettingLayer.LoadMovie("PartyEnhancementSortingSettings", _subScreen);
         _subSettingLayer.IsFocusLayer = true;
         ScreenManager.TrySetFocus(_subSettingLayer);
         _subSettingLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericPanelGameKeyCategory"));
         _parentScreen.AddLayer(_subSettingLayer);
         _subSettingLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
     }
 }
 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);
 }
        protected override void CreateLayout()
        {
            base.CreateLayout();
            this._dataSource = new HardmodeOptionsVM(new Action(this.OnClose));
            GauntletLayer gauntletLayer = new GauntletLayer(4401, "GauntletLayer");

            gauntletLayer.IsFocusLayer = true;
            this._layer = gauntletLayer;
            this._layer.LoadMovie("CampaignOptions", (ViewModel)this._dataSource);
            this._layer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericPanelGameKeyCategory"));
            this._layer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
            this.MapScreen.AddLayer((ScreenLayer)this._layer);
            this.MapScreen.PauseAmbientSounds();
            ScreenManager.TrySetFocus((ScreenLayer)this._layer);
        }
Пример #17
0
        public void ShowSpouseServiceView()
        {
            bool flag = this._spouseServiceLayer == null;

            if (flag)
            {
                this._spouseServiceLayer = new GauntletLayer(200, "GauntletLayer");
                this._spouseServiceView  = new SpouseServiceVM(this, this._parentScreen);
                this._currentMovie       = this._spouseServiceLayer.LoadMovie("SpouseService", this._spouseServiceView);
                this._spouseServiceLayer.IsFocusLayer = true;
                ScreenManager.TrySetFocus(this._spouseServiceLayer);
                this._spouseServiceLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericPanelGameKeyCategory"));
                this._parentScreen.AddLayer(this._spouseServiceLayer);
                this._spouseServiceLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
            }
        }
Пример #18
0
        public void ShowClanServiceView()
        {
            bool flag = this._serviceLayer == null;

            if (flag)
            {
                this._serviceLayer = new GauntletLayer(200, "GauntletLayer");
                this.clanServiceVM = new VassalServiceVM(this, this._parentScreen, new Action(OpenBannerEditorWithPlayerClan));
                this._currentMovie = this._serviceLayer.LoadMovie("VassalService", this.clanServiceVM);
                this._serviceLayer.IsFocusLayer = true;
                ScreenManager.TrySetFocus(this._serviceLayer);
                this._serviceLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericPanelGameKeyCategory"));
                this._parentScreen.AddLayer(this._serviceLayer);
                this._serviceLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
            }
        }
        protected override void OnInitialize()
        {
            base.OnInitialize();
            _dataSource = new EditValueVM(_settingProperty);
            if (GauntletLayerUtils.Create(4000, "GauntletLayer") is { } gauntletLayer)
            {
                _gauntletLayer = gauntletLayer;
                _gauntletMovie = LoadMovie is not null?LoadMovie(_gauntletLayer, "EditValueView_MCM", _dataSource) : null;

                _gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("ChatLogHotKeyCategory"));
                _gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
                _gauntletLayer.IsFocusLayer = true;
                AddLayer(_gauntletLayer);
                ScreenManager.TrySetFocus(_gauntletLayer);
            }
        }
Пример #20
0
        //Activate VM and Movie
        void IGameStateListener.OnActivate()
        {
            base.OnActivate();

            //Template
            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);
            this.AddLayer((ScreenLayer)this._gauntletLayer);


            //DataSource and Movie  | Change Movie!!!!
            this._dataSource = new WorkerOverviewVM(this._customState.Worker);
            this._gauntletLayer.LoadMovie("ClanScreen", this._dataSource);
        }
        protected override void CreateLayout()
        {
            base.CreateLayout();
            _dataSource = new CustomCampaignOptionsVM(OnClose);
            var gauntletLayer = new GauntletLayer(4401)
            {
                IsFocusLayer = true
            };

            _layer = gauntletLayer;
            _layer.LoadMovie("CustomCampaignOptions", _dataSource);
            _layer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericPanelGameKeyCategory"));
            _layer.InputRestrictions.SetInputRestrictions();
            MapScreen.AddLayer(_layer);
            MapScreen.PauseAmbientSounds();
            ScreenManager.TrySetFocus(_layer);
        }
Пример #22
0
        protected override void OnInitialize()
        {
            base.OnInitialize();
            SpriteData spriteData = UIResourceManager.SpriteData;
            TwoDimensionEngineResourceContext resourceContext = UIResourceManager.ResourceContext;
            ResourceDepot uiresourceDepot = UIResourceManager.UIResourceDepot;

            spriteData.SpriteCategories["ui_encyclopedia"].Load(resourceContext, uiresourceDepot);
            gauntletLayer = new GauntletLayer(1);
            gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
            gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericCampaignPanelsGameKeyCategory"));
            gauntletLayer.IsFocusLayer = true;
            ScreenManager.TrySetFocus(gauntletLayer);
            AddLayer(gauntletLayer);
            vm    = new ModSettingsScreenVM();
            movie = gauntletLayer.LoadMovie("ModOptionsScreen", vm);
        }
        protected override void OnInitialize()
        {
            base.OnInitialize();
            var spriteData      = UIResourceManager.SpriteData;
            var resourceContext = UIResourceManager.ResourceContext;
            var uiresourceDepot = UIResourceManager.UIResourceDepot;

            _spriteCategoryEncyclopedia = spriteData.SpriteCategories["ui_encyclopedia"];
            _spriteCategoryEncyclopedia.Load(resourceContext, uiresourceDepot);
            _dataSource    = new ModOptionsVM();
            _gauntletLayer = new GauntletLayer(4000, "GauntletLayer");
            _gauntletMovie = _gauntletLayer.LoadMovie("ModOptionsView", _dataSource);
            _gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericPanelGameKeyCategory"));
            _gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
            _gauntletLayer.IsFocusLayer = true;
            AddLayer(_gauntletLayer);
            ScreenManager.TrySetFocus(_gauntletLayer);
        }
Пример #24
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();
 }
Пример #25
0
        protected override void OnInitialize()
        {
            base.OnInitialize();
            this._dataSource = new VartsLeaderboardWorkshopVM()
            {
                IsEnabled = true
            };
            GauntletLayer gauntletLayer = new GauntletLayer(205, "GauntletLayer");

            gauntletLayer.Name  = "VartsLeaderboardWorkshopMenuView";
            this._gauntletLayer = gauntletLayer;
            this._gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
            this._gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericPanelGameKeyCategory"));
            this._movie =
                this._gauntletLayer.LoadMovie("VartsLeaderboardWorkshopMenuViewMovie", (ViewModel)this._dataSource);
            this._gauntletLayer.IsFocusLayer = true;
            ScreenManager.TrySetFocus((ScreenLayer)this._gauntletLayer);
            this.MenuViewContext.AddLayer((ScreenLayer)this._gauntletLayer);
        }
Пример #26
0
        public void ShowFiefInterface(ScreenBase screenBase, Hero hero, Action refreshAction)
        {
            _screenBase = screenBase;

            var spriteData      = UIResourceManager.SpriteData;
            var resourceContext = UIResourceManager.ResourceContext;
            var resourceDepot   = UIResourceManager.UIResourceDepot;

            spriteData.SpriteCategories["ui_encyclopedia"].Load(resourceContext, resourceDepot);
            spriteData.SpriteCategories["ui_kingdom"].Load(resourceContext, resourceDepot);

            _layer = new GauntletLayer(211);
            _layer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
            _layer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericCampaignPanelsGameKeyCategory"));
            _layer.IsFocusLayer = true;
            ScreenManager.TrySetFocus(_layer);
            screenBase.AddLayer(_layer);
            _vm    = new GrantFiefVM(hero, () => OnFinalize(refreshAction));
            _movie = _layer.LoadMovie("GrantFief", _vm);
        }
Пример #27
0
        public void ShowInterface(ScreenBase screenBase, Clan clan)
        {
            this._screenBase = screenBase;

            SpriteData spriteData = UIResourceManager.SpriteData;
            TwoDimensionEngineResourceContext resourceContext = UIResourceManager.ResourceContext;
            ResourceDepot resourceDepot = UIResourceManager.UIResourceDepot;

            spriteData.SpriteCategories["ui_encyclopedia"].Load(resourceContext, resourceDepot);
            spriteData.SpriteCategories["ui_kingdom"].Load(resourceContext, resourceDepot);

            _layer = new GauntletLayer(211);
            _layer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
            _layer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericCampaignPanelsGameKeyCategory"));
            _layer.IsFocusLayer = true;
            ScreenManager.TrySetFocus(_layer);
            screenBase.AddLayer(_layer);
            _vm    = new DonateGoldVM(clan, this.OnFinalize);
            _movie = _layer.LoadMovie("DonateGold", _vm);
        }
        protected override void OnInitialize()
        {
            base.OnInitialize();
            _dataSource    = new EnhancedBattleTestVM(_state, _title);
            _gauntletLayer = new GauntletLayer(1)
            {
                IsFocusLayer = true
            };
            LoadMovie();
            _gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericPanelGameKeyCategory"));
            _gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
            ScreenManager.TrySetFocus(_gauntletLayer);
            _dataSource.SetActiveState(true);
            AddLayer(_gauntletLayer);

            var collection = CharacterCollection.Create(EnhancedBattleTestSubModule.IsMultiplayer);

            collection.Initialize();
            CharacterSelectionView = new CharacterSelectionView();
            CharacterSelectionView.Initialize(this, collection, EnhancedBattleTestSubModule.IsMultiplayer);
        }
Пример #29
0
        protected override void OnInitialize()
        {
            UIResourceManager.SpriteData.SpriteCategories["ui_inventory"].Load((ITwoDimensionResourceContext)UIResourceManager.ResourceContext, UIResourceManager.UIResourceDepot);
            InventoryLogic inventoryLogic = this._inventoryState.InventoryLogic;
            Mission        current        = Mission.Current;
            int            num            = current != null ? (current.DoesMissionRequireCivilianEquipment ? 1 : 0) : 0;
            Func <WeaponComponentData, ItemObject.ItemUsageSetFlags> getItemUsageSetFlags = new Func <WeaponComponentData, ItemObject.ItemUsageSetFlags>(this.GetItemUsageSetFlag);
            string stackShortcutkeyText = this.GetFiveStackShortcutkeyText();

            this._dataSource = new SPInventoryVM(inventoryLogic, num != 0, getItemUsageSetFlags, stackShortcutkeyText);
            GauntletLayer gauntletLayer = new GauntletLayer(15, "GauntletLayer");

            gauntletLayer.IsFocusLayer = true;
            this._gauntletLayer        = gauntletLayer;
            this._gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
            this.AddLayer((ScreenLayer)this._gauntletLayer);
            ScreenManager.TrySetFocus((ScreenLayer)this._gauntletLayer);
            this._gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("InventoryHotKeyCategory"));
            this._gauntletMovie     = this._gauntletLayer.LoadMovie("Inventory", (ViewModel)this._dataSource);
            this._openedFromMission = this._inventoryState.Predecessor is MissionState;
            InformationManager.ClearAllMessages();
        }
        protected override void OnInitialize()
        {
            base.OnInitialize();
            var spriteData      = UIResourceManager.SpriteData;
            var resourceContext = UIResourceManager.ResourceContext;
            var uiresourceDepot = UIResourceManager.UIResourceDepot;

            _spriteCategoryOptions = spriteData.SpriteCategories["ui_options"];
            _spriteCategoryOptions.Load(resourceContext, uiresourceDepot);
            _spriteCategoryEncyclopedia = spriteData.SpriteCategories["ui_encyclopedia"];
            _spriteCategoryEncyclopedia.Load(resourceContext, uiresourceDepot);
            _dataSource    = new OptionsModOptionsViewModel(new OptionsVM(true, false, OnKeybindRequest), new ModOptionsVM());
            _gauntletLayer = new GauntletLayer(4000, "GauntletLayer");
            _gauntletMovie = _gauntletLayer.LoadMovie("OptionsWithModOptionsView_v3", _dataSource);
            _gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericPanelGameKeyCategory"));
            _gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
            _gauntletLayer.IsFocusLayer = true;
            _keybindingPopup            = new KeybindingPopup(SetHotKey, this);
            AddLayer(_gauntletLayer);
            ScreenManager.TrySetFocus(_gauntletLayer);
            Utilities.SetForceVsync(true);
        }