# riotgames/leaguedirector architecture

> Architecture diagram of the GitHub repository riotgames/leaguedirector, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/riotgames/leaguedirector
- Repository: https://github.com/riotgames/leaguedirector

## Overview

#### Purpose and Runtime

League Director is a Windows desktop tool for directing and recording League of Legends replay footage. It runs on Python 3.10 with PySide6/Qt, connects to the game’s Replay API, and exposes replay, camera, rendering, sequencing, and capture controls. Startup is via `run.bat` for development; distributable packaging is defined under `build/`.

#### Application Bootstrap and UI Shell

`leaguedirector/app.py` is the likely Qt application/bootstrap boundary, assembling the desktop window and top-level workflows. `leaguedirector/widgets.py` supplies reusable Qt UI controls, while `leaguedirector/settings.py` provides persisted application/user settings. This is a native desktop client rather than a web service.

Paths:
- `leaguedirector/app.py`
- `leaguedirector/widgets.py`
- `leaguedirector/settings.py`

#### Replay API Integration

`leaguedirector/api.py` is the external-control boundary to a running League replay. The application must detect/connect to the replay API and issue commands for playback, camera, UI visibility, graphics, and capture. The game must have `EnableReplayApi=1`, and replay availability is an external runtime dependency.

Paths:
- `leaguedirector/api.py`
- `leaguedirector/enable.py`
- `resources/riotgames.pem`

#### Game Enablement and Installation Configuration

`enable.py` likely locates League installations and enables/configures Replay API access before a replay begins. This separates local filesystem/game configuration from active API control. Certificate material at `resources/riotgames.pem` suggests authenticated or TLS-backed communication with game-side endpoints.

Paths:
- `leaguedirector/enable.py`
- `leaguedirector/settings.py`
- `resources/riotgames.pem`

#### Director Controls and Input Bindings

The central interaction layer maps UI actions and configurable shortcuts into replay API operations: playback speed, FPS camera movement, entity attachment, HUD/UI toggles, and graphical options. Bindings are isolated in `bindings.py`, allowing user customization without coupling input handling to API transport.

Paths:
- `leaguedirector/bindings.py`
- `leaguedirector/api.py`
- `leaguedirector/app.py`

#### Sequencer, Keyframes, and Persistence

`sequencer.py` is the timeline/domain engine for recording and replaying keyframed camera and graphics state. Its control flow is: sample or edit director state → create/edit/blend keyframes → support undo/redo → save/load reusable sequences → apply interpolated state back through the replay API.

Paths:
- `leaguedirector/sequencer.py`
- `leaguedirector/api.py`
- `leaguedirector/widgets.py`

#### Rendering Assets and Capture

The tool drives replay-side visual settings including skyboxes, fog, depth of field, shadows, clipping, and field of view; bundled DDS skyboxes are local assets selected by the UI and applied through replay controls. Video/image capture produces WebM or PNG output through the game/replay integration rather than an in-repo media server.

Paths:
- `resources/skyboxes/ColorBlack.dds`
- `resources/skyboxes/ColorBlue.dds`
- `leaguedirector/api.py`

#### Distribution Boundary

Windows distribution is built with scripts/specification under `build/`, including a PyInstaller-style spec and an Inno Setup installer definition. Development launchers are platform scripts, but documented supported end-user operation is Windows-only.

Paths:
- `build/build.spec`
- `build/install.iss`
- `run.bat`

