diff --git a/horizonzdr/hzdr.py b/horizonzdr/hzdr.py index e4a1516..bc29514 100644 --- a/horizonzdr/hzdr.py +++ b/horizonzdr/hzdr.py @@ -4,8 +4,9 @@ import logging import sys import time import pydirectinput as user +import winreg -from hzdr_utils import get_resolution, get_args +from hzdr_utils import get_resolution, get_args, process_registry_file sys.path.insert(1, os.path.join(sys.path[0], '..')) @@ -36,6 +37,10 @@ LOCAL_USER_SETTINGS = os.path.join( "Saved", "Config", "WindowsNoEditor", "GameUserSettings.ini" ) VIDEO_PATH = os.path.join(get_steamapps_common_path(), "Horizon Zero Dawn Remastered", "Movies", "Mono") +input_file = 'input.reg' +config_file = 'config_registry.txt' +hive = winreg.KEY_CURRENT_USER +subkey = r"SOFTWARE\Guerilla Games\Horizon Zero Dawn Remastered\Graphics" user.FAILSAFE = False @@ -73,6 +78,8 @@ def run_benchmark() -> tuple[float]: time.sleep(10) + process_registry_file() + sys.exit(1) # Make sure the game started correctly result = kerasService.look_for_word("locate", 10, 5) if not result: diff --git a/horizonzdr/hzdr_utils.py b/horizonzdr/hzdr_utils.py index 942958b..70dbe53 100644 --- a/horizonzdr/hzdr_utils.py +++ b/horizonzdr/hzdr_utils.py @@ -63,8 +63,8 @@ def process_registry_file(input_file, config_file): def get_resolution(config_file: str) -> tuple[int]: """Retrieve the resolution from local configuration files.""" - width_pattern = re.compile(r"ResolutionSizeX=(\d+)") - height_pattern = re.compile(r"ResolutionSizeY=(\d+)") + width_pattern = re.compile(r"\"FullscreenWidth\"=(\d+)") + height_pattern = re.compile(r"\"FullscreenHeight\"=(\d+)") width = 0 height = 0