# pitr-dev/ukbutt-mod architecture

> Architecture diagram of the GitHub repository pitr-dev/ukbutt-mod, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pitr-dev/ukbutt-mod
- Repository: https://github.com/pitr-dev/ukbutt-mod

## Overview

UKButt is a BepInEx ULTRAKILL mod that translates game events and style rank into haptic commands for devices managed by an Intiface/Buttplug server. The main path is plugin startup and Harmony event capture, through input-mode and vibration logic, to the client’s connected devices; players can configure preferences or invoke console and cheat controls. The README also documents varied, continuous-rank, and controller-rumble passthrough modes. The available excerpts show the manager’s internal responsibilities, but do not expose all device-loop and preference reads, so those links are limited to documented or indexed evidence.

Main entry points: [`ButtplugManager.cs`](https://github.com/pitr-dev/ukbutt-mod/blob/master/ButtplugManager.cs) (Haptic manager), [`HarmonyPatches.cs`](https://github.com/pitr-dev/ukbutt-mod/blob/master/HarmonyPatches.cs) (Gameplay event patches), [`ULTRAKILL/UKButt.cs`](https://github.com/pitr-dev/ukbutt-mod/blob/master/ULTRAKILL/UKButt.cs) (Console command), [`ULTRAKILL/UKButtCycleMode.cs`](https://github.com/pitr-dev/ukbutt-mod/blob/master/ULTRAKILL/UKButtCycleMode.cs) (Mode cycling cheat)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Game integration"]
  node_patches["Gameplay event patches<br/>[HarmonyPatches.cs]"]
  node_rank["Rank tracking<br/>[HarmonyPatches.cs]"]
end

subgraph group_runtime["Haptic runtime"]
  node_manager["Haptic manager<br/>[ButtplugManager.cs]"]
  node_devices["Connected devices<br/>[ButtplugManager.cs]"]
  node_plugin["Plugin identity<br/>[PluginInfo.cs]"]
end

subgraph group_controls["Player controls"]
  node_preferences["Preference keys"]
  node_console["Console command<br/>[UKButt.cs]"]
  node_modecheat["Mode cycling cheat<br/>[UKButtCycleMode.cs]"]
  node_stopcheat["Emergency stop cheat<br/>[UKButtStopCheat.cs]"]
end

node_player(("Player"))
node_ultrakill["ULTRAKILL"]
node_intiface[("Intiface server")]

node_manager -->|"installs patches"| node_patches
node_patches -->|"forwards events"| node_manager
node_patches -->|"updates rank"| node_rank
node_manager -->|"reads rank"| node_rank
node_manager -->|"connects and scans"| node_intiface
node_manager -->|"sends haptics"| node_devices
node_intiface -->|"reports devices"| node_devices
node_player -->|"configures mod"| node_console
node_console -->|"restarts client"| node_manager
node_manager -->|"registers command"| node_console
node_player -->|"cycles mode"| node_modecheat
node_modecheat -->|"sets mode"| node_preferences
node_player -.->|"toggles stop"| node_stopcheat
node_stopcheat -->|"sets emergency stop"| node_manager
node_manager -->|"reads settings"| node_preferences
node_plugin -->|"identifies plugin"| node_manager
node_ultrakill -->|"emits patched events"| node_patches
node_ultrakill -.->|"provides rumble input"| node_manager

click node_patches "https://github.com/pitr-dev/ukbutt-mod/blob/master/HarmonyPatches.cs"
click node_rank "https://github.com/pitr-dev/ukbutt-mod/blob/master/HarmonyPatches.cs"
click node_manager "https://github.com/pitr-dev/ukbutt-mod/blob/master/ButtplugManager.cs"
click node_devices "https://github.com/pitr-dev/ukbutt-mod/blob/master/ButtplugManager.cs"
click node_preferences "https://github.com/pitr-dev/ukbutt-mod/blob/master/UKButtProperties.cs"
click node_console "https://github.com/pitr-dev/ukbutt-mod/blob/master/ULTRAKILL/UKButt.cs"
click node_modecheat "https://github.com/pitr-dev/ukbutt-mod/blob/master/ULTRAKILL/UKButtCycleMode.cs"
click node_stopcheat "https://github.com/pitr-dev/ukbutt-mod/blob/master/ULTRAKILL/UKButtStopCheat.cs"
click node_plugin "https://github.com/pitr-dev/ukbutt-mod/blob/master/PluginInfo.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_patches,node_rank toneBlue
class node_manager,node_devices,node_plugin,node_intiface toneAmber
class node_preferences,node_console,node_modecheat,node_stopcheat toneMint
class node_player,node_ultrakill toneIndigo
```

## Components

### Game integration

- [Gameplay event patches](https://github.com/pitr-dev/ukbutt-mod/blob/master/HarmonyPatches.cs): `HarmonyPatches.cs`
- [Rank tracking](https://github.com/pitr-dev/ukbutt-mod/blob/master/HarmonyPatches.cs): `HarmonyPatches.cs`

### Haptic runtime

- [Haptic manager](https://github.com/pitr-dev/ukbutt-mod/blob/master/ButtplugManager.cs): `ButtplugManager.cs`
- [Connected devices](https://github.com/pitr-dev/ukbutt-mod/blob/master/ButtplugManager.cs): `ButtplugManager.cs`
- [Plugin identity](https://github.com/pitr-dev/ukbutt-mod/blob/master/PluginInfo.cs): `PluginInfo.cs`

### Player controls

- [Preference keys](https://github.com/pitr-dev/ukbutt-mod/blob/master/UKButtProperties.cs): `UKButtProperties.cs`
- [Console command](https://github.com/pitr-dev/ukbutt-mod/blob/master/ULTRAKILL/UKButt.cs): `ULTRAKILL/UKButt.cs`
- [Mode cycling cheat](https://github.com/pitr-dev/ukbutt-mod/blob/master/ULTRAKILL/UKButtCycleMode.cs): `ULTRAKILL/UKButtCycleMode.cs`
- [Emergency stop cheat](https://github.com/pitr-dev/ukbutt-mod/blob/master/ULTRAKILL/UKButtStopCheat.cs): `ULTRAKILL/UKButtStopCheat.cs`

### Other components

- **Player**
- **ULTRAKILL**
- **Intiface server**

## Connections

- Haptic manager → Gameplay event patches: installs patches (evidence: `ButtplugManager.cs`)
- Gameplay event patches → Haptic manager: forwards events (evidence: `HarmonyPatches.cs`)
- Gameplay event patches → Rank tracking: updates rank (evidence: `HarmonyPatches.cs`)
- Haptic manager → Rank tracking: reads rank (evidence: `HarmonyPatches.cs`)
- Haptic manager → Intiface server: connects and scans (evidence: `ButtplugManager.cs`)
- Haptic manager → Connected devices: sends haptics (evidence: `ButtplugManager.cs`)
- Intiface server → Connected devices: reports devices (evidence: `ButtplugManager.cs`)
- Player → Console command: configures mod (evidence: `README.md`)
- Console command → Haptic manager: restarts client (evidence: `ULTRAKILL/UKButt.cs`)
- Haptic manager → Console command: registers command (evidence: `ButtplugManager.cs`)
- Player → Mode cycling cheat: cycles mode (evidence: `README.md`)
- Mode cycling cheat → Preference keys: sets mode (evidence: `ULTRAKILL/UKButtCycleMode.cs`)
- Player → Emergency stop cheat: toggles stop
- Emergency stop cheat → Haptic manager: sets emergency stop (evidence: `ULTRAKILL/UKButtStopCheat.cs`)
- Haptic manager → Preference keys: reads settings (evidence: `ButtplugManager.cs`)
- Plugin identity → Haptic manager: identifies plugin (evidence: `ButtplugManager.cs`)
- ULTRAKILL → Gameplay event patches: emits patched events (evidence: `HarmonyPatches.cs`)
- ULTRAKILL → Haptic manager: provides rumble input
