How djalilhebal/super-scoreboard works
Project Type and Purpose
• Project Type: A desktop overlay application built in Java (using Swing/AWT, JNA, etc.) that hooks into game behavior by overlaying the in-game scoreboard.
• Purpose: To track cooldowns (initially summoner spells, with potential for ult and item cooldowns) by letting users interact with the overlay (double-click, long press, etc.) and also integrate with external sources (e.g., Riot’s APIs via R4J and direct LCU calls) to fetch additional game data and adjust cooldown timings.
File Structure
• Top-Level Files: Standard files like .gitignore, pom.xml (Maven build configuration), LICENSE (COPYING.txt) and documentation items.
• Directories:
• raw-data: Has test/sample JSON files that mimic live game data from LCU and op.gg endpoints, which implies that services in your application parse and use these JSON responses.
• scrap: Contains prototype or experimental code (Java, JavaScript, and TypeScript files) which could demonstrate earlier iterations or ideas for static data provision, utilities, or services.
• src/main/java/me/djalil/scoreboard: This is the heart of the app, containing:
• Main entry and controller files (App.java, AppController.java).
• Service classes (DdragonService, LcuService, OpggService, etc.) that likely interface with external APIs to fetch live game data.
• Model classes (AppModel, LightGame, SpellTiming, etc.) that represent domain concepts.
• UI/Component classes (KHeader, KParticipantList, KScoreboard, etc.) establishing the overlay UI elements.
a. Major Components:
• User Interface Layer:
• Input Handler: Captures user actions (key presses, double-clicks, long presses) to trigger internal events.
• Controller/Business Logic Layer:
• Core Application Controller (AppController, IAppController) that manages user inputs and overall app state.
• Event Synthesizer and various Demo classes (e.g., SynthesizingEventsDemo, ForwardingEventsDemo) indicate event handling and testing of the input-to-action mapping.
• Domain / Model Layer:
• Domain Objects: Classes such as LightGame, LightSpell, SpellTiming, and Thing that encapsulate game data and cooldown logic.
• Service Layer:
• External API Integrations: Components like LcuService, DdragonService, and OpggService that interact with Riot endpoints or third–party APIs.
• Data Providers and Client Checkers (DumbClientChecker, IGameProvider, etc.) that validate game client status or fetch additional client data.
• Native / Platform Integration Layer:
• Utilizing libraries like JNA and (potentially) JNativeHook to interact with Windows APIs for overlay positioning and input handling.
• Data & Configuration:
• Test Data Files (in raw-data) to simulate API responses during development.
• Maven Build files (pom.xml) to manage dependencies like Google Gson, R4J, and JNA.
b. Component Interactions:
• The AppController interacts with the Model layer incorporating Game State information, and in turn refines the UI accordingly (reordering scoreboard participants, updating cooldown displays, etc.).
• The Service layer uses external libraries (Google gson for JSON parsing, R4J for Riot API calls) and native libraries (JNA) to access system APIs.
Architectural Patterns and Important Principles
• Event-Driven Design: Emphasize how input events are captured and processed, and how state and data flows from user actions to API calls and finally to UI updates.
• Layered Architecture: Consider displaying a layered view where the overlay presentation (UI) is separate from the controller and business logic, which in turn is separate from the service integrations.
• Extensibility: Note that additional cooldown types (ults, items) can be integrated by expanding domain models and service interactions.
Elements
• Clear Labels: Mark each component clearly (e.g., “UI Overlay Component”, “AppController”, “LcuService”, “Game Data Model”).
• Another for the Service/External API integration layer.
• And a different one for the Domain/Model components.
• Annotations: Add notes that indicate key libraries used (Google Gson, R4J, JNA) or significant design decisions (event synthesis for user inputs, external API call patterns).