public void OnDisabled() { if (HarmonyHelper.IsHarmonyInstalled) { DynamicAssetSorter.UnpatchAll(); } }
public static void Reload() { // Create a new rules config if it doesn't exist if (!File.Exists(ModConfig.configPath)) { ModConfig.ResetConfig(); } ModConfig.ReadConfig(); if (InGame()) { DynamicAssetSorter.Update(); } }
public void OnSettingsUI(UIHelperBase helper) { // Load Setting(s) ModConfig config = Configuration <ModConfig> .Load(); UIHelperBase group_main = helper.AddGroup("Dynamic Asset Sorter"); group_main.AddCheckbox("Sort vanilla and custom assets interchangeably", config.IsMixedSortEnabled, delegate(bool isEnabled) { config.IsMixedSortEnabled = isEnabled; Configuration <ModConfig> .Save(); DynamicAssetSorter.Update(); }); group_main.AddSpace(10); group_main.AddButton($"Reload Settings", () => Reload()); group_main.AddSpace(10); group_main.AddButton("Edit Settings File", () => OpenConfig()); group_main.AddSpace(40); group_main.AddButton("Reset Settings File", () => ResetConfigPrompt()); }
public void OnEnabled() { ModConfig.ReadConfig(); HarmonyHelper.DoOnHarmonyReady(() => DynamicAssetSorter.PatchAll()); }