Main entry points: [`leaguedirector/app.py`](https://github.com/riotgames/leaguedirector/blob/main/leaguedirector/app.py) (Qt application shell), [`leaguedirector/api.py`](https://github.com/riotgames/leaguedirector/blob/main/leaguedirector/api.py) (Replay API client), [`leaguedirector/sequencer.py`](https://github.com/riotgames/leaguedirector/blob/main/leaguedirector/sequencer.py) (Sequence engine), [`leaguedirector/enable.py`](https://github.com/riotgames/leaguedirector/blob/main/leaguedirector/enable.py) (Replay API enablement)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop client"]
  node_app["Qt application shell<br/>Python bootstrap<br/>[app.py]"]
  node_widgets["Reusable controls<br/>Qt widgets<br/>[widgets.py]"]
  node_settings[("User settings<br/>persistent settings<br/>[settings.py]")]
  node_bindings["Input bindings<br/>shortcut mapping<br/>[bindings.py]"]
  node_sequencer["Sequence engine<br/>timeline domain<br/>[sequencer.py]"]
end

subgraph group_game["League replay integration"]
  node_api{{"Replay API client<br/>game control client<br/>[api.py]"}}
  node_enable["Replay API enablement<br/>installation configurator<br/>[enable.py]"]
  node_certificate["Riot certificate<br/>TLS material<br/>[riotgames.pem]"]
  node_replay{{"Running League replay<br/>external runtime"}}
  node_visuals["Replay visual controls<br/>graphics and camera state"]
  node_skybox_black["Black skybox<br/>DDS asset<br/>[ColorBlack.dds]"]
  node_skybox_blue["Blue skybox<br/>DDS asset<br/>[ColorBlue.dds]"]
  node_capture["Replay capture<br/>WebM/PNG output"]
end

subgraph group_distribution["Windows distribution"]
  node_launcher["Development launcher<br/>batch script<br/>[run.bat]"]
  node_build_spec["Package specification<br/>PyInstaller spec<br/>[build.spec]"]
  node_installer["Windows installer<br/>Inno Setup definition<br/>[install.iss]"]
end

node_launcher -->|"starts"| node_app
node_app -->|"composes"| node_widgets
node_app -->|"loads preferences"| node_settings
node_app -->|"registers"| node_bindings
node_app -->|"hosts"| node_sequencer
node_bindings -->|"directs actions"| node_api
node_sequencer -->|"applies interpolated state"| node_api
node_sequencer -->|"uses timeline controls"| node_widgets
node_enable -->|"uses installation settings"| node_settings
node_enable -->|"enables API access"| node_replay
node_api -->|"uses"| node_certificate
node_api -->|"connects and commands"| node_replay
node_api -->|"sets"| node_visuals
node_skybox_black -->|"selectable asset"| node_visuals
node_skybox_blue -->|"selectable asset"| node_visuals
node_api -->|"triggers"| node_capture
node_build_spec -->|"packages"| node_app
node_installer -->|"installs package"| node_build_spec

click node_launcher "https://github.com/riotgames/leaguedirector/blob/main/run.bat"
click node_app "https://github.com/riotgames/leaguedirector/blob/main/leaguedirector/app.py"
click node_widgets "https://github.com/riotgames/leaguedirector/blob/main/leaguedirector/widgets.py"
click node_settings "https://github.com/riotgames/leaguedirector/blob/main/leaguedirector/settings.py"
click node_bindings "https://github.com/riotgames/leaguedirector/blob/main/leaguedirector/bindings.py"
click node_sequencer "https://github.com/riotgames/leaguedirector/blob/main/leaguedirector/sequencer.py"
click node_api "https://github.com/riotgames/leaguedirector/blob/main/leaguedirector/api.py"
click node_enable "https://github.com/riotgames/leaguedirector/blob/main/leaguedirector/enable.py"
click node_certificate "https://github.com/riotgames/leaguedirector/blob/main/resources/riotgames.pem"
click node_skybox_black "https://github.com/riotgames/leaguedirector/blob/main/resources/skyboxes/ColorBlack.dds"
click node_skybox_blue "https://github.com/riotgames/leaguedirector/blob/main/resources/skyboxes/ColorBlue.dds"
click node_build_spec "https://github.com/riotgames/leaguedirector/blob/main/build/build.spec"
click node_installer "https://github.com/riotgames/leaguedirector/blob/main/build/install.iss"

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_app,node_widgets,node_settings,node_bindings,node_sequencer toneBlue
class node_api,node_enable,node_certificate,node_replay,node_visuals,node_skybox_black,node_skybox_blue,node_capture toneAmber
class node_launcher,node_build_spec,node_installer toneMint
```

## Components

### Desktop client

Native PySide6/Qt director application.

- [Qt application shell](https://github.com/riotgames/leaguedirector/blob/main/leaguedirector/app.py): Python bootstrap · Assembles the main window and top-level workflows. · `leaguedirector/app.py`
- [Reusable controls](https://github.com/riotgames/leaguedirector/blob/main/leaguedirector/widgets.py): Qt widgets · `leaguedirector/widgets.py`
- [User settings](https://github.com/riotgames/leaguedirector/blob/main/leaguedirector/settings.py): persistent settings · Stores application preferences and installation configuration. · `leaguedirector/settings.py`
- [Input bindings](https://github.com/riotgames/leaguedirector/blob/main/leaguedirector/bindings.py): shortcut mapping · Maps configurable shortcuts to director actions. · `leaguedirector/bindings.py`
- [Sequence engine](https://github.com/riotgames/leaguedirector/blob/main/leaguedirector/sequencer.py): timeline domain · Edits, interpolates, and persists keyframed director state. · `leaguedirector/sequencer.py`

### League replay integration

Local game configuration and active replay control.

- [Replay API client](https://github.com/riotgames/leaguedirector/blob/main/leaguedirector/api.py): game control client · Detects and commands a running League replay. · `leaguedirector/api.py`
- [Replay API enablement](https://github.com/riotgames/leaguedirector/blob/main/leaguedirector/enable.py): installation configurator · Locates League and enables Replay API access. · `leaguedirector/enable.py`
- [Riot certificate](https://github.com/riotgames/leaguedirector/blob/main/resources/riotgames.pem): TLS material · `resources/riotgames.pem`
- **Running League replay**: external runtime · Requires Replay API availability with EnableReplayApi=1.
- **Replay visual controls**: graphics and camera state · Skybox, fog, depth of field, shadows, clipping, and field of view.
- [Black skybox](https://github.com/riotgames/leaguedirector/blob/main/resources/skyboxes/ColorBlack.dds): DDS asset · `resources/skyboxes/ColorBlack.dds`
- [Blue skybox](https://github.com/riotgames/leaguedirector/blob/main/resources/skyboxes/ColorBlue.dds): DDS asset · `resources/skyboxes/ColorBlue.dds`
- **Replay capture**: WebM/PNG output · Capture is performed through the game replay integration.

### Windows distribution

Development launch and packaged installer.

- [Development launcher](https://github.com/riotgames/leaguedirector/blob/main/run.bat): batch script · `run.bat`
- [Package specification](https://github.com/riotgames/leaguedirector/blob/main/build/build.spec): PyInstaller spec · `build/build.spec`
- [Windows installer](https://github.com/riotgames/leaguedirector/blob/main/build/install.iss): Inno Setup definition · `build/install.iss`

## Connections

- Development launcher → Qt application shell: starts
- Qt application shell → Reusable controls: composes
- Qt application shell → User settings: loads preferences
- Qt application shell → Input bindings: registers
- Qt application shell → Sequence engine: hosts
- Input bindings → Replay API client: directs actions
- Sequence engine → Replay API client: applies interpolated state
- Sequence engine → Reusable controls: uses timeline controls
- Replay API enablement → User settings: uses installation settings
- Replay API enablement → Running League replay: enables API access
- Replay API client → Riot certificate: uses
- Replay API client → Running League replay: connects and commands
- Replay API client → Replay visual controls: sets
- Black skybox → Replay visual controls: selectable asset
- Blue skybox → Replay visual controls: selectable asset
- Replay API client → Replay capture: triggers
- Package specification → Qt application shell: packages
- Windows installer → Package specification: installs package
