# suchy499/privategamehelper-for-super-animal-royale architecture

> Architecture diagram of the GitHub repository suchy499/privategamehelper-for-super-animal-royale, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/suchy499/privategamehelper-for-super-animal-royale
- Repository: https://github.com/suchy499/privategamehelper-for-super-animal-royale

## Overview

##### Project type and purpose
- Type: Desktop GUI application written in Python (uses PyQt or similar).
- Purpose: Let users configure, save, and apply private match settings for Super Animal Royale and calculate tournament results.

##### File structure
- src/core: Core logic and application entry point (__main__.py). Handles global state, functions, classes, versioning, and Qt app setup.
- src/ui: All UI pages and window definitions. Organized by feature (home, dodgeball, duels, tournaments, etc.).
- src/widgets: Custom Qt widget implementations (buttons, sidebars, popups, etc.).
- updater/: Separate module for the auto-updater window and logic.
- setup.py & requirements.txt: Build/install scripts and dependencies.

##### README for additional insights
- GUI-centric desktop tool; Windows only.
- No explicit backend services or database—presumably stores presets locally (e.g., JSON or similar).
- Integrates with in-game UI via simulated keypress detection (not shown in file tree, but implied).

##### Main components & interactions
a. Components
1. Application Launcher
– src/__main__.py loads core App.
2. Core Logic
– src/core: Application state, settings IO, game integration functions.
3. UI Layer
– src/ui: MainWindow, Overlays, Pages. Renders controls, captures user interaction.
4. Widgets Library
– src/widgets: Reusable UI controls.
5. Resource Manager
– src/images & src/styles: QRC-generated resources loaded by UI and widgets.
6. Preset Storage
– Likely JSON or flat-file storage managed by core functions.
7. Updater Module
– updater/: Auto-update interface invoked at startup or on demand.
8. External Game Interface
– Core functions simulate keypresses or read game window state.

b. Relationships / Data Flow
- The Launcher invokes Core Logic.
- Core Logic initializes the UI Layer (MainWindow).
- UI sends user actions (e.g., “Apply Dodgeball Settings”) to Core Logic.
- Core Logic updates External Game via functions (simulate keystrokes).
- Core Logic reads/writes Preset Storage.
- UI displays feedback (via Widgets) and tournament graphs (core uses .github/tournament_graphs templates?).
- On update check: Core Logic launches Updater Module in a separate window.

c. Architectural patterns / design principles
- Modular separation: core, ui, widgets, resources, updater.
- MVC-like:
– Model: core/classes.py, globals.py (application state, presets)
– View: ui/pages + widgets (UI definitions)
– Controller: core/functions.py (handles logic on user events)
- Resource bundling: QRC for images & styles, generated at build time.
- Plugin-style pages: each feature page is its own module.

