コード例 #1
0
 public void OnFinalize()
 {
     _screenBase.RemoveLayer(_layer);
     _layer.ReleaseMovie(_movie);
     _layer = null;
     _movie = null;
     // vm.ExecuteSelect(null);
     // vm.AssignParent(true);
     _vm         = null;
     _screenBase = null;
 }
コード例 #2
0
        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());
            IGauntletMovie moviename    = __instance.GauntletLayer.LoadMovie("FacGenRecord", facGenRecord);
            //movie.BrushFactory.LoadBrushFile("FacGenRecord");
        }
コード例 #3
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();
     }
 }
コード例 #4
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);
     }
 }
コード例 #5
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);
            }
        }
コード例 #6
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);
        }
コード例 #7
0
        /*
         * Screen layer methods
         */

        public void OpenPopupViewEnhancements(PartyTroopManagerVM openedPopup)
        {
            if (_popupLayer != null)
            {
                return;
            }

            _popupLayer = new GauntletLayer(200);

            if (openedPopup is PartyUpgradeTroopVM)
            {
                _popupMovie = _popupLayer.LoadMovie("PSEUpgradePopup", _upgradeTroopsVM);
            }
            else if (openedPopup is PartyRecruitTroopVM)
            {
                _popupMovie = _popupLayer.LoadMovie("PSERecruitPopup", _recruitPrisonerVm);
            }

            _parentScreen.AddLayer(_popupLayer);
            _popupLayer.InputRestrictions.SetInputRestrictions();
        }
        public void OnEncyclopediaPageChanged(EncyclopediaPageChangedEvent e)
        {
            EncyclopediaData.EncyclopediaPages newPage = e.NewPage;
            if ((int)newPage != 12)
            {
                selectedHeroPage = null;
                selectedHero     = null;
                if (gauntletLayerTopScreen != null && gauntletLayer != null)
                {
                    gauntletLayerTopScreen.RemoveLayer(gauntletLayer);
                    if (gauntletMovie != null)
                    {
                        gauntletLayer.ReleaseMovie(gauntletMovie);
                    }
                    gauntletLayerTopScreen = null;
                    gauntletMovie          = null;
                }
                return;
            }
            GauntletEncyclopediaScreenManager gauntletEncyclopediaScreenManager = MapScreen.Instance.EncyclopediaScreenManager as GauntletEncyclopediaScreenManager;

            if (gauntletEncyclopediaScreenManager == null)
            {
                return;
            }

            EncyclopediaData   encyclopediaData   = ReflectUtils.ReflectField <EncyclopediaData>("_encyclopediaData", gauntletEncyclopediaScreenManager);
            EncyclopediaPageVM encyclopediaPageVM = ReflectUtils.ReflectField <EncyclopediaPageVM>("_activeDatasource", encyclopediaData);

            selectedHeroPage = (encyclopediaPageVM as EncyclopediaHeroPageVM);

            if (selectedHeroPage == null)
            {
                return;
            }
            selectedHero = (selectedHeroPage.Obj as Hero);
            if (selectedHero == null)
            {
                return;
            }
            if (gauntletLayer == null)
            {
                gauntletLayer = new GauntletLayer(211, "GauntletLayer");
            }

            try
            {
                if (viewModel == null)
                {
                    viewModel = new HeroBuilderVM(delegate(Hero editHero)
                    {
                        InformationManager.DisplayMessage(new InformationMessage(new TextObject("{=CharacterCreation_EditAppearanceForHeroMessage}Entering edit appearance for: ").ToString() + editHero));
                    });
                }
                viewModel.SetHero(selectedHero);
                gauntletMovie          = gauntletLayer.LoadMovie("HeroEditor", viewModel);
                gauntletLayerTopScreen = ScreenManager.TopScreen;
                gauntletLayerTopScreen.AddLayer(gauntletLayer);
                gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.MouseButtons);

                // Refresh
                selectedHeroPage.Refresh();
            }
            catch (Exception ex)
            {
                // MessageBox.Show($"Error :\n{ex.Message} \n\n{ex.InnerException?.Message}");
            }
        }