# cmooref17/lethal-company-toomanyemotes architecture

> Architecture diagram of the GitHub repository cmooref17/lethal-company-toomanyemotes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cmooref17/lethal-company-toomanyemotes
- Repository: https://github.com/cmooref17/lethal-company-toomanyemotes

## Overview

##### Main Components
- Plugin/Integration Layer: At the core, the “Plugin.cs” and “PluginInfo.cs” files indicate how the mod integrates with the host game.
- Mod Core Modules: These include various subdirectories such as:
- Audio: Contains classes managing audio playback (AudioManager, EmoteAudioPlayer, etc.) for emotes.
- EmoteControllers: Handles control of different emote behaviors (player and enemy emotes, IK handling).
- Input: Manages keybinds and in-game commands (with files like Keybinds.cs and IngameKeybinds.cs).
- Config: Provides configuration settings (ConfigSettings.cs), central to customizing mod behavior.
- Networking: Manages syncing (ConfigSync, SyncManager) which is critical if the mod has multiplayer or synchronized emote features.
- Patches: Contains various patch files to hook into or modify the game’s behavior (e.g., PlayerPatcher, DiscoBallPatcher).
- Compatibility: Offers compatibility modules with other mods or game systems (like AdvancedCompany_Compat, LCVR_Compat, etc.).
- UI & Props: Incorporates user interface elements (EmoteMenu, AnimationPreviewer) and handling of in-game props related to emotes.
- Additional/Utility Components: Files such as CustomLogging, HelperTools, and SaveManager, which provide supporting functionality.

##### Out Relationships and Data Flow
- The Plugin is the gateway: It loads when the mod is activated in the game. From here, control is passed to configuration and initialization routines.
- The Config module provides settings that are consumed by nearly all other modules (Audio, EmoteControllers, Networking, etc.).
- The Audio Module leverages in-game audio systems, triggered by events in the EmoteControllers and possibly via patches that hook game animation events.
- The Input module listens to key binds and triggers actions managed by the EmoteControllers.
- Patches are used to integrate the mod’s functionality directly with the game’s core systems, indicating dependencies where the mod intercepts or extends game behavior.
- Networking components handle state and synchronization across game sessions (if applicable), showing the data flow between clients/players or between the mod and game servers.
- Compatibility modules ensure that other mod functionalities (or various game versions) work smoothly with TooManyEmotes.

##### Architectural Patterns and Design Principles
- Modular design: Each directory encapsulates a specific set of responsibilities (audio, input, etc.), which makes the system maintainable and testable.
- Use of patching/hooking: The Patches directory indicates that the mod uses runtime modification/hooking to insert or override game behaviors.

##### Including Relevant Technologies and Libraries
- That this is a C# project (given the .cs file extensions and the “sln”/“.csproj” files). You may indicate use of Visual Studio-related projects.
- Although not explicitly listed, the mod likely relies on game-provided APIs and possibly third-party libraries related to networking or UI rendering.

##### Final Advice
- Don’t hesitate to break down each module into subcomponents if necessary (for example, showing that EmoteControllers has variants for players and AI-controlled characters).
- Given the relatively “flat” structure of the code (no deep nesting of architectural layers), focus on component interactions rather than complex abstraction layers.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "TooManyEmotes Mod"
        PI["Plugin Integration"]:::integration
        Config["Config Module"]:::core
        EmoteCtrl["Emote Controllers"]:::core
        Audio["Audio Module"]:::core
        Input["Input Module"]:::core
        Networking["Networking Module"]:::core
        Patches["Patches Module"]:::integration
        Compatibility["Compatibility Module"]:::integration
        UI["UI Components"]:::core
        Props["Props Management"]:::core
        Utilities["Additional/Utility"]:::utility
    end

    subgraph "TooManyEmotesScrap Mod"
        ConfigScrap["Config Module (Scrap)"]:::core
        PropsScrap["Props Management (Scrap)"]:::core
    end

    %% Relationships for TooManyEmotes Mod
    PI -->|"initializes"| Config
    PI -->|"activates"| EmoteCtrl
    Config -->|"suppliesConfig"| EmoteCtrl
    Config -->|"suppliesConfig"| Audio
    Config -->|"suppliesConfig"| Input
    Config -->|"suppliesConfig"| Networking
    Config -->|"suppliesConfig"| UI
    EmoteCtrl -->|"triggers"| Audio
    Input -->|"activates"| EmoteCtrl
    Patches -->|"hooks"| EmoteCtrl
    EmoteCtrl <-->|"syncs"| Networking
    EmoteCtrl -->|"updates"| UI
    PI -->|"integrates"| Compatibility
    Utilities -->|"supports"| PI
    Utilities -->|"supports"| Config
    Utilities -->|"supports"| Audio
    Utilities -->|"supports"| EmoteCtrl
    Utilities -->|"supports"| Input
    Utilities -->|"supports"| Networking
    Utilities -->|"supports"| UI

    %% Relationships linking TooManyEmotesScrap to TooManyEmotes Mod for common modules
    ConfigScrap ---|"variant"| Config
    PropsScrap ---|"variant"| Props

    %% Click Events
    click PI "https://github.com/cmooref17/lethal-company-toomanyemotes/blob/main/TooManyEmotes/Plugin.cs"
    click Config "https://github.com/cmooref17/lethal-company-toomanyemotes/blob/main/TooManyEmotes/Config/ConfigSettings.cs"
    click Audio "https://github.com/cmooref17/lethal-company-toomanyemotes/tree/main/TooManyEmotes/Audio/"
    click EmoteCtrl "https://github.com/cmooref17/lethal-company-toomanyemotes/tree/main/TooManyEmotes/EmoteControllers/"
    click Input "https://github.com/cmooref17/lethal-company-toomanyemotes/tree/main/TooManyEmotes/Input/"
    click Networking "https://github.com/cmooref17/lethal-company-toomanyemotes/tree/main/TooManyEmotes/Networking/"
    click Patches "https://github.com/cmooref17/lethal-company-toomanyemotes/tree/main/TooManyEmotes/Patches/"
    click Compatibility "https://github.com/cmooref17/lethal-company-toomanyemotes/tree/main/TooManyEmotes/Compatibility/"
    click UI "https://github.com/cmooref17/lethal-company-toomanyemotes/tree/main/TooManyEmotes/UI/"
    click Props "https://github.com/cmooref17/lethal-company-toomanyemotes/tree/main/TooManyEmotes/Props/"
    click Utilities "https://github.com/cmooref17/lethal-company-toomanyemotes/blob/main/TooManyEmotes/CustomLogging.cs"
    click ConfigScrap "https://github.com/cmooref17/lethal-company-toomanyemotes/blob/main/TooManyEmotesScrap/Config/ConfigSettings.cs"
    click PropsScrap "https://github.com/cmooref17/lethal-company-toomanyemotes/tree/main/TooManyEmotesScrap/Props/"

    %% Styles
    classDef integration fill:#add8e6,stroke:#000,stroke-width:2px;
    classDef core fill:#ffff99,stroke:#000,stroke-width:2px;
    classDef utility fill:#90ee90,stroke:#000,stroke-width:2px;
```
