Reverted previous two commits

Added env vars check back for decky and reverted GoG change.
This commit is contained in:
sysmoon14 2024-02-16 06:54:58 +00:00 committed by GitHub
parent 1063ec5946
commit d8b392efe2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -667,6 +667,7 @@ def getGogGameInfo(filePath):
with open(filePath, 'r') as file: with open(filePath, 'r') as file:
game_id = None game_id = None
game_name = None game_name = None
exe_path = None
for line in file: for line in file:
split_line = line.split("=") split_line = line.split("=")
if len(split_line) > 1: if len(split_line) > 1:
@ -678,10 +679,15 @@ def getGogGameInfo(filePath):
game_name = re.findall(r'\"(.+?)\"', split_line[1]) game_name = re.findall(r'\"(.+?)\"', split_line[1])
if game_name: if game_name:
game_name = game_name[0] game_name = game_name[0]
if game_id and game_name: if "exe" in line and "GOG Galaxy" in line and not "unins000.exe" in line:
game_dict[game_name] = {'id': game_id} exe_path = re.findall(r'\"(.+?)\"', split_line[1])
if exe_path:
exe_path = exe_path[0].replace('\\\\', '\\')
if game_id and game_name and exe_path:
game_dict[game_name] = {'id': game_id, 'exe': exe_path}
game_id = None game_id = None
game_name = None game_name = None
exe_path = None
return game_dict return game_dict
@ -698,7 +704,7 @@ else:
for game, game_info in game_dict.items(): for game, game_info in game_dict.items():
if game_info['id']: if game_info['id']:
launch_options = f"STEAM_COMPAT_DATA_PATH=\"{logged_in_home}/.local/share/Steam/steamapps/compatdata/{gog_galaxy_launcher}/\" %command% /command=runGame /gameId={game_info['id']}\"" launch_options = f"STEAM_COMPAT_DATA_PATH=\"{logged_in_home}/.local/share/Steam/steamapps/compatdata/{gog_galaxy_launcher}/\" %command% /command=runGame /gameId={game_info['id']} /path=\"{game_info['exe']}\""
exe_path = f"\"{logged_in_home}/.local/share/Steam/steamapps/compatdata/{gog_galaxy_launcher}/pfx/drive_c/Program Files (x86)/GOG Galaxy/GalaxyClient.exe\"" exe_path = f"\"{logged_in_home}/.local/share/Steam/steamapps/compatdata/{gog_galaxy_launcher}/pfx/drive_c/Program Files (x86)/GOG Galaxy/GalaxyClient.exe\""
start_dir = f"\"{logged_in_home}/.local/share/Steam/steamapps/compatdata/{gog_galaxy_launcher}/pfx/drive_c/Program Files (x86)/GOG Galaxy/\"" start_dir = f"\"{logged_in_home}/.local/share/Steam/steamapps/compatdata/{gog_galaxy_launcher}/pfx/drive_c/Program Files (x86)/GOG Galaxy/\""
create_new_entry(exe_path, game, launch_options, start_dir) create_new_entry(exe_path, game, launch_options, start_dir)