using System.Collections.Generic; using Verse; namespace BlaxDefaults { /// /// Mod settings: the toggles and the dismissed overlap warnings only. The defaults themselves live in /// their own file (DefaultsLibrary, DefaultsFile), never here: a mod settings file that fails to load is /// replaced by fresh settings on the next write. /// public class BlaxDefaultsSettings : ModSettings { /// Master switch. Off: no hook applies anything; the defaults file is kept. public bool enabled = true; /// New stockpiles start from their type's default. public bool stockpileDefaults = true; /// New storage buildings start from their kind's default. public bool storageDefaults = true; /// New production bills get the values of "Every new bill". public bool billDefaults = true; /// The forbid rules as a category: off, no gear rule, strip switch or corpse switch acts. public bool forbidRules = true; /// "Gear your colony drops". Acts only with a saved filter under forbid:colony. public bool colonyGearRule; /// The colony rule's "Where": anywhere (true) or only inside the home area. public bool colonyGearAnywhere = true; /// "Gear enemies drop". Acts only with a saved filter under forbid:enemies. public bool enemyGearRule; /// The enemy rule's "Where": anywhere (true) or only inside the home area. public bool enemyGearAnywhere = true; /// Stripping one of your colony's pawns or corpses forbids what the colony filter refuses. public bool colonyStripRule; /// Stripping an enemy or an enemy corpse forbids what the enemy filter refuses. public bool enemyStripRule; /// Animal corpses outside the home area are allowed. public bool animalCorpsesAllowed; /// Enemy corpses outside the home area are allowed. public bool enemyCorpsesAllowed; /// Other corpses outside the home area are allowed. public bool otherCorpsesAllowed; /// The settings page and one message per session name active mods that do some of the same things. public bool warnOverlaps = true; /// Package ids whose overlap message the player dismissed with "Don't remind me". public List dismissedOverlaps = new List(); public override void ExposeData() { base.ExposeData(); Scribe_Values.Look(ref enabled, "enabled", true); Scribe_Values.Look(ref stockpileDefaults, "stockpileDefaults", true); Scribe_Values.Look(ref storageDefaults, "storageDefaults", true); Scribe_Values.Look(ref billDefaults, "billDefaults", true); Scribe_Values.Look(ref forbidRules, "forbidRules", true); Scribe_Values.Look(ref colonyGearRule, "colonyGearRule", false); Scribe_Values.Look(ref colonyGearAnywhere, "colonyGearAnywhere", true); Scribe_Values.Look(ref enemyGearRule, "enemyGearRule", false); Scribe_Values.Look(ref enemyGearAnywhere, "enemyGearAnywhere", true); Scribe_Values.Look(ref colonyStripRule, "colonyStripRule", false); Scribe_Values.Look(ref enemyStripRule, "enemyStripRule", false); Scribe_Values.Look(ref animalCorpsesAllowed, "animalCorpsesAllowed", false); Scribe_Values.Look(ref enemyCorpsesAllowed, "enemyCorpsesAllowed", false); Scribe_Values.Look(ref otherCorpsesAllowed, "otherCorpsesAllowed", false); Scribe_Values.Look(ref warnOverlaps, "warnOverlaps", true); Scribe_Collections.Look(ref dismissedOverlaps, "dismissedOverlaps", LookMode.Value); if (Scribe.mode == LoadSaveMode.PostLoadInit || Scribe.mode == LoadSaveMode.LoadingVars) dismissedOverlaps ??= new List(); } /// Back to the shipped values. Leaves the defaults file alone. public void Reset() { var d = new BlaxDefaultsSettings(); enabled = d.enabled; stockpileDefaults = d.stockpileDefaults; storageDefaults = d.storageDefaults; billDefaults = d.billDefaults; forbidRules = d.forbidRules; colonyGearRule = d.colonyGearRule; colonyGearAnywhere = d.colonyGearAnywhere; enemyGearRule = d.enemyGearRule; enemyGearAnywhere = d.enemyGearAnywhere; colonyStripRule = d.colonyStripRule; enemyStripRule = d.enemyStripRule; animalCorpsesAllowed = d.animalCorpsesAllowed; enemyCorpsesAllowed = d.enemyCorpsesAllowed; otherCorpsesAllowed = d.otherCorpsesAllowed; warnOverlaps = d.warnOverlaps; dismissedOverlaps = new List(); } } }