public new void OnFinalize() { base.OnFinalize(); SaveList(); PartyScreenConfig.Save(); _sortingOrder = null; _settingScreen = null; _sorter = null; }
public static bool Prefix(int upgradeIndex, ref PartyCharacterVM __instance) { if (ScreenManager.TopScreen is GauntletPartyScreen && Utilities.IsControlDown() && Utilities.IsShiftDown()) { if (PartyScreenConfig.PathsToUpgrade.TryGetValue(__instance.Character.StringId, out var upgradeValue)) { if (upgradeValue == upgradeIndex) { PartyScreenConfig.PathsToUpgrade.Remove(__instance.Character.StringId); InformationManager.DisplayMessage(new InformationMessage( $"Removed the set upgrade path for {__instance.Name}", Color.ConvertStringToColor("#a83123FF"))); } else { if (upgradeValue == -1) { PartyScreenConfig.PathsToUpgrade.Remove(__instance.Character.StringId); InformationManager.DisplayMessage(new InformationMessage( $"Allowed single-path upgrading of {__instance.Name} to {__instance.Character.UpgradeTargets[upgradeIndex].Name}", Color.ConvertStringToColor("#0bbd0bFF"))); } else { PartyScreenConfig.PathsToUpgrade[__instance.Character.StringId] = upgradeIndex; InformationManager.DisplayMessage(new InformationMessage( $"Changed the upgrade target of {__instance.Name} to {__instance.Character.UpgradeTargets[upgradeIndex].Name}", Color.ConvertStringToColor("#0bbd0bFF"))); } } } else { if (__instance.Character.UpgradeTargets.Length == 1) { PartyScreenConfig.PathsToUpgrade.Add(__instance.Character.StringId, -1); InformationManager.DisplayMessage(new InformationMessage( $"Disallowed single-path upgrading of {__instance.Name}", Color.ConvertStringToColor("#a83123FF"))); } else { PartyScreenConfig.PathsToUpgrade.Add(__instance.Character.StringId, upgradeIndex); InformationManager.DisplayMessage(new InformationMessage( $"Set the upgrade target of {__instance.Name} to {__instance.Character.UpgradeTargets[upgradeIndex].Name}", Color.ConvertStringToColor("#0bbd0bFF"))); } } PartyScreenConfig.Save(); return(false); } return(true); }
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 void SaveSettingList() { if (_settingList.Count > 0) { _newSorterCallBack(GetFullPartySorter(0)); } else { _newSorterCallBack(new AlphabetComparer(null, false)); } PartyScreenConfig.Save(); }
public static bool Prefix(ref PartyCharacterVM __instance) { if (ScreenManager.TopScreen is GauntletPartyScreen && Utilities.IsControlDown() && Utilities.IsShiftDown()) { if (!PartyScreenConfig.PrisonersToRecruit.ContainsKey(__instance.Character.StringId)) { PartyScreenConfig.PrisonersToRecruit.Add(__instance.Character.StringId, -1); if (PartyScreenConfig.ExtraSettings.RecruitByDefault) { DisplayRemoved(__instance); } else { DisplayAllowed(__instance); } } else { PartyScreenConfig.PrisonersToRecruit.Remove(__instance.Character.StringId); if (PartyScreenConfig.ExtraSettings.RecruitByDefault) { DisplayAllowed(__instance); } else { DisplayRemoved(__instance); } } PartyScreenConfig.Save(); return(false); } return(true); }
public void ExecuteResetPrisonerPaths() { InformationManager.DisplayMessage(new InformationMessage("Cleared Prisoner Paths!")); PartyScreenConfig.PrisonersToRecruit.Clear(); PartyScreenConfig.Save(); }
public void ExecuteResetUpgradePaths() { InformationManager.DisplayMessage(new InformationMessage("Cleared Upgrade Paths!")); PartyScreenConfig.PathsToUpgrade.Clear(); PartyScreenConfig.Save(); }