Add modular capture backends, resolution profiles, Wayland support

This commit is contained in:
Hoid 2026-02-14 10:00:19 +00:00
parent 3b363192f2
commit 80ba9b1b90
16 changed files with 2266 additions and 45 deletions

View file

@ -9,12 +9,16 @@ import (
// Detector implements plugin.GameDetector for D2R.
type Detector struct {
config Config
config Config
services plugin.EngineServices
}
// NewDetector creates a D2R state detector.
func NewDetector(config Config) *Detector {
return &Detector{config: config}
func NewDetector(config Config, services plugin.EngineServices) *Detector {
return &Detector{
config: config,
services: services,
}
}
// DetectState analyzes a screenshot and returns the current game state.
@ -48,6 +52,13 @@ func (d *Detector) DetectState(frame image.Image) plugin.GameState {
// ReadVitals reads health and mana from the orbs.
func (d *Detector) ReadVitals(frame image.Image) plugin.VitalStats {
// TODO: Analyze health/mana orb regions using color detection
// Get region coordinates from the engine services
healthRegion := d.services.Region("health_orb")
manaRegion := d.services.Region("mana_orb")
_ = healthRegion // Use these regions for color analysis
_ = manaRegion
return plugin.VitalStats{}
}