Rename region of interest (#275)

This commit is contained in:
aeon0
2021-12-12 18:08:38 +01:00
committed by GitHub
parent d46624e932
commit e184db7045
2 changed files with 4 additions and 4 deletions

View File

@@ -92,7 +92,8 @@ max_walk_dist=127
; all rois are in [left, top, width, height] format
is_overburdened=11,510,513,60
save_and_exit=500,233,273,173
go_btn=533,627,213,67
offline_btn=533,627,213,67
online_btn=427,613,213,67
difficulty_select=536,236,210,320
gold_btn=927,491,267,100
inventory_gold=980,510,150,40
@@ -109,7 +110,6 @@ inventory=860,343,394,165
vendor_stash=29,84,400,400
skill_right=664,673,41,41
hero_selection_logo=0,0,367,553
play_btn=427,613,213,67
window_ingame_ref=600,650,90,90
no_pickup=5,530,240,65
repair_needed=1000,0,280,280

View File

@@ -157,7 +157,7 @@ class UiManager():
# it returns a bool value (True or False) if the button was found, and the position of it
# roi = Region of interest. It reduces the search area and can be adapted within game.ini
# by running >> python src/screen.py you can visualize all of the currently set region of interests
found_btn = self._template_finder.search(["PLAY_BTN","PLAY_BTN_GRAY"], img, roi=self._config.ui_roi["go_btn"], threshold=0.8, best_match=True)
found_btn = self._template_finder.search(["PLAY_BTN","PLAY_BTN_GRAY"], img, roi=self._config.ui_roi["offline_btn"], threshold=0.8, best_match=True)
if found_btn.name == "PLAY_BTN":
# We need to convert the position to monitor coordinates (e.g. if someone is using 2 monitors or windowed mode)
x, y = self._screen.convert_screen_to_monitor(found_btn.position)
@@ -170,7 +170,7 @@ class UiManager():
break
else:
# Might be in online mode?
found_btn = self._template_finder.search("PLAY_BTN", img, roi=self._config.ui_roi["play_btn"], threshold=0.8)
found_btn = self._template_finder.search("PLAY_BTN", img, roi=self._config.ui_roi["online_btn"], threshold=0.8)
if found_btn.valid:
Logger.error("Botty only works for single player. Please switch to offline mode and restart botty!")
return False