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 OnFinalize() { base.OnFinalize(); _gauntletLayer = null; _dataSource = null; _movie = null; }
private void HandleLoadMovie() { var vm = this._datasource; this._movie = this._gauntletLayer.LoadMovie("CharacterSelectionScreen", (ViewModel)this._datasource); var culturesListPanel = this._movie.RootView.Target.FindChild("Cultures", true) as ListPanel; var groupsListPanel = this._movie.RootView.Target.FindChild("Groups", true) as ListPanel; var charactersListPanel = this._movie.RootView.Target.FindChild("Characters", true) as ListPanel; culturesListPanel.IntValue = vm.SelectedCultureIndex; groupsListPanel.IntValue = vm.SelectedGroupIndex; charactersListPanel.IntValue = vm.SelectedCharacterIndex; ModuleLogger.Log("vm.SelectedCharacterIndex {0}", vm.SelectedCharacterIndex); culturesListPanel.SelectEventHandlers.Add(w => { vm.SelectedCultureChanged(w as ListPanel); groupsListPanel.IntValue = vm.SelectedGroupIndex; charactersListPanel.IntValue = vm.SelectedCharacterIndex; }); groupsListPanel.SelectEventHandlers.Add(w => { vm.SelectedGroupChanged(w as ListPanel); charactersListPanel.IntValue = vm.SelectedCharacterIndex; }); charactersListPanel.SelectEventHandlers.Add(w => vm.SelectedCharacterChanged(w as ListPanel)); }
public override void OnMissionScreenFinalize() { base.OnMissionScreenFinalize(); GauntletLayer = null; _dataSource?.OnFinalize(); _dataSource = null; _movie = null; }
protected override void OnFinalize() { base.OnFinalize(); this._gauntletMovie = (GauntletMovie)null; this._dataSource.OnFinalize(); this._dataSource = (SPInventoryVM)null; this._gauntletLayer = (GauntletLayer)null; }
private void CreateLayer() { _gauntletLayer = new GauntletLayer(50, "GauntletLayer"); _movie = _gauntletLayer.LoadMovie(nameof(CharacterSelectionView), _dataSource); _screen.AddLayer(_gauntletLayer); _gauntletLayer.IsFocusLayer = true; ScreenManager.TrySetFocus(_gauntletLayer); _gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All); }
private void LoadMovie() { if (this._isMovieLoaded) { return; } this._gauntletMovie = this._gauntletLayer.LoadMovie(nameof(CustomBattleScreen), (ViewModel)this._dataSource); this._isMovieLoaded = true; }
private void LoadMovie() { if (_isMovieLoaded) { return; } _gauntletMovie = _gauntletLayer.LoadMovie(nameof(EnhancedBattleTestScreen), _dataSource); _isMovieLoaded = true; }
protected override void OnFinalize() { base.OnFinalize(); RemoveLayer(gauntletLayer); gauntletLayer.ReleaseMovie(movie); gauntletLayer = null; movie = null; vm.SettingProperty = null; vm = null; }
private void UnloadMovie() { if (!this._isMovieLoaded) { return; } this._gauntletLayer.ReleaseMovie(this._gauntletMovie); this._gauntletMovie = (GauntletMovie)null; this._isMovieLoaded = false; }
protected override void OnFinalize() { base.OnFinalize(); RemoveLayer(_gauntletLayer); _gauntletLayer.ReleaseMovie(_gauntletMovie); _gauntletLayer = null !; _gauntletMovie = null !; _dataSource.SettingProperty = null !; _dataSource = null !; }
private void UnloadMovie() { if (!_isMovieLoaded) { return; } _gauntletLayer.ReleaseMovie(_gauntletMovie); _gauntletMovie = null; _isMovieLoaded = false; }
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 OnFinalize() { base.OnFinalize(); RemoveLayer(gauntletLayer); gauntletLayer.ReleaseMovie(movie); gauntletLayer = null; movie = null; vm.ExecuteSelect(null); vm.AssignParent(true); vm = null; }
protected override void OnFinalize() { base.OnFinalize(); RemoveLayer(_gauntletLayer); _gauntletLayer.ReleaseMovie(_gauntletMovie); _gauntletLayer = null; _gauntletMovie = null; _dataSource.ExecuteSelect(null); //_dataSource.AssignParent(true); _dataSource = null; }
protected override void OnInitialize() { base.OnInitialize(); this._gauntletLayer = new GauntletLayer(100, "GauntletLayer") { IsFocusLayer = true }; base.AddLayer(this._gauntletLayer); this._gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All); this._movie = this._gauntletLayer.LoadMovie("ExScreen", null); }
public void OnFinalize() { _screenBase.RemoveLayer(_layer); _layer.ReleaseMovie(_movie); _layer = null; _movie = null; // vm.ExecuteSelect(null); // vm.AssignParent(true); _vm = null; _screenBase = null; }
protected override void OnInitialize() { base.OnInitialize(); this._datasource = new CultureChangerViewModel(ref this._cultureChangerProperties); this._gauntletLayer = new GauntletLayer(100, "GauntletLayer"); this._gauntletLayer.IsFocusLayer = true; base.AddLayer(this._gauntletLayer); this._gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All); ScreenManager.TrySetFocus(this._gauntletLayer); this._movie = this._gauntletLayer.LoadMovie(nameof(CultureChangerScreen), this._datasource); }
protected void OnCloseMenu() { IsActivated = false; _dataSource.OnFinalize(); _dataSource = null; GauntletLayer.InputRestrictions.ResetInputRestrictions(); MissionScreen.RemoveLayer(GauntletLayer); _movie = null; GauntletLayer = null; UnpauseGame(); }
protected override void CreateLayout() { base.CreateLayout(); this.DataSource = new GauntletResourceViewVM(); GauntletLayer gauntletLayer = new GauntletLayer(7999); this.Layer = gauntletLayer; this._movie = gauntletLayer.LoadMovie("ResourceMapWidget", this.DataSource); this.Layer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All); base.MapScreen.AddLayer(this.Layer); this.DataSource.Refresh(); }
protected override void OnInitialize() { base.OnInitialize(); _datasource = new VillagePropertyMenuViewModel(ref this._acreProperties); _gauntletLayer = new GauntletLayer(100); _gauntletLayer.IsFocusLayer = true; AddLayer(_gauntletLayer); _gauntletLayer.InputRestrictions.SetInputRestrictions(); ScreenManager.TrySetFocus(_gauntletLayer); _movie = _gauntletLayer.LoadMovie("VillagePropertyScreen", _datasource); _firstRender = true; }
protected override void OnInitialize() { base.OnInitialize(); _dataSource = new TownRevolutionViewModel(this._settlementInfo, this._factionInfo); _gauntletLayer = new GauntletLayer(100); _gauntletLayer.IsFocusLayer = true; AddLayer(_gauntletLayer); _gauntletLayer.InputRestrictions.SetInputRestrictions(); ScreenManager.TrySetFocus(_gauntletLayer); _movie = _gauntletLayer.LoadMovie("TownRevolutionScreen", _dataSource); _firstRender = true; }
protected override void OnInitialize() { base.OnInitialize(); _dataSource = new ModOptionsViewModel(OnClose); _gauntletLayer = new GauntletLayer(100); _gauntletLayer.IsFocusLayer = true; AddLayer(_gauntletLayer); _gauntletLayer.InputRestrictions.SetInputRestrictions(); ScreenManager.TrySetFocus(_gauntletLayer); _movie = _gauntletLayer.LoadMovie("RevolutionModOptions", _dataSource); _firstRender = true; }
protected override void OnFinalize() { this._gauntletLayer.IsFocusLayer = false; ScreenManager.TryLoseFocus((ScreenLayer)this._gauntletLayer); this._dataSource.OnFinalize(); this._dataSource = (VartsLeaderboardWorkshopVM)null; this._gauntletLayer.ReleaseMovie(this._movie); this.MenuViewContext.RemoveLayer((ScreenLayer)this._gauntletLayer); this._movie = (GauntletMovie)null; this._gauntletLayer = (GauntletLayer)null; base.OnFinalize(); }
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); }
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); }
protected override void OnInitialize() { base.OnInitialize(); _dataSource = new VartsConfigMenuVM(); _gauntletLayer = new GauntletLayer(100) { IsFocusLayer = true }; AddLayer(_gauntletLayer); _gauntletLayer.InputRestrictions.SetInputRestrictions(); _gauntletMovie = _gauntletLayer.LoadMovie("VartsConfigMenuScreenBaseMovie", _dataSource); }
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 OnFinalize() { base.OnFinalize(); // TODO: There was a report that the encyclopedia UI is bugged //_spriteCategoryEncyclopedia.Unload(); RemoveLayer(_gauntletLayer); _gauntletLayer.ReleaseMovie(_gauntletMovie); _gauntletLayer = null !; _gauntletMovie = null !; _dataSource.ExecuteSelect(null); _dataSource = null !; }
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); }