mirror of
https://github.com/gurrgur/er-patcher.git
synced 2026-06-13 09:47:54 +00:00
Update for "--executable" and clean up
This commit is contained in:
parent
e6e0f7a70c
commit
1764f1baba
1 changed files with 16 additions and 12 deletions
12
er-patcher
12
er-patcher
|
|
@ -1,6 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
import argparse
|
||||
|
|
@ -14,10 +13,11 @@ if __name__ == "__main__":
|
|||
|
||||
patcher_args = sys.argv[1:sys.argv.index("--")]
|
||||
|
||||
parser = argparse.ArgumentParser(description="Patch `eldenring.exe` and launch it without EAC.")
|
||||
parser = argparse.ArgumentParser(description="Patch `eldenring.exe` and run it without EAC.")
|
||||
|
||||
parser.add_argument("--all", action='store_true', help="Enable all options but `--rate` and gameplay changes like `--disable-rune-loss`.")
|
||||
parser.add_argument("-l", "--disable-rune-loss", action='store_true', help="Disable rune loss on death.")
|
||||
parser.add_argument("-x", "--executable", action='store', type=str, default="eldenring.exe", help="Set the executable to run, relative to the game's folder.")
|
||||
parser.add_argument("-a", "--increase-animation-distance", action='store_true', help="Fix low frame rate animations for distant entities or at screen edges.")
|
||||
parser.add_argument("-r", "--rate", type=int, default=60, help="Set a custom frame rate limit (default: 60).")
|
||||
parser.add_argument("-f", "--remove-60-hz-fullscreen", action='store_true', help="Remove 60 Hz lock in fullscreen (unneeded in Proton).")
|
||||
|
|
@ -28,6 +28,10 @@ if __name__ == "__main__":
|
|||
parser.add_argument("-w", "--with-eac", action='store_true', help="Run the game with EAC (use it at own your risk).")
|
||||
patch = parser.parse_args(patcher_args)
|
||||
|
||||
if patch.with_eac and patch.executable != "eldenring.exe":
|
||||
print("er-patcher: --with-eac is mutually exclusive with --executable")
|
||||
sys.exit(1)
|
||||
|
||||
game_dir = Path(".")
|
||||
with open(game_dir / "eldenring.exe", "rb") as f:
|
||||
exe_hex = f.read().hex()
|
||||
|
|
@ -132,9 +136,9 @@ if patch.increase_animation_distance or patch.all:
|
|||
if not (game_dir_patched / f).is_file():
|
||||
f.link_to(game_dir_patched / f)
|
||||
|
||||
# start patched exe directly to avoid EAC
|
||||
# run patched exe directly to avoid EAC
|
||||
steam_cmd = sys.argv[1 + sys.argv.index("--"):]
|
||||
steam_cmd[-1] = Path(steam_cmd[-1]).parent.absolute() / game_dir_patched / ("start_protected_game.exe" if patch.with_eac else "eldenring.exe")
|
||||
steam_cmd[-1] = Path(steam_cmd[-1]).parent.absolute() / game_dir_patched / ("start_protected_game.exe" if patch.with_eac else "patch.executable")
|
||||
subprocess.run(steam_cmd, cwd=steam_cmd[-1].parent.absolute())
|
||||
|
||||
# cleanup
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue