Application Foundation
Prism Launcher is structured as a Qt5/Qt6 application with a clear separation of concerns between the UI layer and core functionality.Core Application Class
TheApplication class serves as the central coordinator of the entire launcher, managing all major subsystems.
launcher/Application.h:99-325
The
Application singleton can be accessed anywhere in the codebase using the APPLICATION macro, which casts QCoreApplication::instance() to an Application*.Key Responsibilities
The Application class manages:- Instance Management - Maintains the list of Minecraft instances via
InstanceList - Account System - Handles authentication through
AccountList - Network Operations - Provides centralized
QNetworkAccessManagerfor all HTTP requests - Settings - Global application settings via
SettingsObject - Metadata - Minecraft version metadata through
Meta::Index - UI Coordination - Main window, instance windows, and dialog management
- Update System - Optional external updater integration
Component Hierarchy
Instance Architecture
BaseInstance Abstract Class
All instances inherit fromBaseInstance, which defines the common interface:
launcher/BaseInstance.h:89-325
MinecraftInstance Implementation
The concreteMinecraftInstance class implements Minecraft-specific functionality:
- Mod Management - Multiple mod loaders (Forge, Fabric, Quilt, NeoForge)
- Resource Management - Resource packs, shader packs, texture packs, data packs
- World Management - Save file handling
- Version Profiles - Component/patch system via
PackProfile - Launch Configuration - Java arguments, environment variables, launch scripts
launcher/minecraft/MinecraftInstance.h:56-175
Task-Based Operations
Prism Launcher uses Qt’s task/signal pattern extensively for asynchronous operations:Task Pattern Example
Task Pattern Example
Settings System
Settings are managed hierarchically throughSettingsObject:
- Global Settings - Application-wide configuration
- Instance Settings - Per-instance overrides that inherit from global
- INI-based Storage - Persistent storage in INI format
Instance settings automatically fall back to global settings when not explicitly overridden, allowing users to set defaults globally and override per-instance as needed.
Network Architecture
All network operations go through the centralizedQNetworkAccessManager:
- HTTP Metacache - Caches API responses and downloaded files
- Proxy Support - Configurable proxy settings
- User Agent - Consistent user agent across all requests
- API Keys - Centralized management of API keys for mod platforms
UI Organization
Window Management
- One MainWindow - Primary interface showing instance list
- Multiple InstanceWindows - One per running instance for log viewing
- Modal Dialogs - Settings, account management, instance creation
Theme System
The launcher supports multiple themes throughThemeManager:
- System theme integration
- Custom color schemes
- Icon theme support
- Dark/Light mode variants
Capability Detection
The application detects platform capabilities at startup:launcher/Application.h:105-113
Data Storage
Directory Structure
- Root Path (
m_rootPath) - Installation directory for updates - Data Path (
m_dataPath) - User data and configurationinstances/- Instance directoriesaccounts.json- Account storagemetacache/- HTTP cacheicons/- Custom icons
Portable Mode
Whenportable.txt exists in the root, all data is stored relative to the executable, enabling USB drive installations.
Thread Safety
The application uses Qt’s signal/slot mechanism for thread-safe communication:- Main thread handles all UI operations
- Worker threads for network, file operations
QMutexfor shared data structures- Signals automatically queued across thread boundaries
Extension Points
The architecture allows extensions through:- Profiler Integration - Custom profiler tools
- External Tools - MCEdit and other utilities
- Custom Themes - Theme packs
- Translation Support - Internationalization via Qt Linguist
Next Steps
Instance Management
Learn how instances are created, managed, and launched
Authentication
Understand the Microsoft account authentication flow
Mod Platform APIs
Explore integration with CurseForge and Modrinth
