mirror of
https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck.git
synced 2025-02-01 11:22:37 +01:00
fixed umu shortcuts
This commit is contained in:
parent
41dee335a8
commit
a7de732b02
@ -569,7 +569,7 @@ def extract_base_path(launchoptions):
|
|||||||
return match.group(1)
|
return match.group(1)
|
||||||
raise ValueError("STEAM_COMPAT_DATA_PATH not found in launch options")
|
raise ValueError("STEAM_COMPAT_DATA_PATH not found in launch options")
|
||||||
|
|
||||||
def modify_shortcut_for_umu(appname, exe, launchoptions, startingdir):
|
def modify_shortcut_for_umu(appname, exe, launchoptions, startingdir, logged_in_home, compat_tool_name):
|
||||||
# Skip processing if STEAM_COMPAT_DATA_PATH is not present
|
# Skip processing if STEAM_COMPAT_DATA_PATH is not present
|
||||||
if 'STEAM_COMPAT_DATA_PATH=' not in launchoptions:
|
if 'STEAM_COMPAT_DATA_PATH=' not in launchoptions:
|
||||||
print(f"Launch options for {appname} do not contain STEAM_COMPAT_DATA_PATH. Skipping modification.")
|
print(f"Launch options for {appname} do not contain STEAM_COMPAT_DATA_PATH. Skipping modification.")
|
||||||
@ -618,14 +618,26 @@ def modify_shortcut_for_umu(appname, exe, launchoptions, startingdir):
|
|||||||
elif "/command=runGame /gameId=" in launchoptions:
|
elif "/command=runGame /gameId=" in launchoptions:
|
||||||
updated_launch = f'/command=runGame /gameId={codename} /path={launchoptions.split("/path=")[1]}'
|
updated_launch = f'/command=runGame /gameId={codename} /path={launchoptions.split("/path=")[1]}'
|
||||||
|
|
||||||
|
# Ensure the first STEAM_COMPAT_DATA_PATH is included and avoid adding it again
|
||||||
|
if 'STEAM_COMPAT_DATA_PATH=' in updated_launch:
|
||||||
|
# Remove the existing STEAM_COMPAT_DATA_PATH if it exists in the launch options
|
||||||
|
updated_launch = re.sub(r'STEAM_COMPAT_DATA_PATH="[^"]+" ', '', updated_launch)
|
||||||
|
|
||||||
|
# Always include the first STEAM_COMPAT_DATA_PATH at the start
|
||||||
new_launch_options = (
|
new_launch_options = (
|
||||||
f'STEAM_COMPAT_DATA_PATH="{base_path}" '
|
f'STEAM_COMPAT_DATA_PATH="{base_path}" '
|
||||||
f'WINEPREFIX="{base_path}pfx" '
|
f'WINEPREFIX="{base_path}pfx" '
|
||||||
f'GAMEID="{umu_id}" '
|
f'GAMEID="{umu_id}" '
|
||||||
f'PROTONPATH="{logged_in_home}/.steam/root/compatibilitytools.d/{compat_tool_name}" '
|
f'PROTONPATH="{logged_in_home}/.steam/root/compatibilitytools.d/{compat_tool_name}" '
|
||||||
f'%command% {updated_launch}'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Check if %command% is already in the launch options
|
||||||
|
if '%command%' not in updated_launch:
|
||||||
|
updated_launch = f'%command% {updated_launch}'
|
||||||
|
|
||||||
|
# Final new launch options
|
||||||
|
new_launch_options += updated_launch
|
||||||
|
|
||||||
umu_processed_shortcuts[umu_id] = True
|
umu_processed_shortcuts[umu_id] = True
|
||||||
|
|
||||||
return new_exe, new_start_dir, new_launch_options
|
return new_exe, new_start_dir, new_launch_options
|
||||||
|
Loading…
x
Reference in New Issue
Block a user