# hex-dragon/pcl2 architecture

> Architecture diagram of the GitHub repository hex-dragon/pcl2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hex-dragon/pcl2
- Repository: https://github.com/hex-dragon/pcl2

## Overview

##### Main Components

a. User Interface Layer
- WPF-based UI components (Controls folder)
- Pages system with multiple sections (Pages folder)
- Custom themes and resources (Resources folder)

b. Core Modules Layer
- Base Module System
- Minecraft Integration Module
- Download Management
- Authentication System
- Settings Management

c. Resource Management Layer
- Language Resources
- Help Documentation

**┌─────────────────────────────────────────────────────┐**
- Presentation Layer                  │
- ┬─────────────────────┬─────────────────┤
- Launch UI  │    Download UI      │   Settings UI   │
- (Pages)    │    (Pages)         │   (Pages)       │
- ┴─────────────────────┴─────────────────┤
- Custom Controls Layer                   │
- (Buttons, Cards, ComboBoxes, etc.)                 │
- ┤
- Core Modules                        │
- ┬──────────┬───────────┬──────────────────┤
- Base    │ Minecraft│ Download  │     Event        │
- Module  │  Module  │  Module   │    Handling      │
- ┴──────────┴───────────┴──────────────────┤
- Resource Management                     │
- ┤
- External Dependencies                   │
- (Java Runtime, Minecraft Files, etc.)           │
- ┘

##### Important Elements to Highlight

a. Module Integration:
- Connections between ModMinecraft and ModLaunch
- ModDownload's interaction with external resources
- Authentication flow through different login methods

b. Data Flow:
- User input through UI controls
- Configuration management
- Game launching process
- Resource downloading and management

##### Implementation Details

- Annotations for critical processes like game launching and mod management

**→ Direct Dependency**
**⇢ Event Flow**
**□ Module**
**○ External Service**
**◇ User Interface Component**

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph UI
        MainApp["Main Application"]
        UIControls["Custom Controls"]
        Pages["Pages System"]
        
        subgraph PageComponents
            LaunchUI["Launch UI"]
            DownloadUI["Download UI"]
            SettingsUI["Settings UI"]
        end
        
        MainApp --> UIControls
        MainApp --> Pages
        Pages --> PageComponents
    end
    
    subgraph CoreModules
        BaseModule["Base Module"]
        MinecraftModule["Minecraft Integration"]
        DownloadMod["Download Management"]
        EventHandler["Event Handling"]
        LaunchMod["Launch Module"]
    end
    
    subgraph ResourceManagement
        Resources["Resource System"]
        Images["Image Resources"]
        Language["Language System"]
        Themes["Theme System"]
        Help["Help Documentation"]
    end
    
    subgraph ExternalDeps
        Java["Java Runtime"]
        MCFiles["Minecraft Files"]
        AuthServers["Authentication Servers"]
    end
    
    %% Connections
    PageComponents --> CoreModules
    CoreModules --> ResourceManagement
    CoreModules --> ExternalDeps
    MinecraftModule --> LaunchMod
    DownloadMod --> MCFiles
    LaunchUI --> AuthServers
    
    %% Click Events
    click MainApp "https://github.com/Hex-Dragon/PCL2/blob/main/Plain Craft Launcher 2/FormMain.xaml"
    click UIControls "https://github.com/Hex-Dragon/PCL2/tree/main/Plain Craft Launcher 2/Controls/"
    click Pages "https://github.com/Hex-Dragon/PCL2/tree/main/Plain Craft Launcher 2/Pages/"
    click LaunchUI "https://github.com/Hex-Dragon/PCL2/tree/main/Plain Craft Launcher 2/Pages/PageLaunch/"
    click SettingsUI "https://github.com/Hex-Dragon/PCL2/tree/main/Plain Craft Launcher 2/Pages/PageSetup/"
    click BaseModule "https://github.com/Hex-Dragon/PCL2/tree/main/Plain Craft Launcher 2/Modules/Base/"
    click MinecraftModule "https://github.com/Hex-Dragon/PCL2/tree/main/Plain Craft Launcher 2/Modules/Minecraft/"
    click DownloadMod "https://github.com/Hex-Dragon/PCL2/blob/main/Plain Craft Launcher 2/Modules/Minecraft/ModDownload.vb"
    click LaunchMod "https://github.com/Hex-Dragon/PCL2/blob/main/Plain Craft Launcher 2/Modules/Minecraft/ModLaunch.vb"
    click EventHandler "https://github.com/Hex-Dragon/PCL2/blob/main/Plain Craft Launcher 2/Modules/ModEvent.vb"
    click Resources "https://github.com/Hex-Dragon/PCL2/tree/main/Plain Craft Launcher 2/Resources/"
    click Images "https://github.com/Hex-Dragon/PCL2/tree/main/Plain Craft Launcher 2/Images/"
    click Language "https://github.com/Hex-Dragon/PCL2/tree/main/Plain Craft Launcher 2/Resources/Language/"
    click Themes "https://github.com/Hex-Dragon/PCL2/blob/main/Plain Craft Launcher 2/Resources/Custom.xaml"
    click Help "https://github.com/Hex-Dragon/PCL2/blob/main/Plain Craft Launcher 2/Resources/Help.zip"
    
    %% Styling
    classDef ui fill:#2374ab
    classDef core fill:#2a9d8f
    classDef resource fill:#e9c46a
    classDef external fill:#grey
    
    class MainApp,UIControls,Pages,LaunchUI,DownloadUI,SettingsUI ui
    class BaseModule,MinecraftModule,DownloadMod,EventHandler,LaunchMod core
    class Resources,Images,Language,Themes,Help resource
    class Java,MCFiles,AuthServers external
```
