Crowd Control for Kerbal Space Program
=======================================

Lets your viewers interact with your flight while you stream: force a stage
separation, deploy or cut every parachute, shove a kerbal out the airlock,
randomize your fuel, drain your batteries, flip gravity, summon the Kraken,
hand the controls to Jeb, spawn a named asteroid, or put YOUR name on a
kerbal and shove them out the airlock - or help out with a bailout package.
31 effects total, split between the editor, flight, physics, chaos, crew,
and the career budget.

This is a NATIVE KSP addon, not a BepInEx plugin. It needs no mod loader and
coexists with ModuleManager, Kopernicus, MechJeb and the rest of a normal
CKAN install.


REQUIREMENTS
------------
- Kerbal Space Program 1.12.x (Steam, PC), verified on 1.12.5
- The Crowd Control desktop app: https://crowdcontrol.live

FIRST LAUNCH: the mod does nothing on its own. It only connects when the
Crowd Control desktop app is running, and stays quiet otherwise. Start the
game, then connect with the app. If the app is running elevated (as
administrator) the mod may fail to detect it and never dial out - set
AlwaysAttemptConnection = true in settings.cfg (see CONFIGURATION) to skip
the detection check.


INSTALLATION
------------
Extract this archive directly into your KSP install folder (the one with
KSP_x64.exe in it), so that:

    GameData/CrowdControl/

lands beside

    GameData/Squad/

The CrowdControl folder contains ten files, all sitting directly inside
GameData/CrowdControl/:

    CrowdControl.KerbalSpaceProgram.dll   - the mod itself
    ConnectorLib.JSON.dll                 - the Crowd Control connector library
    Newtonsoft.Json.dll                   - JSON library the connector uses
    System.Data.dll                       - Unity-Mono framework libraries that
    System.Numerics.dll                     KSP's trimmed framework folder is
    System.Runtime.Serialization.dll        missing; required, do not delete
    System.Xml.Linq.dll                   -
    ccver                                 - version stamp used by the CC app
    settings.cfg                          - every streamer setting at its default (edit to taste)
    README.txt                            - this file

Start the game, then connect with the Crowd Control app.

CKAN users: the archive follows the standard GameData layout, so it can be
installed as a CKAN-compatible mod folder - "GameData/CrowdControl" is the
identifier. Manual install works exactly the same.


CONFIGURATION (optional)
------------------------
The mod ships with GameData/CrowdControl/settings.cfg containing every
setting at its default. Edit any line to change it, or delete the file to
return to the built-in defaults. Every flag, with its default:

    CrowdControl
    {
        ShowInGameMessages = true        // on-screen toasts (connection, effects, flavor text)
        PostToMessageSystem = true       // also archive connection/viewer-spawn events in the Messages panel
        ShowViewerNames = true           // "<Viewer> sent <Effect>" naming in toasts
        AnnounceViewerSpawns = true      // viewer-spawn effects always toast (see below)
        ShowConnectionIndicator = false  // IMGUI overlay: connection banner
        ShowActiveEffects = false        // IMGUI overlay: running timed-effects list
        MessageDuration = 3.0            // toast length in seconds (clamped to 1-10)
        OverlayPosition = TopLeft        // TopLeft, TopRight, BottomLeft, BottomRight
        ReconnectHotkey = F9             // force a reconnect to the CC app
        DiagnosticsHotkey = F8           // cycle the diagnostics panel
        AlwaysAttemptConnection = false  // connect even when no CC app is detected
    }

Every line is optional - omit any flag to keep its default.

All player-facing text - connection toasts ("Crowd Control connected"),
effect toasts ("<Viewer> sent <Effect>") and the effect flavor lines
("STAGE!", "The Kraken has been summoned!") - uses KSP's own stock
message area at the top-center of the screen. ShowInGameMessages gates
all of it. AnnounceViewerSpawns lets viewer-spawn effects (VIP Spacewalk,
Stowaway, Join the Space Program, Incoming Asteroid, Name This Vessel) post
their toast even when ShowInGameMessages is off - they name the viewer
in-game and are hard to notice otherwise.

PostToMessageSystem additionally files connection events (connected /
disconnected) and viewer-spawn announcements in KSP's persistent
Messages panel (the envelope icon on the bottom-right toolbar), so those
moments survive after the toast fades. Regular effect messages stay
toast-only so the panel is not flooded mid-stream. Archived entries
behave exactly like stock contract/milestone messages - they persist in
the save until you read and discard them. Note that neither toasts nor
the Messages panel exist on the main menu; both appear from the KSC
scene onward.

The mod's own IMGUI overlay panel (a "CROWD CONTROL" connection banner
plus a list of running timed effects) is OFF by default in this pack.
That panel is the generic fallback for games with no native way to show
messages; KSP has one, and the panel's default position overlaps the
game's own top UI bar. To re-enable it, set ShowConnectionIndicator and
ShowActiveEffects to true in settings.cfg (OverlayPosition moves it to
another corner: TopLeft, TopRight, BottomLeft, BottomRight).

F9 forces a reconnect to the Crowd Control app. F8 cycles the overlay
through normal, diagnostics, and hidden - the diagnostics panel draws
even while the overlay is off, so F8 still works as a troubleshooting
view.


REMOVAL
-------
Delete the GameData/CrowdControl folder. The mod patches nothing and writes
nothing outside that folder, so the game is untouched otherwise.
