Fix dashboard + vision: region checkboxes, upload auto-switch, state detection, analyze endpoint

- Region checkboxes now control which overlays are drawn (?regions= param)
- Upload auto-switches capture source (no restart needed)
- State detection: check in-game BEFORE loading, require 90% dark for loading
- Tighten HSV ranges: health H 0-30 S 50+ V 30+, mana H 200-240 S 40+ V 20+
- Add /api/analyze endpoint with per-region color analysis
This commit is contained in:
Hoid 2026-02-14 11:27:46 +00:00
parent 67f2e5536a
commit a665253d4d
5 changed files with 277 additions and 47 deletions

View file

@ -539,17 +539,23 @@
// Update capture image with overlays
async function updateCaptureImage() {
try {
const response = await fetch('/api/capture/frame/annotated');
let url = '/api/capture/frame/annotated';
// Always pass regions param to control overlays (empty = no overlays)
const regionNames = Array.from(visibleRegions).join(',');
url += `?regions=${encodeURIComponent(regionNames)}`;
const response = await fetch(url);
const blob = await response.blob();
const url = URL.createObjectURL(blob);
const imageUrl = URL.createObjectURL(blob);
// Clean up previous URL
if (captureImage.src && captureImage.src.startsWith('blob:')) {
URL.revokeObjectURL(captureImage.src);
}
captureImage.src = url;
captureImage.src = imageUrl;
} catch (error) {
addLogLine('ERROR', `Failed to update capture image: ${error.message}`);
}