How riotgames/leaguedirector works
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: app.py Qt application shell · api.py Replay API client · sequencer.py Sequence engine · enable.py Replay API enablement
Components 16
Desktop client
Native PySide6/Qt director application.
- Qt application shell · Assembles the main window and top-level workflows.
leaguedirector/app.py - Reusable controls
leaguedirector/widgets.py - User settings · Stores application preferences and installation configuration.
leaguedirector/settings.py - Input bindings · Maps configurable shortcuts to director actions.
leaguedirector/bindings.py - Sequence engine · Edits, interpolates, and persists keyframed director state.
leaguedirector/sequencer.py
League replay integration
Local game configuration and active replay control.
- Replay API client · Detects and commands a running League replay.
leaguedirector/api.py - Replay API enablement · Locates League and enables Replay API access.
leaguedirector/enable.py - Riot certificate
resources/riotgames.pem - Running League replay · Requires Replay API availability with EnableReplayApi=1.
- Replay visual controls · Skybox, fog, depth of field, shadows, clipping, and field of view.
- Black skybox
resources/skyboxes/ColorBlack.dds - Blue skybox
resources/skyboxes/ColorBlue.dds - Replay capture · Capture is performed through the game replay integration.
Windows distribution
Development launch and packaged installer.
- Development launcher
run.bat - Package specification
build/build.spec - Windows installer
build/install.iss
Connections 18
- 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