Underground Pipes - a mod for Captain of Industry
Version 0.9.15  |  Verified on game 0.8.5

WHAT IT DOES
- Route the game's normal fluid pipes below the terrain and connect them back to
  surface pipes. No new buildings or assets.
- Earned depth: the basic pipe can go 1 level down; upgraded pipe tiers (T2+,
  unlocked through research) earn a 2nd, deeper level. Deeper routing is a reward
  for progression, not a free cheat.
- While digging, the route preview is colour-coded by validity:
  green = OK, amber = at the depth limit, red = invalid (e.g. below sea level).
- Buried pipes are shown as a translucent, depth-colour-coded x-ray overlay
  (cyan for level 1, orange for level 2), visible across the whole network.
- The current depth level is shown at the cursor while you dig.
- Hover any pipe to see, at the cursor: the product flowing through it (big icon),
  how full it is (fill bar), and whether it's flowing or stuck; the whole buried
  run lights up while you hover.
- Optional "colour by product" mode for the x-ray overlay (mod settings).
- Configurable in the in-game mod settings: maximum burial depth, colour-by-product.
- Buried pipes are protected from being deleted together with surface structures.

HOW TO USE
- Pick a pipe in the build menu as usual.
- Press the "lower" (down) button to dig the pipe below the surface, "raise" (up)
  to bring it back up. The level number is shown at the cursor.
- Depth depends on the pipe's TIER:
      Tier 1 pipe  -> 1 level underground
      Tier 2+ pipe -> 2 levels underground
  (Pipe tiers are unlocked through research, so deeper burial is earned.)
- Eye toolbar button: show / hide the underground x-ray overlay (and the hover read-out).
- Hover any pipe to see its current contents as a product icon at the cursor.
- Trash toolbar button (in the delete tool): allow deleting buried pipes on purpose.
  While it is OFF, removing surface structures will NOT delete the buried pipes under them.

INSTALL
- Extract the "UndergroundPipes" folder into:
      %APPDATA%\Captain of Industry\Mods\
- 0Harmony.dll is included and required.

NOTES
- Burial depth is limited by the ground height: a pipe cannot go below the world
  floor (sea level), and the transport path-finder only reaches a limited vertical
  band, so the deeper levels need high enough terrain.

CHANGELOG
0.9.15
- The pipe inspector is now EMBEDDED into the game's own pipe panel: click any pipe (buried or
  surface) and the native panel gets a "source -> destination" section showing the real building
  that feeds the pipe and the one it feeds (clickable to fly the camera there), plus how full those
  tanks are. The separate floating inspector window is gone - it's all native now.

0.9.14
- Source/destination now traces through ALL routing devices (connectors, balancers, zippers,
  mini-zippers, distributors) and stops only at a real machine or storage tank - so it shows the
  actual building, not the connector in between.
- Turning off "Source/destination building icons" now removes them completely instead of showing
  crossed-out placeholder icons.
- Removed the fill bar from the cursor read-out (the "P%" number already shows how full the pipe is).
- Settings window tidied up: more spacing between rows, sections indented, and the brightness slider
  now shows the real percentage (it used to show the track position).

0.9.13
- X-ray brightness is now a SLIDER (drag it and the whole overlay dims/brightens live), with the
  current % shown next to it. Default brightness lowered to 40% so the pipes sit more in the
  background out of the box.

0.9.12
- Added a global x-ray BRIGHTNESS control (requested on the forum): an "X-ray brightness" section
  in the settings with preset buttons (20-100%) that dims/brightens ALL buried pipes at once.
  Also editable via config.json (overlayBrightness). Lower it if the pipes look too bright.

0.9.11
- The settings panel is now a proper game window (like Cheat++): a title bar with a close (X)
  button and a pin, and you can drag it around. Section headers, and the colour schemes are shown
  as bordered two-colour "chips" so it's clear each one is a scheme you can click.

0.9.10
- The tank read-out now shows the actual amount as well as the percentage, e.g.
  "in 4/400 (1%)  ->  out 320/400 (80%)".

0.9.9
- Fixed tank fill always reading 0%: it is now computed from the tank's real current/capacity
  (the raw Percent value it used before was not a 0-100 percentage).
