Skip to content

Commit

Permalink
feat: auto pull down artifact panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Fachep committed Dec 30, 2022
1 parent 8df8671 commit 3dd683f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/scanner/yas_scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,23 @@ impl YasScanner {
self.enigo.mouse_move_to(left as i32, top as i32);
}

pub fn panel_down(&mut self) {
let info = &self.info;
let max_scroll = 20;
let mut count = 0;
self.enigo.mouse_move_to(info.left + info.star_x as i32, info.top + info.star_y as i32);
let level_color = Color::from(57, 67, 79);
let mut color = capture::get_color(info.level_position.left as u32, info.level_position.top as u32);
while !level_color.is_same(&color) && count < max_scroll {
self.enigo.mouse_scroll_y(5);
utils::sleep(self.config.scroll_stop);
color = capture::get_color(info.level_position.left as u32, info.level_position.top as u32);
count += 1;
}
self.enigo.mouse_scroll_y(5);
utils::sleep(self.config.scroll_stop);
}

fn sample_initial_color(&mut self) {
self.initial_color = self.get_color();
}
Expand Down Expand Up @@ -446,6 +463,7 @@ impl YasScanner {
}

pub fn start(&mut self) -> Vec<InternalArtifact> {
self.panel_down();
if self.config.capture_only {
self.start_capture_only();
return Vec::new();
Expand Down

0 comments on commit 3dd683f

Please sign in to comment.