d. Key technologies
- Python 3.12
- PyQt (qt_core abstraction in core/qt_core.py)
- Qt Resource System (QRC → rc_images.py, rc_fonts.py)
- QSS styling for themes
- Matplotlib or similar for tournament graphs (inferred)
- setuptools (setup.py) and pip (requirements.txt)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Layer
    User["User\n(mouse/keyboard)"]:::external

    %% Launcher
    Launcher["Application Launcher\nsrc/__main__.py"]:::core
    click Launcher "https://github.com/suchy499/privategamehelper-for-super-animal-royale/blob/main/src/__main__.py"

    %% Core Logic
    CoreLogic["Core Logic\n(src/core/)"]:::core
    click CoreLogic "https://github.com/suchy499/privategamehelper-for-super-animal-royale/tree/main/src/core/"

    Classes["classes.py"]:::core
    click Classes "https://github.com/suchy499/privategamehelper-for-super-animal-royale/blob/main/src/core/classes.py"
    Functions["functions.py"]:::core
    click Functions "https://github.com/suchy499/privategamehelper-for-super-animal-royale/blob/main/src/core/functions.py"
    Globals["globals.py"]:::core
    click Globals "https://github.com/suchy499/privategamehelper-for-super-animal-royale/blob/main/src/core/globals.py"
    QtCore["qt_core.py"]:::core
    click QtCore "https://github.com/suchy499/privategamehelper-for-super-animal-royale/blob/main/src/core/qt_core.py"
    Version["_version.py"]:::core
    click Version "https://github.com/suchy499/privategamehelper-for-super-animal-royale/blob/main/src/core/_version.py"

    %% UI Layer
    subgraph "UI Layer" 
        direction TB
        UILayer["UI Layer\n(src/ui/)"]:::ui
        click UILayer "https://github.com/suchy499/privategamehelper-for-super-animal-royale/tree/main/src/ui/"

        subgraph "UI Windows"
            direction TB
            MainWindow["MainWindow\nmain_window.py"]:::ui
            click MainWindow "https://github.com/suchy499/privategamehelper-for-super-animal-royale/blob/main/src/ui/windows/main_window/main_window.py"
            OverlayWindows["Overlay Windows\n(src/ui/windows/overlay/)"]:::ui
            click OverlayWindows "https://github.com/suchy499/privategamehelper-for-super-animal-royale/tree/main/src/ui/windows/overlay/"
        end

        subgraph "UI Pages"
            direction TB
            Home["Home Page\nhome.py"]:::ui
            click Home "https://github.com/suchy499/privategamehelper-for-super-animal-royale/blob/main/src/ui/pages/home/home.py"
            Dodgeball["Dodgeball Page\n(src/ui/pages/dodgeball/)"]:::ui
            click Dodgeball "https://github.com/suchy499/privategamehelper-for-super-animal-royale/tree/main/src/ui/pages/dodgeball/"
            Duels["Duels Page\n(src/ui/pages/duels/)"]:::ui
            click Duels "https://github.com/suchy499/privategamehelper-for-super-animal-royale/tree/main/src/ui/pages/duels/"
            Tournaments["Tournaments Page\n(src/ui/pages/tournaments/)"]:::ui
            click Tournaments "https://github.com/suchy499/privategamehelper-for-super-animal-royale/tree/main/src/ui/pages/tournaments/"
            PresetsPage["Presets Page\n(src/ui/pages/presets/)"]:::ui
            click PresetsPage "https://github.com/suchy499/privategamehelper-for-super-animal-royale/tree/main/src/ui/pages/presets/"
        end
    end

    %% Widgets Library
    Widgets["Widgets Library\n(src/widgets/)"]:::widget
    click Widgets "https://github.com/suchy499/privategamehelper-for-super-animal-royale/tree/main/src/widgets/"

    %% Resource Manager
    subgraph "Resource Manager"
        direction TB
        QRCImages["rc_images.qrc"]:::resource
        click QRCImages "https://github.com/suchy499/privategamehelper-for-super-animal-royale/blob/main/src/images/rc_images.qrc"
        RCImages["rc_images.py"]:::resource
        click RCImages "https://github.com/suchy499/privategamehelper-for-super-animal-royale/blob/main/src/images/rc_images.py"
        QRCFonts["rc_fonts.qrc"]:::resource
        click QRCFonts "https://github.com/suchy499/privategamehelper-for-super-animal-royale/blob/main/src/styles/rc_fonts.qrc"
        RCFonts["rc_fonts.py"]:::resource
        click RCFonts "https://github.com/suchy499/privategamehelper-for-super-animal-royale/blob/main/src/styles/rc_fonts.py"
        Styles["styles.py"]:::resource
        click Styles "https://github.com/suchy499/privategamehelper-for-super-animal-royale/blob/main/src/styles/styles.py"
        QSSParser["qss_parser/"]:::resource
        click QSSParser "https://github.com/suchy499/privategamehelper-for-super-animal-royale/tree/main/src/styles/qss_parser/"
        GenerateQRC["generate_qrc.py"]:::resource
        click GenerateQRC "https://github.com/suchy499/privategamehelper-for-super-animal-royale/blob/main/src/images/generate_qrc.py"
    end

    %% Preset Storage
    PresetStorage["Preset Storage\n(local JSON)"]:::storage

    %% External Game Interface
    ExternalGame["External Game Interface\n(simulate keypress)"]:::external

    %% Updater Module
    subgraph "Updater Module"
        direction TB
        UpdaterMain["updater/__main__.py"]:::updater
        click UpdaterMain "https://github.com/suchy499/privategamehelper-for-super-animal-royale/blob/main/updater/__main__.py"
        UpdaterWindow["updater_window.py"]:::updater
        click UpdaterWindow "https://github.com/suchy499/privategamehelper-for-super-animal-royale/blob/main/updater/updater_window.py"
        ProgressBar["progress_bar.py"]:::updater
        click ProgressBar "https://github.com/suchy499/privategamehelper-for-super-animal-royale/blob/main/updater/progress_bar.py"
        UpdaterImages["rc_images.py"]:::updater
        click UpdaterImages "https://github.com/suchy499/privategamehelper-for-super-animal-royale/blob/main/updater/rc_images.py"
        UpdaterFonts["rc_fonts.py"]:::updater
        click UpdaterFonts "https://github.com/suchy499/privategamehelper-for-super-animal-royale/blob/main/updater/rc_fonts.py"
        TitleBar["title_bar.py"]:::updater
        click TitleBar "https://github.com/suchy499/privategamehelper-for-super-animal-royale/blob/main/updater/title_bar.py"
    end

    %% Connections
    User -->|interacts with| UILayer
    Launcher -->|launches| CoreLogic
    CoreLogic -->|initializes| UILayer
    UILayer -->|user actions| CoreLogic
    CoreLogic -->|read/write| PresetStorage
    CoreLogic -->|simulate keypress| ExternalGame
    CoreLogic -->|invoke update| UpdaterMain
    RCImages -->|resources| UILayer
    RCFonts -->|resources| UILayer
    Styles -->|styles| UILayer
    Widgets -->|provides controls| UILayer

    %% Styles
    classDef ui fill:#e0ffe0,stroke:#2e7d32,color:#000
    classDef core fill:#e0f7fa,stroke:#006064,color:#000
    classDef widget fill:#fff3e0,stroke:#e65100,color:#000
    classDef resource fill:#f3e5f5,stroke:#4a148c,color:#000
    classDef storage fill:#e8eaf6,stroke:#283593,color:#000,stroke-dasharray: 5 5
    classDef external fill:#ffebee,stroke:#b71c1c,color:#000
    classDef updater fill:#fffde7,stroke:#f9a825,color:#000
```
