The suite's classes all lived in namespace Contraband -- a historical artifact from the original Contraband monolith, which read oddly for a class in Corrections or Policing. Renamed to namespace Institution across every layer (46 .cs, the XML Class= refs, RootNamespace, the aggregate shim). The Contraband MODULE, its Contraband.dll assembly, and the Contraband-named classes (CompContraband, MapComponent_Contraband, ContrabandUtility, ...) are unchanged. Harness-verified 45/0. Also adds a CC-BY-NC-SA 4.0 LICENSE file. Aggregate: the settings shim now writes Institution.InstitutionSettings; Assemblies re-vendored with the renamed DLLs; ROADMAP status refreshed to the six-layer suite at 0.1.0.
87 lines
4.3 KiB
C#
87 lines
4.3 KiB
C#
using UnityEngine;
|
|
using Verse;
|
|
|
|
namespace InstitutionSuite
|
|
{
|
|
/// <summary>
|
|
/// The single player-facing mod. It bundles the Institution feature layers -- Contraband,
|
|
/// Justice, Gangs, Ward -- into one install with a checkbox per layer, and it owns NO gameplay code of
|
|
/// its own. All it does is read the player's choices and write them into Core's shared
|
|
/// <see cref="Institution.InstitutionSettings"/>, which the feature assemblies (shipped alongside
|
|
/// in this same mod) read at their entry points.
|
|
///
|
|
/// This is the whole "merge": a thin settings shim on top of the unchanged, still-separate feature
|
|
/// DLLs. Everything defaults ON, so a fresh install is the full experience and the player opts out
|
|
/// of pieces they don't want. Pull this mod apart into its layers again and nothing here is missed
|
|
/// -- the features default their flags to true on their own.
|
|
/// </summary>
|
|
public class InstitutionMod : Mod
|
|
{
|
|
private readonly InstitutionModSettings settings;
|
|
|
|
public InstitutionMod(ModContentPack content) : base(content)
|
|
{
|
|
settings = GetSettings<InstitutionModSettings>();
|
|
settings.Apply(); // push the loaded choices into Core before the features' static ctors run
|
|
}
|
|
|
|
public override string SettingsCategory() => "Institution";
|
|
|
|
public override void DoSettingsWindowContents(Rect inRect)
|
|
{
|
|
Listing_Standard l = new Listing_Standard();
|
|
l.Begin(inRect);
|
|
l.CheckboxLabeled("Contraband",
|
|
ref settings.contraband,
|
|
"Concealment and intake, improvised shivs, Prison-Architect tunnels, warden search, and warden corruption.");
|
|
l.Gap();
|
|
l.CheckboxLabeled("Corrections",
|
|
ref settings.corrections,
|
|
"Classification, discipline and reform, parole, and prisoner recreation (Regime).");
|
|
l.Gap();
|
|
l.CheckboxLabeled("Gangs",
|
|
ref settings.gangs,
|
|
"Gangs as contraband economies: joining by disposition, smuggling networks, rivalry, and fights-as-crime. Leans on Contraband and Corrections.");
|
|
l.Gap();
|
|
l.CheckboxLabeled("Policing (colony crime)",
|
|
ref settings.policing,
|
|
"The enforcement and order layer: your own colonists commit crimes on a spectrum (rarer in small, tight colonies), witnesses and a constable's work name the culprit, and a weighed arrest can end in a cell -- or a resisted breakout. Also owns the deterrence feedback loop and prison riots. A big behavioural change; turn it off to run the rest of the suite without colony crime.");
|
|
l.Gap();
|
|
l.CheckboxLabeled("Ward (psychiatric care)",
|
|
ref settings.ward,
|
|
"Commit a prisoner for treatment instead of punishment: sustained counselling in a proper ward reduces the disorder that broke them and builds a recovery track toward discharge. Neglect a committed patient and they deteriorate. Uses Harmony.");
|
|
l.End();
|
|
settings.Apply(); // live: a toggle takes effect immediately for the gated behaviour
|
|
}
|
|
}
|
|
|
|
public class InstitutionModSettings : ModSettings
|
|
{
|
|
public bool contraband = true;
|
|
public bool corrections = true;
|
|
public bool gangs = true;
|
|
public bool policing = true;
|
|
public bool ward = true;
|
|
|
|
/// <summary>Mirror the choices into Core's shared flags that every feature reads.</summary>
|
|
public void Apply()
|
|
{
|
|
Institution.InstitutionSettings.contraband = contraband;
|
|
Institution.InstitutionSettings.corrections = corrections;
|
|
Institution.InstitutionSettings.gangs = gangs;
|
|
Institution.InstitutionSettings.policing = policing;
|
|
Institution.InstitutionSettings.ward = ward;
|
|
}
|
|
|
|
public override void ExposeData()
|
|
{
|
|
Scribe_Values.Look(ref contraband, "contraband", true);
|
|
Scribe_Values.Look(ref corrections, "corrections", true);
|
|
Scribe_Values.Look(ref gangs, "gangs", true);
|
|
Scribe_Values.Look(ref policing, "policing", true);
|
|
Scribe_Values.Look(ref ward, "ward", true);
|
|
base.ExposeData();
|
|
}
|
|
}
|
|
}
|