Consolidate the suite into one installable Institution mod with toggles
This repo is now the single player-facing mod. It bundles the whole engine and all three feature layers into one folder -- Core, Contraband, Justice, and Gangs DLLs plus Contraband's Defs -- with one About.xml and a settings shim that turns each layer on or off from a checkbox (all on by default). A player installs one mod (this) and Harmony; no separate Core dependency. - Source/Institution: the only new code, a settings shim (InstitutionMod + InstitutionModSettings) that writes the player's choices into Core's shared InstitutionSettings. It owns no gameplay. - Tools/package.sh: rebuilds the sibling DLLs clean and vendors them + Contraband's content in here, so the repo stays a complete drop-in. - Assemblies/, Defs/, Textures/, Languages/: the vendored, assembled mod. Still fully modular and splittable: the feature code stays in its own repos and DLLs (their About.xml files remain), so breaking this back into separate mods is just shipping them individually -- no code change.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net472</TargetFramework>
|
||||
<AssemblyName>Institution</AssemblyName>
|
||||
<RootNamespace>InstitutionSuite</RootNamespace>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>disable</Nullable>
|
||||
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<GenerateDependencyFile>false</GenerateDependencyFile>
|
||||
<DebugType>none</DebugType>
|
||||
<OutputPath>..\..\Assemblies\</OutputPath>
|
||||
<CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- The aggregate mod's only own code: a settings shim that writes the player's checkboxes into
|
||||
Core's shared InstitutionSettings. The feature DLLs (Contraband/Justice/Gangs) are vendored in
|
||||
at package time, not referenced here. Core holds the flags, so this references only Core. -->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
|
||||
<PackageReference Include="Krafs.Rimworld.Ref" Version="1.6.4871" ExcludeAssets="runtime" />
|
||||
<Reference Include="InstitutionCore">
|
||||
<HintPath>$(MSBuildThisFileDirectory)..\..\..\rimworld-core\Assemblies\InstitutionCore.dll</HintPath>
|
||||
<Private>false</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,72 @@
|
||||
using UnityEngine;
|
||||
using Verse;
|
||||
|
||||
namespace InstitutionSuite
|
||||
{
|
||||
/// <summary>
|
||||
/// The single player-facing mod. It bundles the Institution feature layers -- Contraband,
|
||||
/// Justice, Gangs -- 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="Contraband.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("Justice",
|
||||
ref settings.justice,
|
||||
"Classification, the deterrence feedback loop, 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 Justice.");
|
||||
l.End();
|
||||
settings.Apply(); // live: a toggle takes effect immediately for the gated behaviour
|
||||
}
|
||||
}
|
||||
|
||||
public class InstitutionModSettings : ModSettings
|
||||
{
|
||||
public bool contraband = true;
|
||||
public bool justice = true;
|
||||
public bool gangs = true;
|
||||
|
||||
/// <summary>Mirror the choices into Core's shared flags that every feature reads.</summary>
|
||||
public void Apply()
|
||||
{
|
||||
Contraband.InstitutionSettings.contraband = contraband;
|
||||
Contraband.InstitutionSettings.justice = justice;
|
||||
Contraband.InstitutionSettings.gangs = gangs;
|
||||
}
|
||||
|
||||
public override void ExposeData()
|
||||
{
|
||||
Scribe_Values.Look(ref contraband, "contraband", true);
|
||||
Scribe_Values.Look(ref justice, "justice", true);
|
||||
Scribe_Values.Look(ref gangs, "gangs", true);
|
||||
base.ExposeData();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user