- The inspector is now auto-pinned to the LEFT edge of the screen, vertically centred - no more
  position sliders (they wouldn't drag). One less thing to fiddle with.

0.9.8
- Removed the "flowing/stuck" word from the cursor read-out (it jittered) - the fill bar already
  shows how full the pipe is.
- The inspector now shows storage TANK fill %: if the pipe comes from and/or goes to a tank, it
  reads "in 73%  ->  out 20%". The trace now stops at tanks/storages (so the tank is shown as the
  source/destination) while still passing through pipe balancers/sorters.
- The inspector now defaults to a fixed spot at the top-left, just under the top bar (turn on
  inspectorAtCursor to have it pop up where you click instead).
- New compact in-game settings panel: real checkboxes, LIVE sliders for the inspector position and
  icon size (drag and it moves in real time), and clickable colour-scheme swatches for the x-ray
  colours - all in a scrollable box that fits the screen.
- Pipe length shows a clean whole number of tiles.

0.9.7
- Settings gear is now slotted INTO the top game-speed bar (in line with pause/play/fast-
  forward), instead of floating over the world where it overlapped the controls.
- Settings panel now fits any screen: it is a fixed-size, SCROLLABLE box.
- The clickable inspector now appears right where you click the pipe (set inspectorAtCursor
  to off to pin it at a fixed InspectorTop/InspectorLeft instead).
- Fixed the ugly pipe length: it now shows a rounded whole number of tiles (was e.g. 8.608398).

0.9.6
- Read-out no longer jitters: the "flowing/stuck" word and numbers sit in their own fixed
  boxes and only update when they actually change.
- Source/destination now traces THROUGH routing buildings (pipe balancers, distributors,
  sorters, valves - e.g. the Gameplay++ Pipe Balancer/Sorter) to the real machine that
  produces or consumes the fluid, instead of stopping at the balancer.
- The clickable inspector is now driven by CLICKING a pipe (not hovering), so you can safely
  move the mouse to it without changing the selection. It stays visible, is OFF by default,
  and now shows richer info: product name, buffered amount + fill %, pipe length, and live
  flow (units moved per second) / stuck. Its two building icons still fly the camera there.
- Settings gear moved to the top-right, near the game-speed controls (position configurable
  via settingsButtonTop / settingsButtonRight) instead of the screen centre.
- InspectorTop / InspectorLeft now move the panel live when changed.
- MaxDepth is no longer an editable setting (2 levels for T2+ pipes is a fixed mod feature).

0.9.5
- Source/destination now shows the REAL building: the read-out walks THROUGH pipes, lifts and
  routing buildings (distributors, valves, junctions) and stops at the actual machine that
  produces or consumes the fluid, instead of stopping at a distributor in the middle.
- Cleaner panel layout: everything is vertically centred with even spacing and consistent icon
  sizes (previously the icons sat crooked next to the text and bar).
- The clickable inspector panel now stays visible permanently (it used to vanish after a few
  seconds). It is OFF by default - turn it on in the settings.
- NEW in-game settings button: a gear icon just under the top time/speed controls opens a panel
  with ALL of this mod's settings (toggles + fields), so you no longer have to hunt for them.
  (The settings also still live under Main Menu -> Mods & DLCs -> the gear on this mod's tile.)

0.9.4
- NEW clickable "pipe inspector" panel (a small fixed panel in the corner): it mirrors the
  last pipe you hovered - source building -> product -> destination building - and the two
  building icons are CLICKABLE: click one to fly the camera straight to that building.
  (The cursor read-out follows the mouse and can't be clicked; this panel sits still and
  stays up for a few seconds after you stop hovering so you can reach it and click.)
- New settings:
    showInspector           - turn the clickable inspector panel on/off
    inspectorTop/Left       - where the inspector sits on screen (pixels)
    inspectorLingerSeconds  - how long it stays clickable after you stop hovering

0.9.3
- Hover read-out now shows the SOURCE building (what feeds the pipe) and the DESTINATION
  building (what it feeds) as icons on either side of the product - it walks through
  connected pipes/junctions to find the real building at each end.
- The source/destination building icons are now larger and their size is configurable.
- New settings (config.json / in-game mod settings):
    showReadout        - turn the whole hover read-out on/off
    showBuildingIcons  - turn the source/destination building icons on/off
    iconSize           - size of those icons in pixels
    colorShallow       - x-ray overlay colour for the shallowest level (hex, e.g. 00d2ff)
    colorDeep          - x-ray overlay colour for the deepest level (hex, e.g. ff7700)

0.9.2
- Fix: the hover read-out now shows the real unit amount in a pipe (matching the game's
  own inspector) instead of the number of product packets - it used to read half the
  amount because each packet can carry more than one unit.

0.9.1
- Cheat++ compatibility: buried pipes stay protected from bulldozing by default, and this
  mod's "delete buried pipes" button now also flips Cheat++'s matching toggle - so one button
  frees both mods at once instead of the old "you must enable it in both" conflict. When
  Cheat++'s own burying is active, this mod yields the depth stepping to it to avoid a double
  step. The x-ray overlay and hover read-out keep working on top of whichever mod buried the pipes.

0.9.0
- The "delete buried pipes" toggle now always starts OFF when you load a game, so a
  toggle left on in a previous session can't accidentally bulldoze buried pipes.
- Hover read-out v2: the cursor panel now also shows a fill bar and a flowing/stuck
  indicator, and hovering lights up the whole buried run in the x-ray overlay.
- Configurable settings (config.json / in-game mod settings): maximum burial depth
  (1-8) and an optional "colour by product" overlay mode.
- Colour-by-product: option to tint the x-ray by the product in each pipe instead
  of by depth, so you can tell networks apart at a glance.

0.8.1
- Fix: building/connecting a buried pipe could throw "Set changed while enumerating"
  in the overlay and abort the toolbar input update, which could break the connection
  being made. The overlay now iterates a safe snapshot.
- Fix: hover read-out no longer spams an assert when the cursor is over off-map tiles.

0.8.0
- Tier-based depth: Tier 1 pipe digs 1 level down, Tier 2+ pipes dig 2 levels.
  Deeper burial is now earned through pipe-tier research instead of being free.
- Placement preview is colour-coded by validity (green / amber / red).
- Hover read-out: point at any pipe (buried or surface) to see what is flowing
  through it as a big product icon + count at the cursor.
- Toolbar buttons line up flush with the rest of the bar; stability fixes.

0.5.0
- Route vanilla fluid pipes underground with a depth-colour-coded x-ray overlay,
  a show/hide button, and protection from accidental deletion.

CREDITS
- Built with Harmony (0Harmony.dll, MIT license - see licenses/0Harmony-LICENSE.txt).
