public RuntimeGC(ModContentPack pack) : base(pack) { Settings = LoadedModManager.ReadModSettings <RuntimeGCSettings>(Content.PackageId, this.GetType().Name); Toolbox.Launcher.Launch(Settings.AutoCleanModMetaData, Settings.AutoCleanLanguageData, Settings.AutoCleanDefPackage); Mute.Launcher.Launch(Settings.DoMuteGC, Settings.DoMuteBL); Verse.Log.Message("[RuntimeGC] Mod settings loaded."); }
public static void DefsLoaded() { // Log.Warning("LWM.deepstorag - defs loaded"); // Todo? If settings are different from defaults, then: Setup(); // Architect Menu: if (architectMenuDesigCatDef != architectMenuDefaultDesigCatDef || architectMenuMoveALLStorageItems) // in which case, we need to redo menu anyway { ArchitectMenu_ChangeLocation(architectMenuDesigCatDef, true); } // Other def-related changes: if (defaultStoragePriority != StoragePriority.Important) { foreach (var d in allDeepStorageUnits) { d.building.defaultStorageSettings.Priority = defaultStoragePriority; } } // Re-read Mod Settings - some won't have been read because Defs weren't loaded: // (do this after above to allow user to override changes) // (LoadedModManager.GetMod(typeof(DeepStorageMod)).Content.Identifier and typeof(DeepStorageMod).Name by the way) //todo: Utils.Mess(Utils.DBF.Settings, "Defs Loaded. About to re-load settings"); //var s = LoadedModManager.ReadModSettings<Settings>("LWM.DeepStorage", "DeepStorageMod"); var mod = LoadedModManager.GetMod(typeof(DeepStorageMod)); var s = LoadedModManager.ReadModSettings <Settings>(mod.Content.FolderName, "DeepStorageMod"); }
public static void FillSimplifiedViewDict() { if (simplifiedView != null || instance?.Mod?.Content == null) return; // IEnumerable<ThingDef> l = DefDatabase<ThingDef>.AllDefsListForReading.Where(x => x.thingClass == typeof(Pawn) || x.thingClass != null && x.thingClass.IsSubclassOf(typeof(Pawn))); if (l.EnumerableNullOrEmpty()) return; // simplifiedView = new Dictionary<ThingDef, bool>(); foreach (var i in l) { simplifiedView[i] = false; } LoadedModManager.ReadModSettings<Sandy_RPG_Settings>(instance.Mod.Content.FolderName, instance.Mod.GetType().Name); }
public static void DefsLoaded() { // Log.Warning("LWM.deepstorag - defs loaded"); // Todo? If settings are different from defaults, then: // Def-related changes: //TODO: this should probably have an option.... if (defaultStoragePriority != StoragePriority.Important) { foreach (ThingDef d in AllDeepStorageUnits) { d.building.defaultStorageSettings.Priority = defaultStoragePriority; } } // Re-read Mod Settings - some won't have been read because Defs weren't loaded: // (do this after priority changes above to allow user to override changes) //todo: Utils.Mess(Utils.DBF.Settings, "Defs Loaded. About to re-load settings"); // NOTE/WARNING: the mod's settings' FolderName will be different for non-steam and steam versions. // Internally, they are loaded using: // this.modSettings = LoadedModManager // .ReadModSettings<T>(this.intContent.FolderName, base.GetType().Name); // So don't do this: // var s = LoadedModManager.ReadModSettings<Settings>("LWM.DeepStorage", "DeepStorageMod"); // Do this instead: var mod = LoadedModManager.GetMod(typeof(LWM.DeepStorage.DeepStorageMod)); Utils.Warn(Utils.DBF.Settings, "About to re-read mod settings from: " + GenText .SanitizeFilename(string.Format("Mod_{0}_{1}.xml", mod.Content.FolderName, "DeepStorageMod"))); var s = LoadedModManager.ReadModSettings <Settings>(mod.Content.FolderName, "DeepStorageMod"); // Architect Menu: if (architectMenuActualDef == null) { architectMenuActualDef = DefDatabase <DesignationCategoryDef> .GetNamed(architectMenuDefaultDesigCatDef); } if (architectMenuDesigCatDef != architectMenuDefaultDesigCatDef || architectMenuMoveALLStorageItems) // in which case, we need to redo menu anyway { ArchitectMenu_ChangeLocation(architectMenuDesigCatDef, true); } }