How maygi/tof-overlay works
Main Components
• User Interface (UI):
• This is the overlay window that displays weapon cooldowns, timers, and visual effects. Components like GuiButton, AbstractFrame, GraphFrame, OptionsFrame, Overlay, and Tooltip (located in src/gui) represent the visual elements.
• Data/Model Layer:
• Contains data models for tracking weapon data, timers, and collections (classes in src/model, e.g., WeaponData, TimeCollection, DPSCollection, and MainDriver).
• Image Recognition and Processing:
• The overlay is driven by image recognition using the Sikuli API (indicated by the presence of lib/sikulixapi.jar) and makes use of image directories (images/sikuli) for template matching or text detection.
• Sound Module:
• Manages sound triggers for various events (both the sound files in the sound folder and the logic in src/sound/Sound.java).
• Particle Effects:
• Visual indicators such as particles are handled by the classes in src/particles (AbstractShapeParticle, CircleParticle, ParticleEmitter, TextParticle), likely used to provide visual feedback.
• Configuration/Properties:
• External configuration files such as config.properties and weapon.properties (editable by the user) determine runtime settings and weapon customization.
• External Libraries and Hooks:
• jnativehook is included to capture keyboard or mouse events, thus helping the overlay interact with user inputs while the game is in fullscreen mode.
Relationships and Interactions
• The MainDriver from src/model acts as the control center that initializes the program, orchestrating image processing (screen capturing via Sikuli) and passing the detected data to the model and UI layers.
• Once data is captured (such as current cooldowns or weapon states), the data models update the UI components accordingly.
• The GUI framework responds to both configuration changes (from config.properties/weapon.properties) and user interactions (e.g., dragging the window or resetting settings).
• Sound events are triggered based on state changes detected in the data models. The sound module and audio resources are then used to provide feedback.
• Particle components are likely summoned by the UI layer to display subtle visual effects in response to game events.
• External libraries (sikulixapi.jar and jnativehook) provide low-level functionality, interfacing with the system for screen capture and input event handling.
Architectural Patterns and Design Principles
• Separation of Concerns – The project neatly divides responsibilities: GUI (display logic in src/gui), Business/Data Model (src/model), and auxiliary services like sound and particle effects.
• Modular Design – With dedicated packages (gui, model, particles, sound, util), it’s easier to update or extend specific parts of the application.
• Event-Driven and Reactive Elements – The program actively responds to in-game visual cues and possibly user events (via jnativehook) to update state and trigger overlays.