public static void Prefix(ref ScreenBase __instance, ref ScreenLayer layer) { if (__instance is GauntletPartyScreen && screenLayer != null && layer.Input.IsCategoryRegistered(HotKeyManager.GetCategory("PartyHotKeyCategory"))) { __instance.RemoveLayer(screenLayer); enhancementVm.OnFinalize(); enhancementVm = null; screenLayer = null; } }
public new void OnFinalize() { base.OnFinalize(); PartyScreenConfig.Save(); if (Game.Current != null) { Game.Current.AfterTick = (Action <float>)Delegate.Remove(Game.Current.AfterTick, new Action <float>(AfterTick)); } _partyEnhancementsVm = null; _sorterPane = null; _generalPane = null; }
public SettingScreenVM(PartyEnhancementsVM parent, GauntletPartyScreen parentScreen) { _partyEnhancementsVm = parent; _parentScreen = parentScreen; _sorterPane = new SettingSorterOverlayVM(this); _generalPane = new SettingGeneralPaneVM(); _miscPane = new SettingMiscPaneVM(); if (Game.Current != null) { Game.Current.AfterTick = (Action <float>)Delegate.Combine(Game.Current.AfterTick, new Action <float>(AfterTick)); } }
public static void Postfix(ref ScreenBase __instance) { if (__instance is GauntletPartyScreen partyScreen && screenLayer == null) { screenLayer = new GauntletLayer(10); var traverser = Traverse.Create(partyScreen); PartyVM partyVM = traverser.Field <PartyVM>("_dataSource").Value; PartyState partyState = traverser.Field <PartyState>("_partyState").Value; enhancementVm = new PartyEnhancementsVM(partyVM, partyState.PartyScreenLogic, partyScreen); screenLayer.LoadMovie("PartyScreenEnhancements", enhancementVm); screenLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All); partyScreen.AddLayer(screenLayer); } }