mirror of
https://github.com/tiennm99/WPlace-AutoBOT.git
synced 2026-10-13 22:15:26 +00:00
feat: enhance color resolution, progress management, and pixel processing
* Implemented `resolveColor` to improve color matching with exact matches, white threshold handling, and chroma penalty adjustments. * Enhanced `extractAvailableColors` to parse RGB values robustly and skip invalid color elements with warnings. * Refactored progress data management with `buildPaintedMapPacked`, `buildProgressData`, and `migrateProgress` for better organization and version handling. * Added migration logic to support progress data from versions 1.x, 2.0, and 2.1 to 2.2. * Improved error handling and logging during progress saving and loading operations. * Updated progress file structure to include additional state details like coordinate modes, block dimensions, and painted map packing. * Refactored progress migration to use a unified `Utils.migrateProgress`, reducing redundancy and improving maintainability. * Simplified color matching by moving inline functions to utilities for readability and reusability. * Enhanced `updateStats` with optional `isManualRefresh` for granular UI updates and alerts. * Added utility functions `getRemainingMsToThreshold`, `startChargesThresholdTicker`, and `updateChargesThresholdUI` to modularize charge-related logic. * Added coordinate generation logic supporting various modes, directions, and block configurations. * Fixed potential issues with color filtering and invalid cache management. * Ensured alerts and notifications are displayed correctly when colors or thresholds change. * Simplified coordinate generation logic, removing redundant code and improving readability. * Introduced `flushPixelBatch` for modular batch pixel processing. * Added detailed pixel eligibility checks in `processImage` to ensure valid pixels are processed. * Configurable transparency thresholds and strict color availability checks for flexibility. * Improved error handling for unsupported modes and directions. * Refactored pixel processing for readability and maintainability. * Consolidated batch flushing logic and simplified batch size calculations. * Enhanced logging with debug information for pixel eligibility, existing colors, and batch processing. * Added safeguards to clear intervals and prevent memory leaks during state cleanup. These changes improve color resolution accuracy, progress tracking, coordinate generation flexibility, and pixel processing robustness, while making the codebase more modular, maintainable, and easier to debug.
This commit is contained in:
1 parent
cacff68f34
commit
0dbcbee966
1 file changed
+551
-567
+551
-567
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user