How cmooref17/lethal-company-toomanyemotes works
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.