public static HashSet <string> GetMulticlassSet(this UnitDescriptor ch) { if (ch.HashKey() == null) { return(null); } return(Main.settings.selectedMulticlassSets.GetValueOrDefault(ch.HashKey(), new HashSet <string>())); }
public static void SetMulticlassSet(this UnitDescriptor ch, HashSet <string> multiclassSet) { if (ch.HashKey() == null) { return; } Main.settings.selectedMulticlassSets[ch.HashKey()] = multiclassSet; }
public static bool IsClassGestalt(this UnitDescriptor ch, BlueprintCharacterClass cl) { if (ch.HashKey() == null) { return(false); } var excludeSet = Main.settings.perSave.excludeClassesFromCharLevelSets.GetValueOrDefault(ch.HashKey(), new HashSet <string>()); return(excludeSet.Contains(cl.AssetGuid.ToString())); }
public static void Set(UnitDescriptor ch, MulticlassOptions options) { //modLogger.Log($"stack: {System.Environment.StackTrace}"); if (ch == null || ch.CharacterName == "Knight Commander") { Main.settings.multiclassSettings[CharGenKey] = options; } else { if (ch.HashKey() == null) { return; } Mod.Debug($"options: {options}"); Main.settings.perSave.multiclassSettings[ch.HashKey()] = options; Mod.Trace($"multiclass options: {string.Join(" ", Main.settings.perSave.multiclassSettings)}"); Settings.SavePerSaveSettings(); } }
public static void SetClassIsGestalt(this UnitDescriptor ch, BlueprintCharacterClass cl, bool exclude) { if (ch.HashKey() == null) { return; } var classID = cl.AssetGuid.ToString(); var excludeSet = Main.settings.perSave.excludeClassesFromCharLevelSets.GetValueOrDefault(ch.HashKey(), new HashSet <string>()); if (exclude) { excludeSet.Add(classID); } else { excludeSet.Remove(classID); } // Main.Log($"Set - key: {classID} -> {exclude} excludeSet: ({String.Join(" ", excludeSet.ToArray())})"); Main.settings.perSave.excludeClassesFromCharLevelSets[ch.HashKey()] = excludeSet; }
public static MulticlassOptions Get(UnitDescriptor ch) { //Main.Log($"stack: {System.Environment.StackTrace}"); MulticlassOptions options; if (ch == null || ch.CharacterName == "Knight Commander") { options = Main.settings.multiclassSettings.GetValueOrDefault(CharGenKey, new MulticlassOptions()); //Mod.Debug($"MulticlassOptions.Get - chargen - options: {options}"); } else { if (ch.HashKey() == null) { return(null); } options = Main.settings.perSave.multiclassSettings.GetValueOrDefault(ch.HashKey(), new MulticlassOptions()); //Mod.Debug($"MulticlassOptions.Get - {ch.CharacterName} - set: {options}"); } return(options); }