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);
        }
        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));
        }
Beispiel #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);
        }
Beispiel #4
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);
        }
        public static void Postfix(ref BodyGeneratorView __instance)
        {
            SpriteData spriteData = UIResourceManager.SpriteData;
            TwoDimensionEngineResourceContext resourceContext = UIResourceManager.ResourceContext;
            ResourceDepot uIResourceDepot = UIResourceManager.UIResourceDepot;

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

            FacGenRecordVM facGenRecord = new FacGenRecordVM(__instance, GlobalDataProvider.Instance.FacGenRecordData());
            GauntletMovie  movie        = __instance.GauntletLayer.LoadMovie("FacGenRecord", facGenRecord);
            //movie.BrushFactory.LoadBrushFile("FacGenRecord");
        }
        protected override void CreateLayout()
        {
            base.CreateLayout();
            SpriteData spriteData = UIResourceManager.SpriteData;
            TwoDimensionEngineResourceContext resourceContext = UIResourceManager.ResourceContext;
            ResourceDepot uIResourceDepot = UIResourceManager.UIResourceDepot;

            spriteData.SpriteCategories["ui_encyclopedia"].Load(resourceContext, uIResourceDepot);
            _setMapCameraPosition = base.MapScreen.SetMapCameraPosition;
            _homeDatasource       = new EncyclopediaHomeVM(new EncyclopediaPageArgs(null, null));
            _navigatorDatasource  = new EncyclopediaNavigatorVM(ExecuteLink, CloseEncyclopedia);
            _game = Game.Current;
            Game game = _game;

            game.AfterTick = (Action <float>)Delegate.Combine(game.AfterTick, new Action <float>(OnTick));
        }
Beispiel #7
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);
        }
Beispiel #8
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);
        }