private static void Bootup() { if (Egcb_MutableMutations.bStarted == true) { return; } Egcb_MutableMutations.bStarted = true; Egcb_MutableMutations.OptionsList = new List <string>(); Egcb_MutableMutations.CachedOptionValues = new Dictionary <string, string>(); Egcb_MutableMutations.MutationData = new List <MutationCategory>(); Egcb_MutableMutations.MutationCategoryDict = new Dictionary <string, MutationCategory>(); //Load mutation data from the default Mutations.xml file. Only vanilla mods are supported for now. // While I considered loading data from other mods, it seems like that could // cause issues if the user uninstalled one of those mods later and MutableMutations then tried to load data for that mod's mutations. // A possible solution later would be to directly update the Mutations.xml file in that mod's folder, instead of generating an override // (that would probably be necessary anyway because I don't think we can guarantee the order Mods are loaded.) Egcb_MutableMutations.LoadVanillaMutations(); //Create our custom option list for each mutation, adding them to the game's Option list Egcb_MutableMutations.CreateOptionsList(); //Generate a custom Mutations.xml file in our mod's directory. This is unfortunately necessary because the game reloads Mutations.xml //files every time that the player re-enters the Character Generation screen, so we can't just change the Costs in MutationFactory Egcb_MutableMutations.ApplyMutationOptions(true); //start the MonoBehavior Coroutine to poll for the options menu. We'll update Mutations.xml every time the user changes mutations options Egcb_MutableMutations.StartOptionsMonitor(); }
public static void ReapplyOptions() { //the user selected the option to reset all mutation costs to default if (Options.GetOption(Egcb_MutableMutations.ResetMutationValueOptionID) == "Yes") { Options.SetOption(Egcb_MutableMutations.ResetMutationValueOptionID, "No"); Egcb_MutableMutations.ResetMutationCosts(); Egcb_MutableMutations.ApplyMutationOptions(false); } //check if any mutation cost settings were changed, and if so, rebuild Mutations.xml else if (!Egcb_MutableMutations.ValidateCache()) { Egcb_MutableMutations.ApplyMutationOptions(false); } }