From 490f51384d7f29cd4be2c26d84aaf2dec5d53b35 Mon Sep 17 00:00:00 2001 From: R1kaB3rN <100738684+R1kaB3rN@users.noreply.github.com> Date: Tue, 3 Sep 2024 18:58:44 -0700 Subject: [PATCH] refactor: enforce more lint rules in codebase (#101) * feat: add ruff.toml * treewide: format gamefix modules through ruff - Enforces single quotes, a line length of 88, and updates the format of comment * treewide: remove 'pylint: disable=C0103' from gamefixes * treewide: format python files through ruff * treewide: remove all pylint disables * __init__: remove unused import * __init__: don't use bare except * debug: don't log system python version * tools: delete lint.sh * workflows: lint through ruff * ruff.toml: add ANN rule to enforce typings * ruff.toml: exclude test file * treewide: add return type for all gamefixes * steamhelper: prefer using f-string * config: fix missing types * check_gamefixes: fix missing type * util: fix reference to cache directory * util: add missing types to functions * util: fix types for function calls * workflows: fix lint step * workflows: lint winetricks * util: use Union type instead of pipe * ruff.toml: add FLY, ARG, and UP rules * treewide: use built in open * treewide: remove unnecessary open mode * treewide: fix deprecated imports * util: prefer OSError over IOError - Use OSError directly as advised in UP024 from ruff * ruff.toml: add pydocstyle rule * treewide: enforce pydocstyle for *.py files * treewide: enforce pydocstyle for gamefixes * ruff.toml: add lint exceptions * treewide: ruff lint * debug: fix type when printing sys.argv * ruff.toml: enforce D211 rule * gamefixes-steam: ruff format * gamefixes-steam: fix invalid steam appid on rebase --- .github/workflows/umu-protonfixes.yml | 9 +- __init__.py | 10 +- checks.py | 18 +- config.py | 25 +- debug.py | 19 +- download.py | 20 +- engine.py | 113 ++-- fix.py | 57 +- gamefixes-egs/umu-1248080.py | 8 + gamefixes-egs/umu-990080.py | 7 +- gamefixes-gog/umu-1209310984.py | 20 +- gamefixes-gog/umu-1228964594.py | 7 +- gamefixes-gog/umu-1564851593.py | 32 +- gamefixes-gog/umu-1580232252.py | 7 +- gamefixes-gog/umu-22610.py | 7 +- gamefixes-gog/umu-22650.py | 7 +- gamefixes-gog/umu-22670.py | 7 +- gamefixes-gog/umu-metalgearsolid.py | 11 +- gamefixes-gog/umu-silenthill4.py | 18 +- gamefixes-gog/umu-wheeloftime.py | 10 +- gamefixes-steam/1017900.py | 9 +- gamefixes-steam/10220.py | 7 +- gamefixes-steam/1030830.py | 10 +- gamefixes-steam/105000.py | 8 +- gamefixes-steam/105400.py | 16 +- gamefixes-steam/105450.py | 9 +- gamefixes-steam/1056640.py | 9 +- gamefixes-steam/1062040.py | 10 +- gamefixes-steam/1063730.py | 10 +- gamefixes-steam/108710.py | 9 +- gamefixes-steam/1097150.py | 11 +- gamefixes-steam/1097880.py | 11 +- gamefixes-steam/1105510.py | 11 +- gamefixes-steam/110800.py | 12 +- gamefixes-steam/1113000.py | 7 +- gamefixes-steam/1121560.py | 7 +- gamefixes-steam/1151640.py | 9 +- gamefixes-steam/1158850.py | 6 +- gamefixes-steam/1174180.py | 13 +- gamefixes-steam/1175730.py | 10 +- gamefixes-steam/12200.py | 11 +- gamefixes-steam/12210.py | 10 +- gamefixes-steam/1222370.py | 11 +- gamefixes-steam/1222690.py | 13 +- gamefixes-steam/1230140.py | 4 +- gamefixes-steam/1237970.py | 10 +- gamefixes-steam/1239520.py | 7 +- gamefixes-steam/1240440.py | 7 +- gamefixes-steam/1245620.py | 4 +- gamefixes-steam/1250410.py | 9 +- gamefixes-steam/1257290.py | 7 +- gamefixes-steam/1259970.py | 7 +- gamefixes-steam/1272580.py | 6 +- gamefixes-steam/1277510.py | 7 +- gamefixes-steam/1277930.py | 6 +- gamefixes-steam/12810.py | 9 +- gamefixes-steam/12840.py | 9 +- gamefixes-steam/1284210.py | 10 +- gamefixes-steam/1284410.py | 10 +- gamefixes-steam/1286880.py | 9 +- gamefixes-steam/1293820.py | 8 +- gamefixes-steam/1293830.py | 7 +- gamefixes-steam/1382330.py | 6 +- gamefixes-steam/1413480.py | 6 +- gamefixes-steam/1434950.py | 10 +- gamefixes-steam/1449280.py | 10 +- gamefixes-steam/1500540.py | 11 +- gamefixes-steam/15130.py | 17 +- gamefixes-steam/1532190.py | 7 +- gamefixes-steam/1557480.py | 10 +- gamefixes-steam/15700.py | 9 +- gamefixes-steam/15740.py | 11 +- gamefixes-steam/15750.py | 9 +- gamefixes-steam/1613450.py | 7 +- gamefixes-steam/1659420.py | 10 +- gamefixes-steam/1664350.py | 9 +- gamefixes-steam/16700.py | 10 +- gamefixes-steam/16810.py | 6 +- gamefixes-steam/1681970.py | 7 +- gamefixes-steam/1695791.py | 7 +- gamefixes-steam/1695793.py | 6 +- gamefixes-steam/1695794.py | 7 +- gamefixes-steam/1711950.py | 10 +- gamefixes-steam/1715130.py | 7 +- gamefixes-steam/17300.py | 9 +- gamefixes-steam/1795390.py | 11 +- gamefixes-steam/1829980.py | 6 +- gamefixes-steam/1873170.py | 13 +- gamefixes-steam/1930.py | 7 +- gamefixes-steam/19900.py | 9 +- gamefixes-steam/1999770.py | 7 +- gamefixes-steam/200490.py | 6 +- gamefixes-steam/200940.py | 10 +- gamefixes-steam/201480.py | 10 +- gamefixes-steam/204450.py | 8 +- gamefixes-steam/206480.py | 9 +- gamefixes-steam/206500.py | 8 +- gamefixes-steam/207350.py | 7 +- gamefixes-steam/208650.py | 9 +- gamefixes-steam/20920.py | 9 +- gamefixes-steam/211420.py | 14 +- gamefixes-steam/212500.py | 9 +- gamefixes-steam/213330.py | 10 +- gamefixes-steam/2138090.py | 6 +- gamefixes-steam/214510.py | 9 +- gamefixes-steam/214950.py | 10 +- gamefixes-steam/215280.py | 7 +- gamefixes-steam/21680.py | 10 +- gamefixes-steam/2183070.py | 8 +- gamefixes-steam/219030.py | 7 +- gamefixes-steam/219990.py | 7 +- gamefixes-steam/220240.py | 10 +- gamefixes-steam/2229850.py | 25 +- gamefixes-steam/22370.py | 9 +- gamefixes-steam/223750.py | 6 +- gamefixes-steam/224960.py | 8 +- gamefixes-steam/225640.py | 10 +- gamefixes-steam/227320.py | 9 +- gamefixes-steam/230820.py | 8 +- gamefixes-steam/231990.py | 10 +- gamefixes-steam/233270.py | 10 +- gamefixes-steam/23460.py | 14 +- gamefixes-steam/237890.py | 7 +- gamefixes-steam/2399220.py | 8 +- gamefixes-steam/240600.py | 8 +- gamefixes-steam/242760.py | 13 +- gamefixes-steam/243200.py | 8 +- gamefixes-steam/244210.py | 8 +- gamefixes-steam/244850.py | 11 +- gamefixes-steam/2458530.py | 7 +- gamefixes-steam/2475980.py | 28 +- gamefixes-steam/2507620.py | 9 +- gamefixes-steam/251150.py | 11 +- gamefixes-steam/251290.py | 11 +- gamefixes-steam/252430.py | 10 +- gamefixes-steam/256330.py | 13 +- gamefixes-steam/257420.py | 14 +- gamefixes-steam/260130.py | 7 +- gamefixes-steam/261510.py | 9 +- gamefixes-steam/2620.py | 9 +- gamefixes-steam/266840.py | 8 +- gamefixes-steam/268050.py | 9 +- gamefixes-steam/271590.py | 12 +- gamefixes-steam/282900.py | 6 +- gamefixes-steam/284160.py | 9 +- gamefixes-steam/286360.py | 6 +- gamefixes-steam/287310.py | 10 +- gamefixes-steam/287450.py | 9 +- gamefixes-steam/289130.py | 10 +- gamefixes-steam/292410.py | 13 +- gamefixes-steam/294700.py | 28 +- gamefixes-steam/298110.py | 10 +- gamefixes-steam/302370.py | 29 +- gamefixes-steam/307690.py | 8 +- gamefixes-steam/307780.py | 7 +- gamefixes-steam/311210.py | 10 +- gamefixes-steam/311730.py | 9 +- gamefixes-steam/312060.py | 10 +- gamefixes-steam/312450.py | 8 +- gamefixes-steam/312670.py | 10 +- gamefixes-steam/312790.py | 7 +- gamefixes-steam/321040.py | 9 +- gamefixes-steam/328500.py | 12 +- gamefixes-steam/329380.py | 9 +- gamefixes-steam/33990.py | 6 +- gamefixes-steam/34330.py | 6 +- gamefixes-steam/348550.py | 9 +- gamefixes-steam/35140.py | 9 +- gamefixes-steam/351710.py | 6 +- gamefixes-steam/356190.py | 7 +- gamefixes-steam/356500.py | 8 +- gamefixes-steam/3590.py | 8 +- gamefixes-steam/359550.py | 9 +- gamefixes-steam/359870.py | 16 +- gamefixes-steam/366250.py | 7 +- gamefixes-steam/371660.py | 10 +- gamefixes-steam/372000.py | 10 +- gamefixes-steam/377160.py | 9 +- gamefixes-steam/377840.py | 9 +- gamefixes-steam/378630.py | 6 +- gamefixes-steam/379720.py | 25 +- gamefixes-steam/386360.py | 27 +- gamefixes-steam/388750.py | 11 +- gamefixes-steam/390710.py | 9 +- gamefixes-steam/39140.py | 9 +- gamefixes-steam/39210.py | 10 +- gamefixes-steam/39500.py | 11 +- gamefixes-steam/39690.py | 8 +- gamefixes-steam/397540.py | 10 +- gamefixes-steam/40800.py | 10 +- gamefixes-steam/409090.py | 17 +- gamefixes-steam/40950.py | 9 +- gamefixes-steam/40970.py | 10 +- gamefixes-steam/409720.py | 9 +- gamefixes-steam/410900.py | 9 +- gamefixes-steam/424840.py | 9 +- gamefixes-steam/428660.py | 11 +- gamefixes-steam/429720.py | 8 +- gamefixes-steam/43110.py | 9 +- gamefixes-steam/434570.py | 8 +- gamefixes-steam/436670.py | 11 +- gamefixes-steam/440900.py | 13 +- gamefixes-steam/44690.py | 9 +- gamefixes-steam/447040.py | 5 +- gamefixes-steam/452440.py | 18 +- gamefixes-steam/45750.py | 6 +- gamefixes-steam/460120.py | 12 +- gamefixes-steam/46500.py | 14 +- gamefixes-steam/465280.py | 9 +- gamefixes-steam/465840.py | 8 +- gamefixes-steam/4730.py | 7 +- gamefixes-steam/48190.py | 6 +- gamefixes-steam/489830.py | 10 +- gamefixes-steam/49520.py | 9 +- gamefixes-steam/495420.py | 10 +- gamefixes-steam/497360.py | 98 +++- gamefixes-steam/508980.py | 20 +- gamefixes-steam/518790.py | 10 +- gamefixes-steam/550340.py | 7 +- gamefixes-steam/559620.py | 8 +- gamefixes-steam/570940.py | 7 +- gamefixes-steam/582660.py | 14 +- gamefixes-steam/586140.py | 7 +- gamefixes-steam/593600.py | 9 +- gamefixes-steam/601510.py | 7 +- gamefixes-steam/61500.py | 8 +- gamefixes-steam/6270.py | 7 +- gamefixes-steam/627270.py | 7 +- gamefixes-steam/63110.py | 6 +- gamefixes-steam/633230.py | 11 +- gamefixes-steam/63700.py | 8 +- gamefixes-steam/63710.py | 9 +- gamefixes-steam/638160.py | 7 +- gamefixes-steam/638970.py | 9 +- gamefixes-steam/644930.py | 9 +- gamefixes-steam/65540.py | 23 +- gamefixes-steam/65600.py | 11 +- gamefixes-steam/65610.py | 8 +- gamefixes-steam/658150.py | 10 +- gamefixes-steam/658260.py | 7 +- gamefixes-steam/65930.py | 9 +- gamefixes-steam/678950.py | 7 +- gamefixes-steam/700600.py | 9 +- gamefixes-steam/702050.py | 8 +- gamefixes-steam/70400.py | 9 +- gamefixes-steam/70420.py | 9 +- gamefixes-steam/72850.py | 9 +- gamefixes-steam/729040.py | 7 +- gamefixes-steam/730830.py | 6 +- gamefixes-steam/73170.py | 9 +- gamefixes-steam/740550.py | 7 +- gamefixes-steam/750920.py | 9 +- gamefixes-steam/773370.py | 9 +- gamefixes-steam/78000.py | 10 +- gamefixes-steam/782330.py | 7 +- gamefixes-steam/7850.py | 9 +- gamefixes-steam/812140.py | 2 +- gamefixes-steam/813780.py | 7 +- gamefixes-steam/816020.py | 11 +- gamefixes-steam/8190.py | 9 +- gamefixes-steam/834530.py | 9 +- gamefixes-steam/888790.py | 8 +- gamefixes-steam/893180.py | 7 +- gamefixes-steam/895870.py | 9 +- gamefixes-steam/906510.py | 10 +- gamefixes-steam/910830.py | 9 +- gamefixes-steam/913740.py | 9 +- gamefixes-steam/936160.py | 6 +- gamefixes-steam/963930.py | 9 +- gamefixes-steam/968370.py | 6 +- gamefixes-steam/976310.py | 7 +- gamefixes-steam/976730.py | 7 +- gamefixes-steam/9900.py | 11 +- gamefixes-steam/99300.py | 10 +- gamefixes-steam/997070.py | 7 +- gamefixes-steam/default.py | 17 +- gamefixes-umu/default.py | 12 +- gamefixes-umu/umu-2016590.py | 30 +- gamefixes-umu/umu-model2.py | 8 +- gamefixes-umu/umu-starcitizen.py | 23 +- gamefixes-umu/winetricks-gui.py | 9 +- gamefixes-zoomplatform/umu-240200.py | 7 +- ...mu-4bff76f4-566a-4714-b481-95d3343afe22.py | 7 +- logger.py | 43 +- protonfixes_test.py | 73 +-- pyproject.toml | 540 ------------------ ruff.toml | 113 ++++ steamhelper.py | 65 ++- tools/check_gamefixes.py | 8 +- tools/lint.sh | 16 - util.py | 350 ++++++------ 291 files changed, 1715 insertions(+), 2512 deletions(-) create mode 100644 gamefixes-egs/umu-1248080.py delete mode 100644 pyproject.toml create mode 100644 ruff.toml delete mode 100644 tools/lint.sh diff --git a/.github/workflows/umu-protonfixes.yml b/.github/workflows/umu-protonfixes.yml index d76f1c53..16513064 100644 --- a/.github/workflows/umu-protonfixes.yml +++ b/.github/workflows/umu-protonfixes.yml @@ -23,20 +23,21 @@ jobs: run: | sudo apt-get install shellcheck python3 -m pip install --upgrade pip - pip install pylint + pip install ruff pip install ijson - name: Lint with Shellcheck run: | - shellcheck tools/lint.sh tools/check-links.sh + shellcheck tools/check-links.sh + shellcheck winetricks - name: Check symbolic links run: | bash tools/check-links.sh - name: Check gamefix module IDs run: | python tools/check_gamefixes.py - - name: Lint with Pylint + - name: Lint with Ruff run: | - bash tools/lint.sh + ruff check . - name: Test with unittest run: | python protonfixes_test.py diff --git a/__init__.py b/__init__.py index 844d2fdd..6605138c 100644 --- a/__init__.py +++ b/__init__.py @@ -1,12 +1,8 @@ -""" Starts the protonfix module -""" +"""Starts the protonfix module""" import os import sys -if 'DEBUG' in os.environ: - from . import debug - RUN_CONDITIONS = [ 'STEAM_COMPAT_DATA_PATH' in os.environ, 'PROTONFIXES_DISABLE' not in os.environ, @@ -16,11 +12,11 @@ if all(RUN_CONDITIONS): import traceback from . import fix + try: fix.main() - #pylint: disable=W0702 # Catch any exceptions and print a traceback - except: + except Exception: sys.stderr.write('ProtonFixes ' + traceback.format_exc()) sys.stderr.flush() diff --git a/checks.py b/checks.py index e94f2aa0..064e0651 100644 --- a/checks.py +++ b/checks.py @@ -1,5 +1,4 @@ -""" Run some tests and generate warnings for proton configuration issues -""" +"""Run some tests and generate warnings for proton configuration issues""" try: from .logger import log @@ -8,16 +7,15 @@ def esync_file_limits() -> bool: - """ - Check esync file limits using /proc/sys/fs/file-max + """Check esync file limits using /proc/sys/fs/file-max + https://www.reddit.com/r/SteamPlay/comments/9kqisk/tip_for_those_using_proton_no_esync1/ """ - - warning = '''File descriptor limit is low + warning = """File descriptor limit is low This can cause issues with ESYNC For more details see: https://github.com/zfigura/wine/blob/esync/README.esync - ''' + """ with open('/proc/sys/fs/file-max', encoding='ascii') as fsmax: max_files = fsmax.readline() @@ -28,12 +26,10 @@ def esync_file_limits() -> bool: def run_checks() -> None: - """ Run checks to notify of any potential issues - """ - + """Run checks to notify of any potential issues""" log.info('Running checks') checks = [ esync_file_limits(), - ] + ] if all(checks): log.info('All checks successful') diff --git a/config.py b/config.py index 62aa574b..0743be36 100644 --- a/config.py +++ b/config.py @@ -1,7 +1,8 @@ -""" Load configuration settings for protonfixes -""" +"""Load configuration settings for protonfixes""" + import os from configparser import ConfigParser + try: from .logger import log except ImportError: @@ -9,7 +10,7 @@ CONF_FILE = '~/.config/protonfixes/config.ini' -DEFAULT_CONF = ''' +DEFAULT_CONF = """ [main] enable_checks = true enable_splash = false @@ -18,30 +19,26 @@ [path] cache_dir = ~/.cache/protonfixes -''' +""" CONF = ConfigParser() CONF.read_string(DEFAULT_CONF) try: CONF.read(os.path.expanduser(CONF_FILE)) -# pylint: disable=W0703 + except Exception: log.debug('Unable to read config file ' + CONF_FILE) -def opt_bool(opt): - """ Convert bool ini strings to actual boolean values - """ +def opt_bool(opt: str) -> bool: + """Convert bool ini strings to actual boolean values""" return opt.lower() in ['yes', 'y', 'true', '1'] -# pylint: disable=E1101 -locals().update( - {x:opt_bool(y) for x, y - in CONF['main'].items() - if 'enable' in x}) -locals().update({x:os.path.expanduser(y) for x, y in CONF['path'].items()}) +locals().update({x: opt_bool(y) for x, y in CONF['main'].items() if 'enable' in x}) + +locals().update({x: os.path.expanduser(y) for x, y in CONF['path'].items()}) try: [os.makedirs(os.path.expanduser(d)) for n, d in CONF['path'].items()] diff --git a/debug.py b/debug.py index 268b968c..b061cd3b 100644 --- a/debug.py +++ b/debug.py @@ -1,18 +1,16 @@ -""" Prints debug info if the environment variable DEBUG is 1 -""" +"""Prints debug info if the environment variable DEBUG is 1""" import os import sys -import shutil -# pylint: disable=E0611 + from __main__ import CURRENT_PREFIX_VERSION, g_proton from .logger import log os.environ['DEBUG'] = '1' -def show_debug_info() -> None: - """ Show various debug info """ +def show_debug_info() -> None: + """Show various debug info""" check_args = [ 'iscriptevaluator.exe' in sys.argv[2], 'getcompatpath' in sys.argv[1], @@ -29,12 +27,6 @@ def show_debug_info() -> None: log.debug(sys.executable) log.debug(sys.version) log.debug(line) - log.debug('System Python Version:') - try: - log.debug(shutil.which(os.readlink(shutil.which('python')))) - except: #pylint: disable=W0702 - log.debug(shutil.which('python')) - log.debug(line) log.debug('Proton Version:') log.debug(CURRENT_PREFIX_VERSION) @@ -58,7 +50,8 @@ def show_debug_info() -> None: log.debug(line) log.debug('Command Line:') - log.debug(sys.argv) + log.debug(f'{sys.argv}') log.debug('----- end protontricks debug info -----') + show_debug_info() diff --git a/download.py b/download.py index 6fa1109b..64a853d1 100644 --- a/download.py +++ b/download.py @@ -1,5 +1,4 @@ -""" Module with helper functions to download from file-hosting providers -""" +"""Module with helper functions to download from file-hosting providers""" import os import hashlib @@ -12,16 +11,14 @@ def get_filename(headers: list) -> str: - """ Retrieve a filename from a request headers via Content-Disposition - """ + """Retrieve a filename from a request headers via Content-Disposition""" content_disp = [x for x in headers if x[0] == 'Content-Disposition'][0][1] raw_filename = [x for x in content_disp.split(';') if x.startswith('filename=')][0] return raw_filename.replace('filename=', '').replace('"', '') def gdrive_download(gdrive_id: str, path: str) -> None: - """ Download a file from gdrive given the fileid and a path to save - """ + """Download a file from gdrive given the fileid and a path to save""" url = GDRIVE_URL.format(gdrive_id) cjar = http.cookiejar.CookieJar() opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cjar)) @@ -29,9 +26,11 @@ def gdrive_download(gdrive_id: str, path: str) -> None: req = urllib.request.Request(url) with urllib.request.urlopen(req, timeout=10) as resp: - confirm_cookie = [x for x in resp.getheaders() if - (x[0] == 'Set-Cookie' - and x[1].startswith('download_warning'))][0][1] + confirm_cookie = [ + x + for x in resp.getheaders() + if (x[0] == 'Set-Cookie' and x[1].startswith('download_warning')) + ][0][1] confirm = confirm_cookie.split(';')[0].split('=')[1] req = urllib.request.Request(f'{url}&confirm={confirm}') @@ -42,8 +41,7 @@ def gdrive_download(gdrive_id: str, path: str) -> None: def sha1sum(filename: str) -> str: - """ Computes the sha1sum of the specified file - """ + """Computes the sha1sum of the specified file""" if not os.path.isfile(filename): return '' hasher = hashlib.sha1() diff --git a/engine.py b/engine.py index 84728eac..e19a777d 100644 --- a/engine.py +++ b/engine.py @@ -1,22 +1,21 @@ -""" Game engine API -""" +"""Game engine API""" import os import sys from .logger import log -class Engine(): - """ Game engines - """ - def __init__(self) -> None: +class Engine: + """Game engines""" + + def __init__(self) -> None: # noqa: D107 self.engine_name = None self.supported = { 'Dunia 2': 'https://pcgamingwiki.com/wiki/Engine:Dunia_2', 'Unity': 'https://pcgamingwiki.com/wiki/Engine:Unity', - 'RAGE' : 'https://pcgamingwiki.com/wiki/Grand_Theft_Auto_IV#Launch_Options', - 'UE3' : 'https://pcgamingwiki.com/wiki/Engine:Unreal_Engine_3', - 'UE4' : 'https://pcgamingwiki.com/wiki/Engine:Unreal_Engine_4' + 'RAGE': 'https://pcgamingwiki.com/wiki/Grand_Theft_Auto_IV#Launch_Options', + 'UE3': 'https://pcgamingwiki.com/wiki/Engine:Unreal_Engine_3', + 'UE4': 'https://pcgamingwiki.com/wiki/Engine:Unreal_Engine_4', } # Autodetection @@ -38,18 +37,12 @@ def __init__(self) -> None: log.info('Engine: ' + self.engine_name) log.info('Engine: ' + self.supported[self.engine_name]) - def _add_argument(self, args: str = '') -> None: - """ Set command line arguments - """ - + """Set command line arguments""" sys.argv += args.split(' ') - def _is_unity(self) -> bool: - """ Detect Unity engine - """ - + """Detect Unity engine""" dir_list = os.listdir(os.environ['PWD']) data_list = list(filter(lambda item: 'Data' in item, dir_list)) @@ -60,56 +53,43 @@ def _is_unity(self) -> bool: return False - def _is_dunia2(self) -> bool: - """ Detect Dunia 2 engine (Far Cry >= 3) - """ - + """Detect Dunia 2 engine (Far Cry >= 3)""" dir_list = os.listdir(os.environ['PWD']) data_list = list(filter(lambda item: 'data_win' in item, dir_list)) # Check .../data_win*/worlds/multicommon dir for data_dir in data_list: - if os.path.exists(os.path.join(os.environ['PWD'], data_dir, 'worlds/multicommon')): + if os.path.exists( + os.path.join(os.environ['PWD'], data_dir, 'worlds/multicommon') + ): return True return False - def _is_rage(self) -> bool: - """ Detect RAGE engine (GTA IV/V) - """ + """Detect RAGE engine (GTA IV/V)""" + # dir_list = os.listdir(os.environ['PWD']) -# dir_list = os.listdir(os.environ['PWD']) - -# # Check .../*/pc/data/cdimages dir -# for data_dir in dir_list: -# if os.path.exists(os.path.join(os.environ['PWD'], data_dir, 'pc/data/cdimages')): -# return True + # # Check .../*/pc/data/cdimages dir + # for data_dir in dir_list: + # if os.path.exists(os.path.join(os.environ['PWD'], data_dir, 'pc/data/cdimages')): + # return True if os.path.exists(os.path.join(os.environ['PWD'], 'pc/data/cdimages')): return True return False - def _is_ue3(self) -> bool: - """ Detect Unreal Engine 3 - """ - + """Detect Unreal Engine 3""" return False - def _is_ue4(self) -> bool: - """ Detect Unreal Engine 4 - """ - + """Detect Unreal Engine 4""" return False - def _log(self, ctx: str, msg: str, warn: bool = False) -> None: - """ Log wrapper - """ - + """Log wrapper""" if self.engine_name is None: log.warn(ctx + ': Engine not defined') return @@ -117,17 +97,12 @@ def _log(self, ctx: str, msg: str, warn: bool = False) -> None: log_func = log.warn if warn else log.info log_func(f'{self.engine_name}: {ctx}: {msg}') - def name(self) -> str: - """ Report Engine name - """ + """Report Engine name""" return self.engine_name - def set(self, _engine: str = None) -> bool: - """ Force engine - """ - + """Force engine""" if _engine in self.supported: self.engine_name = _engine self._log('set', 'forced') @@ -136,11 +111,8 @@ def set(self, _engine: str = None) -> bool: return False return True - def nosplash(self) -> bool: - """ Disable splash screen - """ - + """Disable splash screen""" if self.engine_name == 'UE3': self._add_argument('-nosplash') self._log('nosplash', 'splash screen disabled') @@ -149,11 +121,8 @@ def nosplash(self) -> bool: return False return True - def info(self) -> bool: - """ Show some information about engine - """ - + """Show some information about engine""" if self.engine_name == 'RAGE': self._add_argument('-help') self._log('info', 'command line arguments') @@ -162,15 +131,12 @@ def info(self) -> bool: return False return True - def nointro(self) -> bool: - """ Skip intro videos - """ - + """Skip intro videos""" if self.engine_name == 'UE3': self._add_argument('-nostartupmovies') self._log('nointro', 'intro videos disabled') - elif self.engine_name is 'Dunia 2': + elif self.engine_name == 'Dunia 2': self._add_argument('-skipintro') self._log('nointro', 'intro videos disabled') else: @@ -178,11 +144,8 @@ def nointro(self) -> bool: return False return True - def launcher(self) -> bool: - """ Force launcher - """ - + """Force launcher""" if self.engine_name == 'Unity': self._add_argument('-show-screen-selector') self._log('launcher', 'forced') @@ -191,11 +154,8 @@ def launcher(self) -> bool: return False return True - def windowed(self) -> bool: - """ Force windowed mode - """ - + """Force windowed mode""" if self.engine_name == 'Unity': self._add_argument('-popupwindow -screen-fullscreen 0') self._log('windowed', 'borderless window') @@ -207,11 +167,8 @@ def windowed(self) -> bool: return False return True - def resolution(self, res: str = None) -> bool: - """ Force screen resolution - """ - + """Force screen resolution""" if not isinstance(res, str): self._log('resolution', 'not provided') return False @@ -219,7 +176,9 @@ def resolution(self, res: str = None) -> bool: res_wh = res.split('x') if self.engine_name == 'Unity': - self._add_argument('-screen-width ' + res_wh[0] + ' -screen-height ' + res_wh[1]) + self._add_argument( + '-screen-width ' + res_wh[0] + ' -screen-height ' + res_wh[1] + ) self._log('resolution', res) elif self.engine_name == 'RAGE': self._add_argument('-width ' + res_wh[0] + ' -height ' + res_wh[1]) @@ -230,4 +189,4 @@ def resolution(self, res: str = None) -> bool: return True -engine = Engine() #pylint: disable=C0103 +engine = Engine() diff --git a/fix.py b/fix.py index c28bc2a7..5f3b7481 100644 --- a/fix.py +++ b/fix.py @@ -1,7 +1,5 @@ -""" Gets the game id and applies a fix if found -""" +"""Gets the game id and applies a fix if found""" -import io import os import re import sys @@ -29,8 +27,7 @@ @lru_cache def get_game_id() -> str: - """ Trys to return the game id from environment variables - """ + """Trys to return the game id from environment variables""" if 'UMU_ID' in os.environ: return os.environ['UMU_ID'] if 'SteamAppId' in os.environ: @@ -45,18 +42,17 @@ def get_game_id() -> str: @lru_cache -def get_game_name() -> str: #pylint: disable=R0914 - """ Trys to return the game name from environment variables - """ +def get_game_name() -> str: + """Trys to return the game name from environment variables""" pfx = os.environ.get('WINEPREFIX') or protonmain.g_session.env.get('WINEPREFIX') if os.environ.get('UMU_ID'): if os.path.isfile(f'{pfx}/game_title'): - with open(f'{pfx}/game_title', 'r', encoding='utf-8') as file: + with open(f'{pfx}/game_title', encoding='utf-8') as file: return file.readline() if not check_internet(): - log.warn('No internet connection, can\'t fetch name') + log.warn("No internet connection, can't fetch name") return 'UNKNOWN' try: @@ -69,7 +65,9 @@ def get_game_name() -> str: #pylint: disable=R0914 data = response.read() json_data = json.loads(data) title = json_data[0]['title'] - with open(os.environ['WINEPREFIX'] + '/game_title', 'w', encoding='utf-8') as file: + with open( + os.environ['WINEPREFIX'] + '/game_title', 'w', encoding='utf-8' + ) as file: file.write(title) return title except TimeoutError as ex: @@ -87,7 +85,7 @@ def get_game_name() -> str: #pylint: disable=R0914 game_library = re.findall(r'.*/steamapps', os.environ['PWD'], re.IGNORECASE)[-1] game_manifest = os.path.join(game_library, f'appmanifest_{get_game_id()}.acf') - with io.open(game_manifest, 'r', encoding='utf-8') as appmanifest: + with open(game_manifest, encoding='utf-8') as appmanifest: for xline in appmanifest.readlines(): if 'name' in xline.strip(): name = re.findall(r'"[^"]+"', xline, re.UNICODE)[-1] @@ -99,8 +97,7 @@ def get_game_name() -> str: #pylint: disable=R0914 def get_store_name(store: str) -> str: - """ Mapping for store identifier to store name - """ + """Mapping for store identifier to store name""" return { 'amazon': 'Amazon', 'battlenet': 'Battle.net', @@ -111,13 +108,12 @@ def get_store_name(store: str) -> str: 'itchio': 'Itch.io', 'steam': 'Steam', 'ubisoft': 'Ubisoft', - 'zoomplatform': 'ZOOM Platform' + 'zoomplatform': 'ZOOM Platform', }.get(store, None) def get_module_name(game_id: str, default: bool = False, local: bool = False) -> str: - """ Creates the name of a gamefix module, which can be imported - """ + """Creates the name of a gamefix module, which can be imported""" store = 'umu' if game_id.isnumeric(): store = 'steam' @@ -134,15 +130,15 @@ def get_module_name(game_id: str, default: bool = False, local: bool = False) -> log.info('No store specified, using UMU database') store = 'umu' - return (f'protonfixes.gamefixes-{store}.' if not local else 'localfixes.') +\ - (game_id if not default else 'default') + return (f'protonfixes.gamefixes-{store}.' if not local else 'localfixes.') + ( + game_id if not default else 'default' + ) def _run_fix_local(game_id: str, default: bool = False) -> bool: - """ Check if a local gamefix is available first and run it - """ + """Check if a local gamefix is available first and run it""" localpath = os.path.expanduser('~/.config/protonfixes/localfixes') - module_name = game_id if not default else 'default' + module_name = game_id if not default else 'default' # Check if local gamefix exists if not os.path.isfile(os.path.join(localpath, module_name + '.py')): @@ -157,10 +153,9 @@ def _run_fix_local(game_id: str, default: bool = False) -> bool: def _run_fix(game_id: str, default: bool = False, local: bool = False) -> bool: - """ Private function, which actually executes gamefixes - """ + """Private function, which actually executes gamefixes""" fix_type = 'protonfix' if not default else 'defaults' - scope = 'global' if not local else 'local' + scope = 'global' if not local else 'local' try: module_name = get_module_name(game_id, default, local) @@ -175,8 +170,9 @@ def _run_fix(game_id: str, default: bool = False, local: bool = False) -> bool: def run_fix(game_id: str) -> None: - """ Loads a gamefix module by it's gameid - local fixes prevent global fixes from being executed + """Loads a gamefix module by it's gameid + + local fixes prevent global fixes from being executed """ if game_id is None: return @@ -186,16 +182,15 @@ def run_fix(game_id: str) -> None: # execute default.py (local) if not _run_fix_local(game_id, True) and config.enable_global_fixes: - _run_fix(game_id, True) # global + _run_fix(game_id, True) # global # execute .py (local) if not _run_fix_local(game_id, False) and config.enable_global_fixes: - _run_fix(game_id, False) # global + _run_fix(game_id, False) # global def main() -> None: - """ Runs the gamefix - """ + """Runs the gamefix""" check_args = [ 'iscriptevaluator.exe' in sys.argv[2], 'getcompatpath' in sys.argv[1], diff --git a/gamefixes-egs/umu-1248080.py b/gamefixes-egs/umu-1248080.py new file mode 100644 index 00000000..a5565d2f --- /dev/null +++ b/gamefixes-egs/umu-1248080.py @@ -0,0 +1,8 @@ +"""Game fix for CYGNI: All Guns Blazing""" + +from protonfixes import util + + +def main() -> None: + # EGS only: This fixes the startup process. + util.append_argument('-epicdeploymentid=78a046d4ac1b42d7aaba9fe80f88a5d8') diff --git a/gamefixes-egs/umu-990080.py b/gamefixes-egs/umu-990080.py index 65a0c3c8..304c3b7b 100644 --- a/gamefixes-egs/umu-990080.py +++ b/gamefixes-egs/umu-990080.py @@ -1,9 +1,8 @@ -""" Game fix Hogwarts Legacy -""" -#pylint: disable=C0103 +"""Game fix Hogwarts Legacy""" from protonfixes import util -def main(): + +def main() -> None: # Requires vcrun2019 to launch util.protontricks('vcrun2019') diff --git a/gamefixes-gog/umu-1209310984.py b/gamefixes-gog/umu-1209310984.py index ee2d7380..786be6b0 100644 --- a/gamefixes-gog/umu-1209310984.py +++ b/gamefixes-gog/umu-1209310984.py @@ -15,12 +15,12 @@ from protonfixes.logger import log -def main(): - arc = "https://github.com/user-attachments/files/16788423/xaudio2_8.dll.gz" - hashsum_file = "173cac0a7931989d66338e0d7779e451f2f01b2377903df7954d86c07c1bc8fb" - tmp = f"{mkdtemp()}/xaudio2_8.dll.gz" +def main() -> None: + arc = 'https://github.com/user-attachments/files/16788423/xaudio2_8.dll.gz' + hashsum_file = '173cac0a7931989d66338e0d7779e451f2f01b2377903df7954d86c07c1bc8fb' + tmp = f'{mkdtemp()}/xaudio2_8.dll.gz' hashsum = sha256() - path_dll = f"{util.get_game_install_path()}/xaudio2_8.dll" + path_dll = f'{util.get_game_install_path()}/xaudio2_8.dll' # Full Metal Daemon from gog will not have the xaudio2_8.dll if os.path.exists(path_dll): @@ -32,10 +32,10 @@ def main(): # Download the archive with urlopen(arc, timeout=30) as resp: if resp.status != 200: - log.warn(f"github returned the status code: {resp.status}") + log.warn(f'github returned the status code: {resp.status}') return - with open(tmp, mode="wb", buffering=0) as file: + with open(tmp, mode='wb', buffering=0) as file: chunk_size = 64 * 1024 # 64 KB buffer = bytearray(chunk_size) view = memoryview(buffer) @@ -46,13 +46,13 @@ def main(): # Verify the compessed file if hashsum_file != hashsum.hexdigest(): - log.warn(f"Digest mismatch: {arc}") + log.warn(f'Digest mismatch: {arc}') log.warn(f"Expected '{hashsum_file}', skipping...") return # Write xaudio2_8.dll to the game directory # NOTE: The file is actually xaudio2_9.dll from winetricks but renamed log.info("Applying fix for 'Full Metal Daemon Muramasa'...") - with gzip_open(tmp, "rb") as reader: - with open(path_dll, "wb") as writer: + with gzip_open(tmp, 'rb') as reader: + with open(path_dll, 'wb') as writer: writer.write(reader.read()) diff --git a/gamefixes-gog/umu-1228964594.py b/gamefixes-gog/umu-1228964594.py index a169c35d..c7781362 100644 --- a/gamefixes-gog/umu-1228964594.py +++ b/gamefixes-gog/umu-1228964594.py @@ -1,10 +1,9 @@ -""" Game fix for Soldier of Fortune II: Double Helix - Gold Edition -""" -#pylint: disable=C0103 +"""Game fix for Soldier of Fortune II: Double Helix - Gold Edition""" from protonfixes import util -def main(): + +def main() -> None: # Fix display issues util.set_environment('MESA_EXTENSION_MAX_YEAR', '2003') util.set_environment('__GL_ExtensionStringVersion', '17700') diff --git a/gamefixes-gog/umu-1564851593.py b/gamefixes-gog/umu-1564851593.py index 4d519563..d3af0bfb 100644 --- a/gamefixes-gog/umu-1564851593.py +++ b/gamefixes-gog/umu-1564851593.py @@ -14,19 +14,19 @@ from protonfixes.logger import log # Archive containing the text injecting framework -arc = "https://github.com/user-attachments/files/16136393/d3d9-2206220222.zip" +arc = 'https://github.com/user-attachments/files/16136393/d3d9-2206220222.zip' # Digest of the archive, d3d9.dll proxy and JSON -hashsum_arc = "caed98ec44d4270290f0652502344a40c1d45216caa8935b41e7d9f461ae2d24" -hashsum_d3d9 = "17e1c6706c684b19d05e89b588ba5101bf3ee40429cecf803c6e98af9b342129" -hashsum_config = "aecb441fdc9c9e2ba78df63dfbe14f48c31dfd5ad571adba988ba362fc814377" +hashsum_arc = 'caed98ec44d4270290f0652502344a40c1d45216caa8935b41e7d9f461ae2d24' +hashsum_d3d9 = '17e1c6706c684b19d05e89b588ba5101bf3ee40429cecf803c6e98af9b342129' +hashsum_config = 'aecb441fdc9c9e2ba78df63dfbe14f48c31dfd5ad571adba988ba362fc814377' -def main(): # pylint: disable=R0914 - tmp = f"{mkdtemp()}/d3d9-2206220222.zip" +def main() -> None: + tmp = f'{mkdtemp()}/d3d9-2206220222.zip' install_dir = util.get_game_install_path() - path_config = f"{install_dir}/config.json" - path_dll = f"{install_dir}/d3d9.dll" + path_config = f'{install_dir}/config.json' + path_dll = f'{install_dir}/d3d9.dll' hashsum = sha256() # Ensure that the text injection files do not already exist before opening @@ -36,8 +36,8 @@ def main(): # pylint: disable=R0914 ) return - config = open(path_config, mode="rb") # pylint: disable=R1732 - dll = open(path_dll, mode="rb") # pylint: disable=R1732 + config = open(path_config, mode='rb') + dll = open(path_dll, mode='rb') # Check if the text injection framework files have already been replaced if ( @@ -57,10 +57,10 @@ def main(): # pylint: disable=R0914 # Download the archive with urlopen(arc, timeout=30) as resp: if resp.status != 200: - log.warn(f"github returned the status code: {resp.status}") + log.warn(f'github returned the status code: {resp.status}') return - with open(tmp, mode="wb", buffering=0) as file: + with open(tmp, mode='wb', buffering=0) as file: chunk_size = 64 * 1024 # 64 KB buffer = bytearray(chunk_size) view = memoryview(buffer) @@ -70,7 +70,7 @@ def main(): # pylint: disable=R0914 hashsum.update(view[:size]) if hashsum_arc != hashsum.hexdigest(): - log.warn(f"Digest mismatch: {arc}") + log.warn(f'Digest mismatch: {arc}') log.warn(f"Expected '{hashsum_arc}', skipping...") return @@ -82,10 +82,10 @@ def main(): # pylint: disable=R0914 randstr = os.urandom(16).hex() log.info(f"Renaming 'config.json' -> '.{randstr}.config.json.bak'") log.info(f"Renaming 'd3d9.dll' -> '.{randstr}.d3d9.dll.bak'") - os.rename(path_config, f"{install_dir}/.{randstr}.config.json.bak") - os.rename(path_dll, f"{install_dir}/.{randstr}.d3d9.dll.bak") + os.rename(path_config, f'{install_dir}/.{randstr}.config.json.bak') + os.rename(path_dll, f'{install_dir}/.{randstr}.d3d9.dll.bak') - with ZipFile(tmp, mode="r") as zipfile: + with ZipFile(tmp, mode='r') as zipfile: log.info("Fixing in-game font for 'Flowers - Le Volume Sur Hiver'...") zipfile.extractall(install_dir) diff --git a/gamefixes-gog/umu-1580232252.py b/gamefixes-gog/umu-1580232252.py index de63003b..73a807af 100644 --- a/gamefixes-gog/umu-1580232252.py +++ b/gamefixes-gog/umu-1580232252.py @@ -1,9 +1,8 @@ -""" Resident Evil (1997) -""" -#pylint: disable=C0103 +"""Resident Evil (1997)""" from protonfixes import util -def main(): + +def main() -> None: util.winedll_override('ddraw', 'n,b') util.winedll_override('dinput', 'n,b') diff --git a/gamefixes-gog/umu-22610.py b/gamefixes-gog/umu-22610.py index 362f774e..89eab7b9 100755 --- a/gamefixes-gog/umu-22610.py +++ b/gamefixes-gog/umu-22610.py @@ -1,8 +1,7 @@ -""" Alien Breed: Impact -""" -#pylint: disable=C0103 +"""Alien Breed: Impact""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('physx') diff --git a/gamefixes-gog/umu-22650.py b/gamefixes-gog/umu-22650.py index 453d1650..6a74adbc 100755 --- a/gamefixes-gog/umu-22650.py +++ b/gamefixes-gog/umu-22650.py @@ -1,8 +1,7 @@ -""" Alien Breed 2: Assault -""" -#pylint: disable=C0103 +"""Alien Breed 2: Assault""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('physx') diff --git a/gamefixes-gog/umu-22670.py b/gamefixes-gog/umu-22670.py index ecfd7673..550226ed 100755 --- a/gamefixes-gog/umu-22670.py +++ b/gamefixes-gog/umu-22670.py @@ -1,8 +1,7 @@ -""" Alien Breed 3: Descent -""" -#pylint: disable=C0103 +"""Alien Breed 3: Descent""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('physx') diff --git a/gamefixes-gog/umu-metalgearsolid.py b/gamefixes-gog/umu-metalgearsolid.py index dd53adeb..35a3b092 100644 --- a/gamefixes-gog/umu-metalgearsolid.py +++ b/gamefixes-gog/umu-metalgearsolid.py @@ -1,14 +1,9 @@ -""" -METAL GEAR SOLID -""" -#pylint: disable=C0103 +"""METAL GEAR SOLID""" from protonfixes import util -def main(): - """ - override for wrapper shipped with the game - """ +def main() -> None: + """Override for wrapper shipped with the game""" util.winedll_override('ddraw', 'n,b') util.winedll_override('dinput', 'n,b') diff --git a/gamefixes-gog/umu-silenthill4.py b/gamefixes-gog/umu-silenthill4.py index 383826c2..b3773a89 100644 --- a/gamefixes-gog/umu-silenthill4.py +++ b/gamefixes-gog/umu-silenthill4.py @@ -1,11 +1,13 @@ -""" -Silent Hill 4: The Room -""" -#pylint: disable=C0103 +"""Silent Hill 4: The Room""" from protonfixes import util -def main(): - util.winedll_override('d3d8', 'n,b') # GOG's dxcfg / Steam006 fixes - util.winedll_override('dinput8', 'n,b') # GOG's controller fix / Silent Hill 4: Wrapper by Nemesis / ThirteenAG's widescreen fix - util.winedll_override('dsound', 'n,b') # Ultimate ASI Loader / Silent Hill 4 Randomizer + +def main() -> None: + util.winedll_override('d3d8', 'n,b') # GOG's dxcfg / Steam006 fixes + util.winedll_override( + 'dinput8', 'n,b' + ) # GOG's controller fix / Silent Hill 4: Wrapper by Nemesis / ThirteenAG's widescreen fix + util.winedll_override( + 'dsound', 'n,b' + ) # Ultimate ASI Loader / Silent Hill 4 Randomizer diff --git a/gamefixes-gog/umu-wheeloftime.py b/gamefixes-gog/umu-wheeloftime.py index f26b18aa..92bb09e6 100644 --- a/gamefixes-gog/umu-wheeloftime.py +++ b/gamefixes-gog/umu-wheeloftime.py @@ -1,9 +1,7 @@ -""" -The Wheel of Time -""" -#pylint: disable=C0103 +"""The Wheel of Time""" from protonfixes import util -def main(): - util.winedll_override('ddraw', 'n,b') # GOG's dxcfg + +def main() -> None: + util.winedll_override('ddraw', 'n,b') # GOG's dxcfg diff --git a/gamefixes-steam/1017900.py b/gamefixes-steam/1017900.py index a43f94b6..96769711 100755 --- a/gamefixes-steam/1017900.py +++ b/gamefixes-steam/1017900.py @@ -1,12 +1,9 @@ -""" Game fix for Age of Empires: DE -""" -#pylint: disable=C0103 +"""Game fix for Age of Empires: DE""" from protonfixes import util -def main(): - """ Changes the proton argument from the launcher to the game - """ +def main() -> None: + """Changes the proton argument from the launcher to the game""" # Replace launcher with game exe in proton arguments util.append_argument('-NoStartup') diff --git a/gamefixes-steam/10220.py b/gamefixes-steam/10220.py index a7268e7b..d03180b9 100644 --- a/gamefixes-steam/10220.py +++ b/gamefixes-steam/10220.py @@ -1,12 +1,11 @@ -""" Postal III -""" -#pylint: disable=C0103 +"""Postal III""" from protonfixes import util + # Missing fonts for console and various UI # grep -rh --include "*.res" '"name"' . | awk -F '"' '{print $4}' | awk '!visited[$0]++' -def main(): +def main() -> None: util.protontricks('lucida') util.protontricks('courier') util.protontricks('verdana') diff --git a/gamefixes-steam/1030830.py b/gamefixes-steam/1030830.py index ee501d78..92b20929 100755 --- a/gamefixes-steam/1030830.py +++ b/gamefixes-steam/1030830.py @@ -1,10 +1,8 @@ -""" Game fix for Mafia II Definitive Edition -""" -#pylint: disable=C0103 +"""Game fix for Mafia II Definitive Edition""" from protonfixes import util -def main(): - """ Enable NVIDIA PhysX support. - """ + +def main() -> None: + """Enable NVIDIA PhysX support.""" util.protontricks('physx') diff --git a/gamefixes-steam/105000.py b/gamefixes-steam/105000.py index 30668144..c9e51c8e 100755 --- a/gamefixes-steam/105000.py +++ b/gamefixes-steam/105000.py @@ -1,10 +1,10 @@ -""" A New Beginning - Final Cut +"""A New Beginning - Final Cut https://github.com/ValveSoftware/Proton/issues/1412 -No cutscene audio in Daedalic Games (Memoria, The Night of the Rabbit, A New Beginning - Final Cut) (105000 230820 243200) #1412 +No cutscene audio in Daedalic Games (Memoria, The Night of the Rabbit, A New Beginning - Final Cut) (105000 230820 243200) #1412 """ -#pylint: disable=C0103 from protonfixes import util -def main(): + +def main() -> None: util.winedll_override('xaudio2_7', 'd') diff --git a/gamefixes-steam/105400.py b/gamefixes-steam/105400.py index 3d4e9161..04e41679 100755 --- a/gamefixes-steam/105400.py +++ b/gamefixes-steam/105400.py @@ -1,7 +1,4 @@ -""" Game fix for Fable III -""" - -#pylint: disable=C0103 +"""Game fix for Fable III""" import os import shutil @@ -10,12 +7,19 @@ from protonfixes.logger import log -def main(): +def main() -> None: # https://www.reddit.com/r/SteamDeck/comments/vuagy2/finally_got_fable_3_working/ util.protontricks('xliveless') # Remove Windows Live folder - dirpath = os.path.join(util.protonprefix(),"drive_c","Program Files","Common Files","Microsoft Shared","Windows Live") + dirpath = os.path.join( + util.protonprefix(), + 'drive_c', + 'Program Files', + 'Common Files', + 'Microsoft Shared', + 'Windows Live', + ) if os.path.exists(dirpath): shutil.rmtree(dirpath) else: diff --git a/gamefixes-steam/105450.py b/gamefixes-steam/105450.py index 45ee0705..107582c4 100755 --- a/gamefixes-steam/105450.py +++ b/gamefixes-steam/105450.py @@ -1,13 +1,10 @@ -""" Game fix for Age Of Empire 3: Complete Collection -""" -#pylint: disable=C0103 +"""Game fix for Age Of Empire 3: Complete Collection""" from protonfixes import util -def main(): - """ installs corefonts, l3codecx, mfc42, winxp - """ +def main() -> None: + """Installs corefonts, l3codecx, mfc42, winxp""" # https://github.com/ValveSoftware/Proton/issues/17#issuecomment-415977510 util.protontricks('mfc42') util.protontricks('l3codecx') diff --git a/gamefixes-steam/1056640.py b/gamefixes-steam/1056640.py index 07c82681..c5b48384 100755 --- a/gamefixes-steam/1056640.py +++ b/gamefixes-steam/1056640.py @@ -1,8 +1,7 @@ -""" Game fix for Phantasy Star Online 2 -""" -#pylint: disable=C0103 +"""Game fix for Phantasy Star Online 2""" from protonfixes import util -def main(): - util.set_environment('WINE_NO_OPEN_FILE_SEARCH','pso2_bin/data') + +def main() -> None: + util.set_environment('WINE_NO_OPEN_FILE_SEARCH', 'pso2_bin/data') diff --git a/gamefixes-steam/1062040.py b/gamefixes-steam/1062040.py index c2bd94ca..c15695cb 100755 --- a/gamefixes-steam/1062040.py +++ b/gamefixes-steam/1062040.py @@ -1,11 +1,9 @@ -""" Dragon Star Varnir -""" -#pylint: disable=C0103 +"""Dragon Star Varnir""" + from protonfixes import util -def main(): - """ Dragon Star Varnir fix - """ +def main() -> None: + """Dragon Star Varnir fix""" # Fixes the startup process. util.winedll_override('xactengine3_7', 'n') diff --git a/gamefixes-steam/1063730.py b/gamefixes-steam/1063730.py index 5bccd02e..489f41c1 100755 --- a/gamefixes-steam/1063730.py +++ b/gamefixes-steam/1063730.py @@ -1,11 +1,9 @@ -""" Game fix for New World -""" -#pylint: disable=C0103 +"""Game fix for New World""" from protonfixes import util -def main(): - """ Needs core count limit - """ + +def main() -> None: + """Needs core count limit""" # Fix the startup process: util.set_cpu_topology_limit(12) diff --git a/gamefixes-steam/108710.py b/gamefixes-steam/108710.py index 14c7a550..6f03704b 100755 --- a/gamefixes-steam/108710.py +++ b/gamefixes-steam/108710.py @@ -1,12 +1,9 @@ -""" Alan Wake -""" +"""Alan Wake""" from protonfixes import util -def main(): - """ Installs d3dcompiler_47 - """ - +def main() -> None: + """Installs d3dcompiler_47""" # Fixes error on launch util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/1097150.py b/gamefixes-steam/1097150.py index 72cedfad..e955bafd 100755 --- a/gamefixes-steam/1097150.py +++ b/gamefixes-steam/1097150.py @@ -1,10 +1,9 @@ -""" Game fix for Fall Guys -""" -#pylint: disable=C0103 +"""Game fix for Fall Guys""" + from protonfixes import util -def main(): - """ Create symlink of eac so at the right location - """ + +def main() -> None: + """Create symlink of eac so at the right location""" util.install_eac_runtime() util.set_environment('DOTNET_BUNDLE_EXTRACT_BASE_DIR', '') diff --git a/gamefixes-steam/1097880.py b/gamefixes-steam/1097880.py index b8e6d082..e64f9b87 100755 --- a/gamefixes-steam/1097880.py +++ b/gamefixes-steam/1097880.py @@ -1,13 +1,10 @@ -""" Game fix for Super Naughty Maid 2 -""" +"""Game fix for Super Naughty Maid 2""" from protonfixes import util -def main(): - """ installs quartz, wmp9 - """ - +def main() -> None: + """Installs quartz, wmp9""" # The whole game is only videos and require wmp9 & quartz util.protontricks('quartz') - util.protontricks("wmp9") + util.protontricks('wmp9') diff --git a/gamefixes-steam/1105510.py b/gamefixes-steam/1105510.py index 8f6624c3..a7f790ce 100755 --- a/gamefixes-steam/1105510.py +++ b/gamefixes-steam/1105510.py @@ -1,9 +1,8 @@ -""" Game fix for Yakuza 5 -""" -#pylint: disable=C0103 +"""Game fix for Yakuza 5""" + from protonfixes import util -def main(): - """ Needs WINE_DISABLE_SFN set from this patch: https://github.com/ValveSoftware/wine/pull/205 - """ + +def main() -> None: + """Needs WINE_DISABLE_SFN set from this patch: https://github.com/ValveSoftware/wine/pull/205""" util.set_environment('WINE_DISABLE_SFN', '1') diff --git a/gamefixes-steam/110800.py b/gamefixes-steam/110800.py index bc6fdc61..f3cbdf61 100755 --- a/gamefixes-steam/110800.py +++ b/gamefixes-steam/110800.py @@ -1,14 +1,12 @@ -""" Game fix for L.A. Noire -""" -#pylint: disable=C0103 +"""Game fix for L.A. Noire""" from protonfixes import util -def main(): - """ installs d3dx9_43, d3dcompiler_43, d3dx11_43, d3dcompiler_47 - forces dx11 (enables intro cinematics) without editing settings.ini - """ +def main() -> None: + """Installs d3dx9_43, d3dcompiler_43, d3dx11_43, d3dcompiler_47 + forces dx11 (enables intro cinematics) without editing settings.ini + """ # https://github.com/ValveSoftware/Proton/issues/544#issuecomment-826150012 util.protontricks('d3dx9_43') util.protontricks('d3dcompiler_43') diff --git a/gamefixes-steam/1113000.py b/gamefixes-steam/1113000.py index 6d3ee113..c83f2ca1 100644 --- a/gamefixes-steam/1113000.py +++ b/gamefixes-steam/1113000.py @@ -1,10 +1,9 @@ -""" Game fix for Persona 4 Golden -""" -#pylint: disable=C0103 +"""Game fix for Persona 4 Golden""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('d3dx11_43') util.protontricks('wmp9') util.protontricks('klite') diff --git a/gamefixes-steam/1121560.py b/gamefixes-steam/1121560.py index 341aaddd..5c690b97 100755 --- a/gamefixes-steam/1121560.py +++ b/gamefixes-steam/1121560.py @@ -1,11 +1,10 @@ -""" Atelier Ryza: Ever Darkness & the Secret Hideout +"""Atelier Ryza: Ever Darkness & the Secret Hideout Missing voices/sounds in cutscenes Requires disabling the gstreamer protonaudioconverterbin plugin to get full audio in cutscenes """ -#pylint: disable=C0103 - from protonfixes import util -def main(): + +def main() -> None: util.disable_protonmediaconverter() diff --git a/gamefixes-steam/1151640.py b/gamefixes-steam/1151640.py index 70bfeb0c..fe4a2007 100755 --- a/gamefixes-steam/1151640.py +++ b/gamefixes-steam/1151640.py @@ -1,11 +1,10 @@ -""" Game fix for Horizon Zero Dawn -""" -#pylint: disable=C0103 +"""Game fix for Horizon Zero Dawn""" from protonfixes import util -def main(): + +def main() -> None: # C++ runtime is not provided in the manifest util.protontricks('vcrun2019') # Set SteamGameId so that non-steam versions can pick up steam-specific fixes in proton's wine code - util.set_environment('SteamGameId','1151640') + util.set_environment('SteamGameId', '1151640') diff --git a/gamefixes-steam/1158850.py b/gamefixes-steam/1158850.py index 86576335..d3e2e28f 100755 --- a/gamefixes-steam/1158850.py +++ b/gamefixes-steam/1158850.py @@ -1,12 +1,10 @@ -""" The Great Ace Attorney Chronicles +"""The Great Ace Attorney Chronicles Missing sound in bonus content videos Requires disabling the gstreamer protonaudioconverterbin to get full audio """ -# pylint: disable=C0103 - from protonfixes import util -def main(): +def main() -> None: util.disable_protonmediaconverter() diff --git a/gamefixes-steam/1174180.py b/gamefixes-steam/1174180.py index 04f98b86..365c4f92 100755 --- a/gamefixes-steam/1174180.py +++ b/gamefixes-steam/1174180.py @@ -1,11 +1,10 @@ -""" Game fix for Red Dead Redemption 2 -""" -#pylint: disable=C0103 +"""Game fix for Red Dead Redemption 2""" + from protonfixes import util -def main(): - """ Sometimes game will not launch if -fullscreen -vulkan is not specified - """ + +def main() -> None: + """Sometimes game will not launch if -fullscreen -vulkan is not specified""" util.append_argument('-fullscreen -vulkan') # Set SteamGameId so that non-steam versions can pick up steam-specific fixes in proton's wine code - util.set_environment('SteamGameId','1174180') + util.set_environment('SteamGameId', '1174180') diff --git a/gamefixes-steam/1175730.py b/gamefixes-steam/1175730.py index 00ba5352..7654828a 100755 --- a/gamefixes-steam/1175730.py +++ b/gamefixes-steam/1175730.py @@ -1,10 +1,8 @@ -""" Game fix Tree Of Savior -""" -#pylint: disable=C0103 +"""Game fix Tree Of Savior""" from protonfixes import util -def main(): - """ https://forum.treeofsavior.com/t/linux-the-graphic-card-does-not-support-directx11-13ep/418073/13 - """ + +def main() -> None: + """https://forum.treeofsavior.com/t/linux-the-graphic-card-does-not-support-directx11-13ep/418073/13""" util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/12200.py b/gamefixes-steam/12200.py index 2145393e..0b5a6b9a 100644 --- a/gamefixes-steam/12200.py +++ b/gamefixes-steam/12200.py @@ -1,11 +1,10 @@ - -""" Game fix for Bully: Scholarship Edition -""" +"""Game fix for Bully: Scholarship Edition""" from protonfixes import util -def main(): - """ Video playback is working since GE-Proton 9.11 - without audio - Disabling the media converter fixes this issue + +def main() -> None: + """Video playback is working since GE-Proton 9.11 - without audio + Disabling the media converter fixes this issue """ util.disable_protonmediaconverter() diff --git a/gamefixes-steam/12210.py b/gamefixes-steam/12210.py index cf0912de..4092da88 100755 --- a/gamefixes-steam/12210.py +++ b/gamefixes-steam/12210.py @@ -1,11 +1,9 @@ -""" Game fix for GTA IV -""" -#pylint: disable=C0103 +"""Game fix for GTA IV""" from protonfixes import util -def main(): - """ installs wmp11 - """ + +def main() -> None: + """Installs wmp11""" # Fixes Independence FM user radio station util.protontricks('wmp11') diff --git a/gamefixes-steam/1222370.py b/gamefixes-steam/1222370.py index 4fcf1376..6f34efc9 100755 --- a/gamefixes-steam/1222370.py +++ b/gamefixes-steam/1222370.py @@ -1,8 +1,9 @@ -""" Necromunda: Hired Gun -""" -#pylint: disable=C0103 +"""Necromunda: Hired Gun""" from protonfixes import util -def main(): - util.replace_command('Necromunda.exe', 'Necromunda/Binaries/Win64/Necromunda-Win64-Shipping.exe') + +def main() -> None: + util.replace_command( + 'Necromunda.exe', 'Necromunda/Binaries/Win64/Necromunda-Win64-Shipping.exe' + ) diff --git a/gamefixes-steam/1222690.py b/gamefixes-steam/1222690.py index c2ce6773..a2c2a7c5 100755 --- a/gamefixes-steam/1222690.py +++ b/gamefixes-steam/1222690.py @@ -1,10 +1,9 @@ -""" Game fix for Dragon Age Inquisition -""" -#pylint: disable=C0103 +"""Game fix for Dragon Age Inquisition""" + from protonfixes import util -def main(): - """ Has Xinput patch in proton-wine - """ + +def main() -> None: + """Has Xinput patch in proton-wine""" # Set SteamGameId so that non-steam versions can pick up steam-specific fixes in proton's wine code - util.set_environment('SteamGameId','1222690') + util.set_environment('SteamGameId', '1222690') diff --git a/gamefixes-steam/1230140.py b/gamefixes-steam/1230140.py index 84230527..c63450c9 100755 --- a/gamefixes-steam/1230140.py +++ b/gamefixes-steam/1230140.py @@ -3,8 +3,8 @@ from protonfixes import util -def main(): +def main() -> None: # Fix in-game media playback # See https://github.com/Open-Wine-Components/umu-protonfixes/issues/111#issuecomment-2317389123 util.disable_protonmediaconverter() - util.append_argument("-vomstyle=overlay") + util.append_argument('-vomstyle=overlay') diff --git a/gamefixes-steam/1237970.py b/gamefixes-steam/1237970.py index d781409e..e089e70c 100755 --- a/gamefixes-steam/1237970.py +++ b/gamefixes-steam/1237970.py @@ -1,15 +1,13 @@ -""" Game fix for Titanfall 2 -""" -#pylint: disable=C0103 +"""Game fix for Titanfall 2""" import os import subprocess import glob from protonfixes import util -def main(): - """ Allow -northstar option to work - """ + +def main() -> None: + """Allow -northstar option to work""" # Define game directory install_dir = glob.escape(util.get_game_install_path()) diff --git a/gamefixes-steam/1239520.py b/gamefixes-steam/1239520.py index 985c3cb4..385c1f42 100755 --- a/gamefixes-steam/1239520.py +++ b/gamefixes-steam/1239520.py @@ -1,9 +1,8 @@ -""" Madden NFL 21 needs vcrun2019 for online mode to work -""" -#pylint: disable=C0103 +"""Madden NFL 21 needs vcrun2019 for online mode to work""" from protonfixes import util -def main(): + +def main() -> None: # Replace launcher with game exe in proton arguments util.protontricks('vcrun2019') diff --git a/gamefixes-steam/1240440.py b/gamefixes-steam/1240440.py index e29eb779..05d57484 100755 --- a/gamefixes-steam/1240440.py +++ b/gamefixes-steam/1240440.py @@ -1,8 +1,7 @@ -""" Halo Infinite needs vcrun2019 -""" -#pylint: disable=C0103 +"""Halo Infinite needs vcrun2019""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('vcrun2019') diff --git a/gamefixes-steam/1245620.py b/gamefixes-steam/1245620.py index eaccc31e..a4b0f367 100644 --- a/gamefixes-steam/1245620.py +++ b/gamefixes-steam/1245620.py @@ -4,7 +4,7 @@ from protonfixes import util -def main(): +def main() -> None: # Create the DLC.bdt file if it doesn't already exist, which is known to fix Easy AntiCheat not working for players that don't own the DLC # A blank file is enough to get multiplayer working - Path(f"{util.get_game_install_path()}/Game/DLC.bdt").touch(exist_ok=True) + Path(f'{util.get_game_install_path()}/Game/DLC.bdt').touch(exist_ok=True) diff --git a/gamefixes-steam/1250410.py b/gamefixes-steam/1250410.py index a7177ff2..1661befe 100755 --- a/gamefixes-steam/1250410.py +++ b/gamefixes-steam/1250410.py @@ -1,12 +1,9 @@ -""" Game fix for Flight Simulator 2020 -""" -#pylint: disable=C0103 +"""Game fix for Flight Simulator 2020""" from protonfixes import util -def main(): - """ Needs fastlaunch option - """ +def main() -> None: + """Needs fastlaunch option""" # Fixes the startup process. util.append_argument('-FastLaunch') diff --git a/gamefixes-steam/1257290.py b/gamefixes-steam/1257290.py index 3d22d088..3ed9215a 100755 --- a/gamefixes-steam/1257290.py +++ b/gamefixes-steam/1257290.py @@ -1,11 +1,10 @@ -""" Atelier Ryza 2: Lost Legends & the Secret Fairy +"""Atelier Ryza 2: Lost Legends & the Secret Fairy Missing voices/sounds in cutscenes Requires disabling the gstreamer protonaudioconverterbin plugin to get full audio in cutscenes """ -#pylint: disable=C0103 - from protonfixes import util -def main(): + +def main() -> None: util.disable_protonmediaconverter() diff --git a/gamefixes-steam/1259970.py b/gamefixes-steam/1259970.py index 5574c5bf..2a5f98d2 100755 --- a/gamefixes-steam/1259970.py +++ b/gamefixes-steam/1259970.py @@ -1,10 +1,9 @@ -""" Game fix for Pes 2021 -""" -#pylint: disable=C0103 +"""Game fix for Pes 2021""" from protonfixes import util -def main(): + +def main() -> None: # Replace launcher with game exe in proton arguments util.protontricks('vcrun2019') util.protontricks('allfonts') diff --git a/gamefixes-steam/1272580.py b/gamefixes-steam/1272580.py index 60554a79..8aa3bdf4 100644 --- a/gamefixes-steam/1272580.py +++ b/gamefixes-steam/1272580.py @@ -1,9 +1,9 @@ -""" Nine Witches: Family Disruption +"""Nine Witches: Family Disruption No music """ -#pylint: disable=C0103 from protonfixes import util -def main(): + +def main() -> None: util.disable_protonmediaconverter() diff --git a/gamefixes-steam/1277510.py b/gamefixes-steam/1277510.py index f64e61dd..9ee0abd9 100644 --- a/gamefixes-steam/1277510.py +++ b/gamefixes-steam/1277510.py @@ -1,8 +1,7 @@ -""" Game fix for Re:ZERO -Starting Life in Another World- The Prophecy of the Throne -""" -#pylint: disable=C0103 +"""Game fix for Re:ZERO -Starting Life in Another World- The Prophecy of the Throne""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/1277930.py b/gamefixes-steam/1277930.py index 94d3674f..ef21840f 100644 --- a/gamefixes-steam/1277930.py +++ b/gamefixes-steam/1277930.py @@ -3,8 +3,6 @@ from protonfixes import util -def main(): - """ - Fixes in-game video playback for the intro and ending. - """ +def main() -> None: + """Fixes in-game video playback for the intro and ending.""" util.disable_protonmediaconverter() diff --git a/gamefixes-steam/12810.py b/gamefixes-steam/12810.py index f343ba4d..b56db721 100644 --- a/gamefixes-steam/12810.py +++ b/gamefixes-steam/12810.py @@ -1,8 +1,7 @@ -""" Overlord II -""" -#pylint: disable=C0103 +"""Overlord II""" from protonfixes import util -def main(): - util.protontricks('physx') # Game crashes without it + +def main() -> None: + util.protontricks('physx') # Game crashes without it diff --git a/gamefixes-steam/12840.py b/gamefixes-steam/12840.py index f3e8e2b0..b039db84 100755 --- a/gamefixes-steam/12840.py +++ b/gamefixes-steam/12840.py @@ -1,11 +1,8 @@ -""" Game fix for Dirt 2 -""" +"""Game fix for Dirt 2""" from protonfixes import util -def main(): - """ This game uses GFWL, which causes it to fail to launch. xliveless is needed to get this working. - """ - +def main() -> None: + """This game uses GFWL, which causes it to fail to launch. xliveless is needed to get this working.""" util.protontricks('xliveless') diff --git a/gamefixes-steam/1284210.py b/gamefixes-steam/1284210.py index 862c4302..8368bb2f 100755 --- a/gamefixes-steam/1284210.py +++ b/gamefixes-steam/1284210.py @@ -1,13 +1,11 @@ -""" Game fix for Guild Wars 2 -""" -#pylint: disable=C0103 +"""Game fix for Guild Wars 2""" import os from protonfixes import util -def main(): - """ GW2 add NOSTEAM option. - """ + +def main() -> None: + """GW2 add NOSTEAM option.""" # Fixes the startup process. if 'NOSTEAM' in os.environ: util.replace_command('-provider', '') diff --git a/gamefixes-steam/1284410.py b/gamefixes-steam/1284410.py index f9c0b4f8..f8acc85e 100755 --- a/gamefixes-steam/1284410.py +++ b/gamefixes-steam/1284410.py @@ -1,16 +1,14 @@ -""" GWENT: The Witcher Card Game -""" -#pylint: disable=C0103 +"""GWENT: The Witcher Card Game""" from protonfixes import util -def main(): - """ installs mfc140 + +def main() -> None: + """Installs mfc140 mfc140 is necessary to start the game up. GOG login happens inside the Steam overlay. vcrun2019 enables full support of the prelauncher interface. GOG login inside the prelauncher. This prelauncher is not necessary for the Game. If only mfc is present, it's skipped. """ - util.protontricks('mfc140') diff --git a/gamefixes-steam/1286880.py b/gamefixes-steam/1286880.py index f9e831ec..e46ac5cf 100755 --- a/gamefixes-steam/1286880.py +++ b/gamefixes-steam/1286880.py @@ -1,11 +1,8 @@ -""" Ship Graveyard Simulator -""" -#pylint: disable=C0103 +"""Ship Graveyard Simulator""" from protonfixes import util -def main(): - """ needs builtin vulkan-1 - """ +def main() -> None: + """Needs builtin vulkan-1""" util.winedll_override('vulkan-1', 'b') diff --git a/gamefixes-steam/1293820.py b/gamefixes-steam/1293820.py index b47a41f8..ebf830c7 100755 --- a/gamefixes-steam/1293820.py +++ b/gamefixes-steam/1293820.py @@ -1,12 +1,10 @@ -""" Game fix for YOU and ME and HER: A Love Story -""" +"""Game fix for YOU and ME and HER: A Love Story""" from protonfixes import util -def main(): - """ install xact, disable esync, disable fsync - """ +def main() -> None: + """Install xact, disable esync, disable fsync""" # Fixes the game from crashing or hanging during intro util.protontricks('xact') util.disable_esync() diff --git a/gamefixes-steam/1293830.py b/gamefixes-steam/1293830.py index 6c4b479e..b63afbac 100755 --- a/gamefixes-steam/1293830.py +++ b/gamefixes-steam/1293830.py @@ -1,9 +1,8 @@ -""" Forza Horizon 4 -""" -#pylint: disable=C0103 +"""Forza Horizon 4""" from protonfixes import util -def main(): + +def main() -> None: # Replace launcher with game exe in proton arguments util.protontricks('vcrun2019') diff --git a/gamefixes-steam/1382330.py b/gamefixes-steam/1382330.py index 4b905ba3..98166b77 100755 --- a/gamefixes-steam/1382330.py +++ b/gamefixes-steam/1382330.py @@ -1,11 +1,11 @@ -""" Persona 5 Strikers +"""Persona 5 Strikers Missing voices/sounds in cutscenes Requires disabling the gstreamer protonaudioconverterbin plugin to get full audio in cutscenes. fixed by Swish in Protondb """ -#pylint: disable=C0103 from protonfixes import util -def main(): + +def main() -> None: util.disable_protonmediaconverter() diff --git a/gamefixes-steam/1413480.py b/gamefixes-steam/1413480.py index 40e16129..d5215806 100755 --- a/gamefixes-steam/1413480.py +++ b/gamefixes-steam/1413480.py @@ -1,11 +1,11 @@ -""" Shin Megami Tensei III Nocturne HD Remaster +"""Shin Megami Tensei III Nocturne HD Remaster Missing voices/sounds in cutscenes Requires disabling the gstreamer protonaudioconverterbin plugin to get full audio in cutscenes. fixed Persona 5 Strikers by Swish in Protondb """ -#pylint: disable=C0103 from protonfixes import util -def main(): + +def main() -> None: util.disable_protonmediaconverter() diff --git a/gamefixes-steam/1434950.py b/gamefixes-steam/1434950.py index c4faf3b0..887f6b33 100755 --- a/gamefixes-steam/1434950.py +++ b/gamefixes-steam/1434950.py @@ -1,12 +1,10 @@ -""" Game fix HighFleet -""" -#pylint: disable=C0103 +"""Game fix HighFleet""" + # from protonfixes import util -def main(): - """ installs d3dcompiler, d3dx11_43 - """ +def main() -> None: + """Installs d3dcompiler, d3dx11_43""" util.protontricks('d3dx11_43') util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/1449280.py b/gamefixes-steam/1449280.py index 695e0b17..681287f3 100755 --- a/gamefixes-steam/1449280.py +++ b/gamefixes-steam/1449280.py @@ -1,14 +1,14 @@ -""" Game fix for Ghostbusters: The Video Game Remastered (2019) -""" -#pylint: disable=C0103 +"""Game fix for Ghostbusters: The Video Game Remastered (2019)""" + from pathlib import Path from protonfixes import util from protonfixes.logger import log -def main(): + +def main() -> None: # This directory is required to make the game settings persistent # [source: https://www.pcgamingwiki.com/wiki/Ghostbusters:_The_Video_Game_Remastered#Game_settings_do_not_save] - save_dir = f"{util.protonprefix()}/drive_c/users/steamuser/Local Settings/Application Data/GHOSTBUSTERS" + save_dir = f'{util.protonprefix()}/drive_c/users/steamuser/Local Settings/Application Data/GHOSTBUSTERS' try: Path(save_dir).mkdir(parents=True, exist_ok=True) diff --git a/gamefixes-steam/1500540.py b/gamefixes-steam/1500540.py index d7fceaea..1b308c2e 100644 --- a/gamefixes-steam/1500540.py +++ b/gamefixes-steam/1500540.py @@ -1,9 +1,8 @@ -""" Hardwar -""" -#pylint: disable=C0103 +"""Hardwar""" from protonfixes import util -def main(): - util.winedll_override('dinput', 'n,b') # DxWrapper component - util.winedll_override('winmm', 'n,b') # Music playback + +def main() -> None: + util.winedll_override('dinput', 'n,b') # DxWrapper component + util.winedll_override('winmm', 'n,b') # Music playback diff --git a/gamefixes-steam/15130.py b/gamefixes-steam/15130.py index 793093d0..91546023 100755 --- a/gamefixes-steam/15130.py +++ b/gamefixes-steam/15130.py @@ -1,12 +1,10 @@ -""" Game fix for Beyond Good and Evil -""" -#pylint: disable=C0103 +"""Game fix for Beyond Good and Evil""" + from protonfixes import util -def main(): - """ installs dsound d3dx9 arial d3dcompiler_47 - """ +def main() -> None: + """Installs dsound d3dx9 arial d3dcompiler_47""" util.protontricks('dsound') util.protontricks('d3dx9') util.protontricks('arial') @@ -16,4 +14,9 @@ def main(): """ util.regedit_add('HKLM\\Software\\Wow6432Node\\Ubisoft') - util.regedit_add('HKLM\\Software\\Wow6432Node\\Ubisoft\\Beyond Good & Evil','InstallLanguage','REG_DWORD','1') + util.regedit_add( + 'HKLM\\Software\\Wow6432Node\\Ubisoft\\Beyond Good & Evil', + 'InstallLanguage', + 'REG_DWORD', + '1', + ) diff --git a/gamefixes-steam/1532190.py b/gamefixes-steam/1532190.py index 8bb88db7..80389b95 100755 --- a/gamefixes-steam/1532190.py +++ b/gamefixes-steam/1532190.py @@ -1,10 +1,9 @@ -""" Game fix for Halo CE mod tools -""" -#pylint: disable=C0103 +"""Game fix for Halo CE mod tools""" from protonfixes import util -def main(): + +def main() -> None: # Requires vcrun2019 to launch util.protontricks('vcrun2019') util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/1557480.py b/gamefixes-steam/1557480.py index a0d13516..a8d3d746 100755 --- a/gamefixes-steam/1557480.py +++ b/gamefixes-steam/1557480.py @@ -1,10 +1,8 @@ -""" Project MIKHAIL: A Muv-Luv War Story -""" -#pylint: disable=C0103 +"""Project MIKHAIL: A Muv-Luv War Story""" from protonfixes import util -def main(): - """ needs native d3dcompiler_47 - """ + +def main() -> None: + """Needs native d3dcompiler_47""" util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/15700.py b/gamefixes-steam/15700.py index 70e9bfad..fb14d390 100644 --- a/gamefixes-steam/15700.py +++ b/gamefixes-steam/15700.py @@ -1,8 +1,7 @@ -""" Oddworld: Abe's Oddysee -""" -#pylint: disable=C0103 +"""Oddworld: Abe's Oddysee""" from protonfixes import util -def main(): - util.protontricks('cnc_ddraw') # Videos are laggy without this + +def main() -> None: + util.protontricks('cnc_ddraw') # Videos are laggy without this diff --git a/gamefixes-steam/15740.py b/gamefixes-steam/15740.py index 83a3b737..80e5169d 100755 --- a/gamefixes-steam/15740.py +++ b/gamefixes-steam/15740.py @@ -1,11 +1,10 @@ -""" Game fix for Oddworld: Munch's Oddysee -""" -#pylint: disable=C0103 +"""Game fix for Oddworld: Munch's Oddysee""" from protonfixes import util -def main(): - """ klite to fix videos - prev version of this used devenum, quartz, wmp9 but that caused laggy intros + +def main() -> None: + """Klite to fix videos + prev version of this used devenum, quartz, wmp9 but that caused laggy intros """ util.protontricks('klite') diff --git a/gamefixes-steam/15750.py b/gamefixes-steam/15750.py index 3627b1ff..c98fb118 100644 --- a/gamefixes-steam/15750.py +++ b/gamefixes-steam/15750.py @@ -1,8 +1,7 @@ -""" Oddworld: Stranger's Wrath HD -""" -#pylint: disable=C0103 +"""Oddworld: Stranger's Wrath HD""" from protonfixes import util -def main(): - util.protontricks('mfc90') # The game crashes on launch without mfc90 + +def main() -> None: + util.protontricks('mfc90') # The game crashes on launch without mfc90 diff --git a/gamefixes-steam/1613450.py b/gamefixes-steam/1613450.py index dfb235f8..1e5c63d5 100755 --- a/gamefixes-steam/1613450.py +++ b/gamefixes-steam/1613450.py @@ -1,10 +1,9 @@ -""" Game fix for Halo 2 mod tools -""" -#pylint: disable=C0103 +"""Game fix for Halo 2 mod tools""" from protonfixes import util -def main(): + +def main() -> None: # Requires vcrun2019 to launch util.protontricks('vcrun2019') util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/1659420.py b/gamefixes-steam/1659420.py index ac493675..e77f07b6 100755 --- a/gamefixes-steam/1659420.py +++ b/gamefixes-steam/1659420.py @@ -1,12 +1,8 @@ -""" UNCHARTED: Legacy of Thieves Collection -""" -#pylint: disable=C0103 +"""UNCHARTED: Legacy of Thieves Collection""" from protonfixes import util -def main(): - """ The game chokes on more than 16 cores - """ - +def main() -> None: + """The game chokes on more than 16 cores""" util.set_cpu_topology_limit(16) diff --git a/gamefixes-steam/1664350.py b/gamefixes-steam/1664350.py index 31b7dd4e..3564490c 100755 --- a/gamefixes-steam/1664350.py +++ b/gamefixes-steam/1664350.py @@ -1,11 +1,8 @@ -""" Ship Graveyard Simulator Prologue -""" -#pylint: disable=C0103 +"""Ship Graveyard Simulator Prologue""" from protonfixes import util -def main(): - """ needs builtin vulkan-1 - """ +def main() -> None: + """Needs builtin vulkan-1""" util.winedll_override('vulkan-1', 'b') diff --git a/gamefixes-steam/16700.py b/gamefixes-steam/16700.py index eadc2477..4bccc52c 100755 --- a/gamefixes-steam/16700.py +++ b/gamefixes-steam/16700.py @@ -1,14 +1,10 @@ -""" Game fix for Stronghold Crusader Extreme HD +"""Game fix for Stronghold Crusader Extreme HD Fixes Multiplayer """ -# pylint: disable=C0103 - from protonfixes import util -def main(): - """ Installs directplay - """ - +def main() -> None: + """Installs directplay""" util.protontricks('directplay') diff --git a/gamefixes-steam/16810.py b/gamefixes-steam/16810.py index 12f286c0..44534d66 100755 --- a/gamefixes-steam/16810.py +++ b/gamefixes-steam/16810.py @@ -1,9 +1,9 @@ -""" Civilization IV: Colonization -""" +"""Civilization IV: Colonization""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('oleaut32') util.protontricks('msxml3') util.protontricks('corefonts') diff --git a/gamefixes-steam/1681970.py b/gamefixes-steam/1681970.py index c22c5297..6c767655 100755 --- a/gamefixes-steam/1681970.py +++ b/gamefixes-steam/1681970.py @@ -1,10 +1,9 @@ -""" 神都不良探 Underdog Detective -""" -#pylint: disable=C0103 +"""神都不良探 Underdog Detective""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('klite') util.winedll_override('winegstreamer', '') # it uses quartz instead of mfplat on win7 diff --git a/gamefixes-steam/1695791.py b/gamefixes-steam/1695791.py index 02e7e1de..ab2bd90e 100755 --- a/gamefixes-steam/1695791.py +++ b/gamefixes-steam/1695791.py @@ -1,10 +1,9 @@ -""" Game fix for Halo 3 mod tools -""" -#pylint: disable=C0103 +"""Game fix for Halo 3 mod tools""" from protonfixes import util -def main(): + +def main() -> None: # Requires vcrun2019 to launch util.protontricks('vcrun2019') util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/1695793.py b/gamefixes-steam/1695793.py index 5a9ffe90..b90867d2 100755 --- a/gamefixes-steam/1695793.py +++ b/gamefixes-steam/1695793.py @@ -1,11 +1,11 @@ -""" Game fix for the Halo Reach mod tools Foundation gamemode. +"""Game fix for the Halo Reach mod tools Foundation gamemode. Standalone and Sapien seem to work just fine without d3dcompiler_47 and msxml3, although might be required at some deeper level. I just playtested it. - Oro, @orowith2os """ -#pylint: disable=C0103 from protonfixes import util -def main(): + +def main() -> None: util.protontricks('dotnet35') util.protontricks('dotnet45') diff --git a/gamefixes-steam/1695794.py b/gamefixes-steam/1695794.py index 1db15416..5504496e 100755 --- a/gamefixes-steam/1695794.py +++ b/gamefixes-steam/1695794.py @@ -1,10 +1,9 @@ -""" Game fix Halo 3: ODST mod tools -""" -#pylint: disable=C0103 +"""Game fix Halo 3: ODST mod tools""" from protonfixes import util -def main(): + +def main() -> None: # Requires vcrun2019 to launch util.protontricks('vcrun2019') util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/1711950.py b/gamefixes-steam/1711950.py index c9313223..2baa86eb 100755 --- a/gamefixes-steam/1711950.py +++ b/gamefixes-steam/1711950.py @@ -1,16 +1,14 @@ -""" GWENT: Rogue Mage -""" -#pylint: disable=C0103 +"""GWENT: Rogue Mage""" from protonfixes import util -def main(): - """ installs mfc140 + +def main() -> None: + """Installs mfc140 mfc140 is necessary to start the game up. GOG login happens inside the Steam overlay. vcrun2019 enables full support of the prelauncher interface. GOG login inside the prelauncher. This prelauncher is not necessary for the Game. If only mfc is present, it's skipped. """ - util.protontricks('mfc140') diff --git a/gamefixes-steam/1715130.py b/gamefixes-steam/1715130.py index c1e8009d..cc774847 100755 --- a/gamefixes-steam/1715130.py +++ b/gamefixes-steam/1715130.py @@ -1,10 +1,9 @@ -""" Crysis Remastered -""" -#pylint: disable=C0103 +"""Crysis Remastered""" from protonfixes import util -def main(): + +def main() -> None: # Replace launcher with game exe in proton arguments util.protontricks('vcrun2019') util.protontricks('d3dcompiler_43') diff --git a/gamefixes-steam/17300.py b/gamefixes-steam/17300.py index bab1e90c..20c77425 100755 --- a/gamefixes-steam/17300.py +++ b/gamefixes-steam/17300.py @@ -1,13 +1,10 @@ -""" Game fix for Crysis -""" -#pylint: disable=C0103 +"""Game fix for Crysis""" from protonfixes import util -def main(): - """ Installs d3dcompiler_43, disables esync - """ +def main() -> None: + """Installs d3dcompiler_43, disables esync""" # https://github.com/ValveSoftware/Proton/issues/178#issuecomment-422986182 util.protontricks('d3dcompiler_43') diff --git a/gamefixes-steam/1795390.py b/gamefixes-steam/1795390.py index 3b884200..3c7a0031 100755 --- a/gamefixes-steam/1795390.py +++ b/gamefixes-steam/1795390.py @@ -1,9 +1,12 @@ -""" Game fix for Carnage Cross +"""Game fix for Carnage Cross Proton issue: https://github.com/ValveSoftware/Proton/issues/6645 """ -#pylint: disable=C0103 from protonfixes import util -def main(): - util.replace_command('CarnageCross/CarnageCross', 'CarnageCross/CarnageCross/Binaries/Win64/CarnageCross-Win64-Shipping.exe') + +def main() -> None: + util.replace_command( + 'CarnageCross/CarnageCross', + 'CarnageCross/CarnageCross/Binaries/Win64/CarnageCross-Win64-Shipping.exe', + ) diff --git a/gamefixes-steam/1829980.py b/gamefixes-steam/1829980.py index f6d59719..e1cecb5e 100644 --- a/gamefixes-steam/1829980.py +++ b/gamefixes-steam/1829980.py @@ -3,8 +3,6 @@ from protonfixes import util -def main(): - """ - Fixes in-game video playback for the intro and ending. - """ +def main() -> None: + """Fixes in-game video playback for the intro and ending.""" util.disable_protonmediaconverter() diff --git a/gamefixes-steam/1873170.py b/gamefixes-steam/1873170.py index c9e7e030..f8762e5c 100644 --- a/gamefixes-steam/1873170.py +++ b/gamefixes-steam/1873170.py @@ -1,9 +1,8 @@ -""" Cease to Breathe +"""Cease to Breathe Replace included nwjs(0.71) wich doesn't work with 0.86 Fix cursor hitbox (set frame=false in package.json) Updated from 0.85 that didn't display custom cursors. """ -#pylint: disable=C0103 import os import glob @@ -15,7 +14,8 @@ from protonfixes import util from protonfixes.logger import log -def main(): + +def main() -> None: util.replace_command('CTB.exe', 'nw.exe') install_dir = glob.escape(util.get_game_install_path()) if not os.path.isfile(os.path.join(install_dir, 'nw.exe')): @@ -23,7 +23,7 @@ def main(): hashsum = 'ed2681847162e0fa457dd55e293b6f331ccd58acedd934a98e7fe1406c26dd4f' nwjs = os.path.basename(url) urllib.request.urlretrieve(url, nwjs) - with open(nwjs, "rb") as f: + with open(nwjs, 'rb') as f: nwjs_sum = hashlib.sha256(f.read()).hexdigest() if hashsum == nwjs_sum: with zipfile.ZipFile(nwjs, 'r') as zip_ref: @@ -33,4 +33,7 @@ def main(): shutil.rmtree(nwjs) else: log(f"{nwjs} checksum doesn't match, fix not applied.") - subprocess.call([f"sed -i 's/\"frame\": true/\"frame\": false/' \"{install_dir}/package.json\""], shell=True) + subprocess.call( + [f'sed -i \'s/"frame": true/"frame": false/\' "{install_dir}/package.json"'], + shell=True, + ) diff --git a/gamefixes-steam/1930.py b/gamefixes-steam/1930.py index 90a43e7a..de53ab8a 100755 --- a/gamefixes-steam/1930.py +++ b/gamefixes-steam/1930.py @@ -1,8 +1,9 @@ -""" Two Worlds Epic Edition - ID 1930 - https://www.protondb.com/app/1930 +"""Two Worlds Epic Edition - ID 1930 +https://www.protondb.com/app/1930 """ from protonfixes import util -def main(): + +def main() -> None: util.protontricks('xact') diff --git a/gamefixes-steam/19900.py b/gamefixes-steam/19900.py index 2dd38e1d..7dbf5ef8 100755 --- a/gamefixes-steam/19900.py +++ b/gamefixes-steam/19900.py @@ -1,7 +1,8 @@ -""" Far Cry 2 -""" -def main(): - """ Set CPU limit to upstream core count +"""Far Cry 2""" + + +def main() -> None: + """Set CPU limit to upstream core count See https://github.com/ValveSoftware/Proton/blob/proton_9.0/proton#L1154 Code block is intentionally empty because this game exists in EGS and diff --git a/gamefixes-steam/1999770.py b/gamefixes-steam/1999770.py index c80a4959..d8798751 100755 --- a/gamefixes-steam/1999770.py +++ b/gamefixes-steam/1999770.py @@ -1,11 +1,10 @@ -""" Atelier Ryza 3: Alchemist of the End & the Secret Key +"""Atelier Ryza 3: Alchemist of the End & the Secret Key Missing voices/sounds in cutscenes Requires disabling the gstreamer protonaudioconverterbin plugin to get full audio in cutscenes """ -#pylint: disable=C0103 - from protonfixes import util -def main(): + +def main() -> None: util.disable_protonmediaconverter() diff --git a/gamefixes-steam/200490.py b/gamefixes-steam/200490.py index 7aa09f55..b203ce0d 100755 --- a/gamefixes-steam/200490.py +++ b/gamefixes-steam/200490.py @@ -1,11 +1,11 @@ -""" Memento Mori +"""Memento Mori wmp11 (Fixes missing logo videos and problems with working videos) hangs on logo without override """ -#pylint: disable=C0103 from protonfixes import util -def main(): + +def main() -> None: util.winedll_override('libvkd3d-1', 'n') util.protontricks('wmp11') diff --git a/gamefixes-steam/200940.py b/gamefixes-steam/200940.py index 76b31543..345e1f1d 100755 --- a/gamefixes-steam/200940.py +++ b/gamefixes-steam/200940.py @@ -1,12 +1,10 @@ -""" Game fix for Sonic CD -""" -#pylint: disable=C0103 +"""Game fix for Sonic CD""" from protonfixes import util -def main(): - """ Installs d3dcompiler_43, d3dx9_43, mdx. Locks fps to 60. - """ + +def main() -> None: + """Installs d3dcompiler_43, d3dx9_43, mdx. Locks fps to 60.""" util.protontricks('d3dcompiler_43') util.protontricks('d3dx9_43') util.protontricks('mdx') diff --git a/gamefixes-steam/201480.py b/gamefixes-steam/201480.py index 375da285..52def908 100755 --- a/gamefixes-steam/201480.py +++ b/gamefixes-steam/201480.py @@ -1,14 +1,10 @@ -""" Game fix for Serious Sam: The Random Encounter -""" -#pylint: disable=C0103 +"""Game fix for Serious Sam: The Random Encounter""" from protonfixes import util -def main(): - """ Installs directmusic and directplay - """ - +def main() -> None: + """Installs directmusic and directplay""" util.protontricks('dmband') util.protontricks('dmime') util.protontricks('dmloader') diff --git a/gamefixes-steam/204450.py b/gamefixes-steam/204450.py index 7c818ba0..cdc702e6 100644 --- a/gamefixes-steam/204450.py +++ b/gamefixes-steam/204450.py @@ -1,10 +1,8 @@ -""" Game fix for Call of Juarez: Gunslinger -""" +"""Game fix for Call of Juarez: Gunslinger""" from protonfixes import util -def main(): - """ Fixes missing sound in cutscenes - """ +def main() -> None: + """Fixes missing sound in cutscenes""" util.disable_protonmediaconverter() diff --git a/gamefixes-steam/206480.py b/gamefixes-steam/206480.py index 8c9b54d0..62362ff2 100755 --- a/gamefixes-steam/206480.py +++ b/gamefixes-steam/206480.py @@ -1,12 +1,11 @@ -""" Game fix Dungeons & Dragons Online -""" -#pylint: disable=C0103 +"""Game fix Dungeons & Dragons Online""" + # from protonfixes import util -def main(): - """ Disable libglesv2 """ +def main() -> None: + """Disable libglesv2""" # gpu acelleration on wibed3d https://bugs.winehq.org/show_bug.cgi?id=44985 # Make the store work. util.winedll_override('libglesv2', 'd') diff --git a/gamefixes-steam/206500.py b/gamefixes-steam/206500.py index 9f296c93..d4bc70be 100755 --- a/gamefixes-steam/206500.py +++ b/gamefixes-steam/206500.py @@ -1,9 +1,7 @@ -""" Game fix for AirMech Strike -""" - -#pylint: disable=C0103 +"""Game fix for AirMech Strike""" from protonfixes import util -def main(): + +def main() -> None: util.append_argument('/dx11') diff --git a/gamefixes-steam/207350.py b/gamefixes-steam/207350.py index f53655f0..dadcf6d5 100755 --- a/gamefixes-steam/207350.py +++ b/gamefixes-steam/207350.py @@ -1,10 +1,9 @@ -""" Game fix for Ys Origin -""" -#pylint: disable=C0103 +"""Game fix for Ys Origin""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('directshow') util.protontricks('cinepak') util.protontricks('lavfilters') diff --git a/gamefixes-steam/208650.py b/gamefixes-steam/208650.py index 8a2d6980..21d4ca9c 100755 --- a/gamefixes-steam/208650.py +++ b/gamefixes-steam/208650.py @@ -1,12 +1,9 @@ -""" Game fix for Batman Arkham Knight -""" -#pylint: disable=C0103 +"""Game fix for Batman Arkham Knight""" from protonfixes import util -def main(): - """ NVIDIA PhysX support. - """ +def main() -> None: + """NVIDIA PhysX support.""" # Enables NVIDIA PhysX in Batman Arkham Knight. util.protontricks('physx') diff --git a/gamefixes-steam/20920.py b/gamefixes-steam/20920.py index 996b4382..b3eb902d 100755 --- a/gamefixes-steam/20920.py +++ b/gamefixes-steam/20920.py @@ -1,6 +1,7 @@ -""" The Witcher 2: Assassins of Kings Enhanced Edition -""" -def main(): - """ Witcher 2 chokes on more than 16 cores +"""The Witcher 2: Assassins of Kings Enhanced Edition""" + + +def main() -> None: + """Witcher 2 chokes on more than 16 cores Code block is intentionally empty because this game exists in GOG (umu-20920) """ diff --git a/gamefixes-steam/211420.py b/gamefixes-steam/211420.py index ba116ae0..0c606d7a 100755 --- a/gamefixes-steam/211420.py +++ b/gamefixes-steam/211420.py @@ -1,18 +1,16 @@ -""" Game fix Dark Souls Prepare To Die Edition -""" -#pylint: disable=C0103 +"""Game fix Dark Souls Prepare To Die Edition""" from protonfixes import util -def main(): - """ Needs WMP9, devenum, quartz, dinput and win7 """ - #For main menu, intro and outro playback +def main() -> None: + """Needs WMP9, devenum, quartz, dinput and win7""" + # For main menu, intro and outro playback util.protontricks('devenum') util.protontricks('quartz') - util.protontricks("wmp9") + util.protontricks('wmp9') - #In case if someone wishes to use DSfix + # In case if someone wishes to use DSfix util.protontricks('dinput8') util.winedll_override('dinput8', 'n') diff --git a/gamefixes-steam/212500.py b/gamefixes-steam/212500.py index b25ea4c5..c5113da9 100755 --- a/gamefixes-steam/212500.py +++ b/gamefixes-steam/212500.py @@ -1,12 +1,11 @@ -""" Game fix The Lord of the Rings Online -""" -#pylint: disable=C0103 +"""Game fix The Lord of the Rings Online""" + # from protonfixes import util -def main(): - """ Disable libglesv2 """ +def main() -> None: + """Disable libglesv2""" ## gpu acelleration on wined3d https://bugs.winehq.org/show_bug.cgi?id=44985 # Make the store work. util.winedll_override('libglesv2', 'd') diff --git a/gamefixes-steam/213330.py b/gamefixes-steam/213330.py index c75606e5..6c6dc351 100755 --- a/gamefixes-steam/213330.py +++ b/gamefixes-steam/213330.py @@ -1,10 +1,8 @@ -""" Game fix for LEGO Batman 2: DC Super Heroes -""" -#pylint: disable=C0103 +"""Game fix for LEGO Batman 2: DC Super Heroes""" from protonfixes import util -def main(): - """ installs d3dx9_41 - """ + +def main() -> None: + """Installs d3dx9_41""" util.protontricks('d3dx9_41') diff --git a/gamefixes-steam/2138090.py b/gamefixes-steam/2138090.py index c6e75c47..387cd09b 100755 --- a/gamefixes-steam/2138090.py +++ b/gamefixes-steam/2138090.py @@ -1,12 +1,12 @@ -""" Atelier Marie Remake: The Alchemist of Salburg +"""Atelier Marie Remake: The Alchemist of Salburg Missing voices/sounds in cutscenes Requires disabling the gstreamer protonaudioconverterbin plugin to get full audio in cutscenes. fixed by Swish in Protondb further stolen from marianoag by bitwolf """ -#pylint: disable=C0103 from protonfixes import util -def main(): + +def main() -> None: util.disable_protonmediaconverter() diff --git a/gamefixes-steam/214510.py b/gamefixes-steam/214510.py index 99e02d49..576ac0f7 100755 --- a/gamefixes-steam/214510.py +++ b/gamefixes-steam/214510.py @@ -1,11 +1,8 @@ -""" Game fix for LEGO The Lord of the Rings -""" -#pylint: disable=C0103 +"""Game fix for LEGO The Lord of the Rings""" from protonfixes import util -def main(): - """ installs d3dx9_41 - """ +def main() -> None: + """Installs d3dx9_41""" util.protontricks('d3dx9_41') diff --git a/gamefixes-steam/214950.py b/gamefixes-steam/214950.py index b5ee6d53..e8af4eb8 100755 --- a/gamefixes-steam/214950.py +++ b/gamefixes-steam/214950.py @@ -1,11 +1,11 @@ -""" Game fix for Total War: Rome II -""" +"""Game fix for Total War: Rome II""" from protonfixes import util -def main(): - """ installs d3dx11_42, d3dcompiler_42, directplay - Disable esync and fsync + +def main() -> None: + """Installs d3dx11_42, d3dcompiler_42, directplay + Disable esync and fsync """ util.protontricks('d3dx11_42') util.protontricks('d3dcompiler_42') diff --git a/gamefixes-steam/215280.py b/gamefixes-steam/215280.py index f63d15c0..5f4cf243 100755 --- a/gamefixes-steam/215280.py +++ b/gamefixes-steam/215280.py @@ -1,10 +1,9 @@ -""" Game fix for Secret World Legends -""" -#pylint: disable=C0103 +"""Game fix for Secret World Legends""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('d3dx9_43') util.protontricks('d3dx11_43') util.protontricks('d3dcompiler_43') diff --git a/gamefixes-steam/21680.py b/gamefixes-steam/21680.py index f2a7725d..3aa950ac 100755 --- a/gamefixes-steam/21680.py +++ b/gamefixes-steam/21680.py @@ -1,10 +1,8 @@ -""" Bionic Commander Rearmed -""" -#pylint: disable=C0103 +"""Bionic Commander Rearmed""" from protonfixes import util -def main(): - """ Installs physx - """ + +def main() -> None: + """Installs physx""" util.protontricks('physx') diff --git a/gamefixes-steam/2183070.py b/gamefixes-steam/2183070.py index 277d9aef..a5d415ec 100755 --- a/gamefixes-steam/2183070.py +++ b/gamefixes-steam/2183070.py @@ -1,12 +1,10 @@ -""" Game fix for Tokyo Necro -""" +"""Game fix for Tokyo Necro""" from protonfixes import util -def main(): - """ installs xact, disable ESYNC, disable FSYNC - """ +def main() -> None: + """Installs xact, disable ESYNC, disable FSYNC""" # Fixes crash after typing then entering or clicking `search` within the game's terminal menu util.protontricks('xact') # Fixes hanging after typing then entering or clicking `search` within the game's terminal menu diff --git a/gamefixes-steam/219030.py b/gamefixes-steam/219030.py index 8a11c5dc..13de6d29 100755 --- a/gamefixes-steam/219030.py +++ b/gamefixes-steam/219030.py @@ -1,10 +1,9 @@ -""" Game fix for Ys Origin Demo -""" -#pylint: disable=C0103 +"""Game fix for Ys Origin Demo""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('directshow') util.protontricks('cinepak') util.protontricks('lavfilters') diff --git a/gamefixes-steam/219990.py b/gamefixes-steam/219990.py index a3a12319..c19aad2f 100755 --- a/gamefixes-steam/219990.py +++ b/gamefixes-steam/219990.py @@ -1,9 +1,8 @@ -""" Game fix for Grim Dawn -""" -#pylint: disable=C0103 +"""Game fix for Grim Dawn""" from protonfixes import util -def main(): + +def main() -> None: # Fix black screen. Only needed in a Wine prefix that lacks the DirectX Redist installation that comes with the game installer. util.protontricks('d3dcompiler_43') diff --git a/gamefixes-steam/220240.py b/gamefixes-steam/220240.py index c37fcea0..d52f90ce 100755 --- a/gamefixes-steam/220240.py +++ b/gamefixes-steam/220240.py @@ -1,12 +1,8 @@ -""" FarCry 3 -""" -#pylint: disable=C0103 +"""FarCry 3""" from protonfixes import util -def main(): - """ FarCry 3 chokes on more than 24 cores - """ - +def main() -> None: + """FarCry 3 chokes on more than 24 cores""" util.set_cpu_topology_limit(24) diff --git a/gamefixes-steam/2229850.py b/gamefixes-steam/2229850.py index 98712816..a821709c 100644 --- a/gamefixes-steam/2229850.py +++ b/gamefixes-steam/2229850.py @@ -1,31 +1,29 @@ -""" Game fix for Command & Conquer Red Alert™ 2 and Yuri's Revenge™ -""" -#pylint: disable=C0103 +"""Game fix for Command & Conquer Red Alert™ 2 and Yuri's Revenge™""" import os from protonfixes import util from protonfixes.logger import log -def main(): - """ Install and launch the CnCNet Launcher - It fixes several issues, allows multiplayer and provides a working UI, - while the game has sometimes problems like missing or shifted buttons. +def main() -> None: + """Install and launch the CnCNet Launcher - The game will just show a black screen without cnc-ddraw or the patch in place. - """ + It fixes several issues, allows multiplayer and provides a working UI, + while the game has sometimes problems like missing or shifted buttons. + The game will just show a black screen without cnc-ddraw or the patch in place. + """ # Opt out of CnCNet with 'NO_CNCNET=1 %command%' no_cncnet = os.getenv('NO_CNCNET', '') if str.lower(no_cncnet) in ['y', 'yes', 'true', 'on', '1']: - log('Skipping CnCNet on user\'s request.') + log("Skipping CnCNet on user's request.") use_cnc_ddraw() return # Install the CnCNet Launcher if not util.checkinstalled('cncnet_ra2') and not util.protontricks('cncnet_ra2'): - log('Failed to install CnCNet Launcher, let\'s try cnc-ddraw.') + log("Failed to install CnCNet Launcher, let's try cnc-ddraw.") use_cnc_ddraw() # CnCNet Launcher is in place, run it @@ -34,10 +32,9 @@ def main(): util.replace_command('Ra2.exe', 'CnCNetYRLauncher.exe') util.replace_command('RA2MD.exe', 'CnCNetYRLauncher.exe') -def use_cnc_ddraw(): - """ Install cnc-ddraw, the current replacement from EA isn't working. - """ +def use_cnc_ddraw() -> None: + """Install cnc-ddraw, the current replacement from EA isn't working.""" log('Using cnc-ddraw.') # Return early, if cnc-ddraw is installed diff --git a/gamefixes-steam/22370.py b/gamefixes-steam/22370.py index f86bf89d..ee904d16 100755 --- a/gamefixes-steam/22370.py +++ b/gamefixes-steam/22370.py @@ -1,13 +1,10 @@ -""" Game fix for Fallout 3 -""" -#pylint: disable=C0103 +"""Game fix for Fallout 3""" import os from protonfixes import util -def main(): - """ Run script extender if it exists. - """ +def main() -> None: + """Run script extender if it exists.""" if os.path.isfile(os.path.join(os.getcwd(), 'fose_loader.exe')): util.replace_command('FalloutLauncher.exe', 'fose_loader.exe') diff --git a/gamefixes-steam/223750.py b/gamefixes-steam/223750.py index 904da9ba..126d16b1 100755 --- a/gamefixes-steam/223750.py +++ b/gamefixes-steam/223750.py @@ -1,11 +1,9 @@ -""" Fixes for DCS World Steam Edition -""" -#pylint: disable=C0103 +"""Fixes for DCS World Steam Edition""" from protonfixes import util -def main(): +def main() -> None: # Based on https://www.digitalcombatsimulator.com/en/support/faq/SteamDeck/ util.protontricks('d3dx11_43') util.protontricks('d3dcompiler_43') diff --git a/gamefixes-steam/224960.py b/gamefixes-steam/224960.py index 8e620dd6..bee2d8fc 100755 --- a/gamefixes-steam/224960.py +++ b/gamefixes-steam/224960.py @@ -1,12 +1,10 @@ -""" Game fix for Tomb Raider I -""" -# pylint: disable=C0103 +"""Game fix for Tomb Raider I""" from protonfixes import util -def main(): - """ Enable Glide emulation in dosbox config """ +def main() -> None: + """Enable Glide emulation in dosbox config""" conf_dict = {'glide': {'glide': 'emu'}} util.create_dosbox_conf('glide_fix.conf', conf_dict) util.append_argument('-conf') diff --git a/gamefixes-steam/225640.py b/gamefixes-steam/225640.py index 41c362ff..d33e3569 100755 --- a/gamefixes-steam/225640.py +++ b/gamefixes-steam/225640.py @@ -1,12 +1,8 @@ -""" Game fix for Sacred 2 Gold -""" -#pylint: disable=C0103 +"""Game fix for Sacred 2 Gold""" from protonfixes import util -def main(): - """ Install physx - """ - +def main() -> None: + """Install physx""" util.protontricks('physx') diff --git a/gamefixes-steam/227320.py b/gamefixes-steam/227320.py index bdb3f7df..b5d1b9e9 100755 --- a/gamefixes-steam/227320.py +++ b/gamefixes-steam/227320.py @@ -1,12 +1,9 @@ -""" Game fix for You Need a Budget 4 -""" -#pylint: disable=C0103 +"""Game fix for You Need a Budget 4""" from protonfixes import util -def main(): - """ Installs corefonts - """ +def main() -> None: + """Installs corefonts""" # https://github.com/ValveSoftware/Proton/issues/7 util.protontricks('corefonts') diff --git a/gamefixes-steam/230820.py b/gamefixes-steam/230820.py index fcb9801c..45fbb809 100755 --- a/gamefixes-steam/230820.py +++ b/gamefixes-steam/230820.py @@ -1,10 +1,10 @@ -""" The Night of the Rabbit +"""The Night of the Rabbit https://github.com/ValveSoftware/Proton/issues/1412 -No cutscene audio in Daedalic Games (Memoria, The Night of the Rabbit, A New Beginning - Final Cut) (105000 230820 243200) #1412 +No cutscene audio in Daedalic Games (Memoria, The Night of the Rabbit, A New Beginning - Final Cut) (105000 230820 243200) #1412 """ -#pylint: disable=C0103 from protonfixes import util -def main(): + +def main() -> None: util.winedll_override('xaudio2_7', 'd') diff --git a/gamefixes-steam/231990.py b/gamefixes-steam/231990.py index e77821e7..cd5214f0 100755 --- a/gamefixes-steam/231990.py +++ b/gamefixes-steam/231990.py @@ -1,13 +1,11 @@ -""" Game fix for Spider-Man: Shattered Dimensions -""" -#pylint: disable=C0103 +"""Game fix for Spider-Man: Shattered Dimensions""" + # from protonfixes import util -def main(): - """ installs d3dx9_43, xact - """ +def main() -> None: + """Installs d3dx9_43, xact""" # https://steamcommunity.com/app/231990/discussions/0/3198117312260185786/#c3470604115208907456 util.protontricks('d3dx9_43') util.protontricks('xact') diff --git a/gamefixes-steam/233270.py b/gamefixes-steam/233270.py index 66f783e1..07563a6c 100755 --- a/gamefixes-steam/233270.py +++ b/gamefixes-steam/233270.py @@ -1,12 +1,8 @@ -""" Far Cry Blood Dragon -""" -#pylint: disable=C0103 +"""Far Cry Blood Dragon""" from protonfixes import util -def main(): - """ dx11 version is broken - """ - +def main() -> None: + """dx11 version is broken""" util.set_cpu_topology_limit(24) diff --git a/gamefixes-steam/23460.py b/gamefixes-steam/23460.py index a8de3450..48c410e7 100644 --- a/gamefixes-steam/23460.py +++ b/gamefixes-steam/23460.py @@ -1,18 +1,18 @@ -""" Ceville +"""Ceville Works with dotnet35sp1 only, now without needing Proton5 -Videos still don't work. +Videos still don't work. """ -#pylint: disable=C0103 import os import subprocess from protonfixes import util -def main(): + +def main() -> None: util.protontricks('dotnet35sp1') - #Videos play and audio works but screen is black. - #util.protontricks('quartz') - #util.protontricks('klite') + # Videos play and audio works but screen is black. + # util.protontricks('quartz') + # util.protontricks('klite') if os.path.isdir('./data/shared/videos'): subprocess.call(['mv', './data/shared/videos', './data/shared/_videos']) util.winedll_override('libvkd3d-1', 'n') diff --git a/gamefixes-steam/237890.py b/gamefixes-steam/237890.py index 4b2f701f..4621d5e0 100755 --- a/gamefixes-steam/237890.py +++ b/gamefixes-steam/237890.py @@ -1,9 +1,8 @@ -""" Game fix for Agarest: Generations of War -""" -#pylint: disable=C0103 +"""Game fix for Agarest: Generations of War""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('wmp9') util.winedll_override('winegstreamer', '') diff --git a/gamefixes-steam/2399220.py b/gamefixes-steam/2399220.py index f21c7062..b3dad3d1 100755 --- a/gamefixes-steam/2399220.py +++ b/gamefixes-steam/2399220.py @@ -1,11 +1,9 @@ -""" Game fix for NUKITASHI -""" +"""Game fix for NUKITASHI""" from protonfixes import util -def main(): - """ Disable protonaudioconverterbin plugin - """ +def main() -> None: + """Disable protonaudioconverterbin plugin""" # Fixes audio not playing for in-game videos util.disable_protonmediaconverter() diff --git a/gamefixes-steam/240600.py b/gamefixes-steam/240600.py index 4210926e..fb57950e 100755 --- a/gamefixes-steam/240600.py +++ b/gamefixes-steam/240600.py @@ -1,10 +1,8 @@ -""" Game fix for MotorGP -""" - -#pylint: disable=C0103 +"""Game fix for MotorGP""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('d3dcompiler_43') util.protontricks('d3dx9_43') diff --git a/gamefixes-steam/242760.py b/gamefixes-steam/242760.py index 1feec2b8..20e852f4 100755 --- a/gamefixes-steam/242760.py +++ b/gamefixes-steam/242760.py @@ -1,14 +1,11 @@ -""" Game fix for The Forest -""" - -# pylint: disable=C0103 +"""Game fix for The Forest""" from protonfixes import util -def main(): - """ If SMT/HT is enabled, The Forest runs with extremely choppy. Just bad. - We can fix it by setting the topology to the physical cores / core count. - TODO: This fix was not tested with more than 10 physical cores yet. +def main() -> None: + """If SMT/HT is enabled, The Forest runs with extremely choppy. Just bad. + We can fix it by setting the topology to the physical cores / core count. + TODO: This fix was not tested with more than 10 physical cores yet. """ util.set_cpu_topology_nosmt() diff --git a/gamefixes-steam/243200.py b/gamefixes-steam/243200.py index a7658d58..ee5eddf5 100755 --- a/gamefixes-steam/243200.py +++ b/gamefixes-steam/243200.py @@ -1,10 +1,10 @@ -""" The Dark Eye: Memoria +"""The Dark Eye: Memoria https://github.com/ValveSoftware/Proton/issues/1412 -No cutscene audio in Daedalic Games (Memoria, The Night of the Rabbit, A New Beginning - Final Cut) (105000 230820 243200) #1412 +No cutscene audio in Daedalic Games (Memoria, The Night of the Rabbit, A New Beginning - Final Cut) (105000 230820 243200) #1412 """ -#pylint: disable=C0103 from protonfixes import util -def main(): + +def main() -> None: util.winedll_override('xaudio2_7', 'd') diff --git a/gamefixes-steam/244210.py b/gamefixes-steam/244210.py index 0c78026f..826d8204 100755 --- a/gamefixes-steam/244210.py +++ b/gamefixes-steam/244210.py @@ -1,12 +1,10 @@ -""" Game fix for Assetto Corsa -""" -#pylint: disable=C0103 +"""Game fix for Assetto Corsa""" from protonfixes import util -def main(): - """Fixes default launcher and ACM.""" +def main() -> None: + """Fixes default launcher and ACM.""" util.protontricks('dotnet452') # Fixes Content Manager (black windows) util.protontricks('d3dx11_43') diff --git a/gamefixes-steam/244850.py b/gamefixes-steam/244850.py index 4d850c88..5ed72f78 100755 --- a/gamefixes-steam/244850.py +++ b/gamefixes-steam/244850.py @@ -1,19 +1,16 @@ -""" Game fix for Space Engineers -""" - -# pylint: disable=C0103 +"""Game fix for Space Engineers""" from protonfixes import util -def main(): +def main() -> None: util.protontricks('xaudio29') - base_attibutte = "" + base_attibutte = '' game_opts = """ """ - util.set_xml_options(base_attibutte, game_opts, 'SpaceEngineers.exe.config','game') + util.set_xml_options(base_attibutte, game_opts, 'SpaceEngineers.exe.config', 'game') util.append_argument('-skipintro') diff --git a/gamefixes-steam/2458530.py b/gamefixes-steam/2458530.py index 62b30baf..8480a8fa 100644 --- a/gamefixes-steam/2458530.py +++ b/gamefixes-steam/2458530.py @@ -1,8 +1,9 @@ -""" Game fix for Sanoba Witch FHD Edition -""" +"""Game fix for Sanoba Witch FHD Edition""" + from protonfixes import util -def main(): + +def main() -> None: """Install quartz, wmp11, qasf Fixes in-game video playback for the intro and ending. diff --git a/gamefixes-steam/2475980.py b/gamefixes-steam/2475980.py index d7879cd1..70a8f7bb 100644 --- a/gamefixes-steam/2475980.py +++ b/gamefixes-steam/2475980.py @@ -1,7 +1,6 @@ -""" Gobliiins 5 +"""Gobliiins 5 Setup doesn't work and language is default to french """ -#pylint: disable=C0103 import os import sys @@ -9,13 +8,26 @@ import glob from protonfixes import util -def main(): - if sys.argv[2].find("winsetup")!=-1: + +def main() -> None: + if sys.argv[2].find('winsetup') != -1: os.chdir(sys.argv[2][-29:-13]) install_dir = glob.escape(util.get_game_install_path()) - with open(os.path.join(install_dir,'Gobliiins5-Part4/acsetup.cfg'), 'r', encoding='utf-8') as f: + with open( + os.path.join(install_dir, 'Gobliiins5-Part4/acsetup.cfg'), encoding='utf-8' + ) as f: if 'Linear' not in f.read(): - for i in range(1,5): - subprocess.call([f"sed -i 's/filter=stdscale/filter=Linear/' {install_dir}/Gobliiins5-Part{i}/acsetup.cfg"], shell=True) - subprocess.call([f"sed -i 's/translation.*/translation=English/' {install_dir}/Gobliiins5-Part{i}/acsetup.cfg"], shell=True) + for i in range(1, 5): + subprocess.call( + [ + f"sed -i 's/filter=stdscale/filter=Linear/' {install_dir}/Gobliiins5-Part{i}/acsetup.cfg" + ], + shell=True, + ) + subprocess.call( + [ + f"sed -i 's/translation.*/translation=English/' {install_dir}/Gobliiins5-Part{i}/acsetup.cfg" + ], + shell=True, + ) diff --git a/gamefixes-steam/2507620.py b/gamefixes-steam/2507620.py index 9b8c4a4c..2eba45b5 100644 --- a/gamefixes-steam/2507620.py +++ b/gamefixes-steam/2507620.py @@ -1,12 +1,9 @@ -""" Game fix for The Quintessential Quintuplets - Five Memories Spent With You -""" -#pylint: disable=C0103 +"""Game fix for The Quintessential Quintuplets - Five Memories Spent With You""" from protonfixes import util -def main(): - """ Install xact - """ +def main() -> None: + """Install xact""" # Fixes audio not playing and some background music util.protontricks('xact') diff --git a/gamefixes-steam/251150.py b/gamefixes-steam/251150.py index 3c275e0c..9ae65b81 100644 --- a/gamefixes-steam/251150.py +++ b/gamefixes-steam/251150.py @@ -1,11 +1,10 @@ -""" Game fix for The Legend of Heroes: Trails in the Sky -""" -# pylint: disable=C0103 +"""Game fix for The Legend of Heroes: Trails in the Sky""" from protonfixes import util -def main(): - util.protontricks('quartz') # Cutscene fixes + +def main() -> None: + util.protontricks('quartz') # Cutscene fixes util.protontricks('amstream') util.protontricks('lavfilters') - util.winedll_override('dinput8', 'n,b') # Set for the SoraVoice mod + util.winedll_override('dinput8', 'n,b') # Set for the SoraVoice mod diff --git a/gamefixes-steam/251290.py b/gamefixes-steam/251290.py index 5532f4f7..797a5033 100644 --- a/gamefixes-steam/251290.py +++ b/gamefixes-steam/251290.py @@ -1,11 +1,10 @@ -""" Game fix for The Legend of Heroes: Trails in the Sky SC -""" -# pylint: disable=C0103 +"""Game fix for The Legend of Heroes: Trails in the Sky SC""" from protonfixes import util -def main(): - util.protontricks('quartz') # Cutscene fixes + +def main() -> None: + util.protontricks('quartz') # Cutscene fixes util.protontricks('amstream') util.protontricks('lavfilters') - util.winedll_override('dinput8', 'n,b') # Set for the SoraVoice mod + util.winedll_override('dinput8', 'n,b') # Set for the SoraVoice mod diff --git a/gamefixes-steam/252430.py b/gamefixes-steam/252430.py index b3dc387e..f388f80a 100755 --- a/gamefixes-steam/252430.py +++ b/gamefixes-steam/252430.py @@ -1,11 +1,9 @@ -""" Game fix for Dusty Revenge: Co-Op Edition -""" -#pylint: disable=C0103 +"""Game fix for Dusty Revenge: Co-Op Edition""" from protonfixes import util -def main(): - """ Install vcrun2010 - """ + +def main() -> None: + """Install vcrun2010""" util.protontricks('vcrun2010') util.protontricks('dsound') diff --git a/gamefixes-steam/256330.py b/gamefixes-steam/256330.py index ff040bae..e80a2a71 100644 --- a/gamefixes-steam/256330.py +++ b/gamefixes-steam/256330.py @@ -1,16 +1,15 @@ -""" WRC 4 -""" -#pylint: disable=C0103 +"""WRC 4""" from protonfixes import util -def main(): - #Black screen without it + +def main() -> None: + # Black screen without it util.protontricks('d3dx9_42') util.protontricks('d3dx9_43') - #Fixes background videos + # Fixes background videos util.protontricks('wmp11') - #Fixes audio sliders in options + # Fixes audio sliders in options util.protontricks('xact') diff --git a/gamefixes-steam/257420.py b/gamefixes-steam/257420.py index be81de8b..92fb0b0d 100755 --- a/gamefixes-steam/257420.py +++ b/gamefixes-steam/257420.py @@ -1,16 +1,14 @@ -""" Game fix for Serious Sam 4 -""" -#pylint: disable=C0103 +"""Game fix for Serious Sam 4""" import os import subprocess -def main(): - """ Graphics API workaround - """ + +def main() -> None: + """Graphics API workaround""" if not os.path.isfile('UserCfg.lua.bak'): subprocess.call(['cp', 'UserCfg.lua', 'UserCfg.lua.bak']) # Assume UTF-8 - with open('UserCfg.lua', "a+", encoding="utf-8") as f: - f.write("sfx_strAPI = \"OpenAL\";") + with open('UserCfg.lua', 'a+', encoding='utf-8') as f: + f.write('sfx_strAPI = "OpenAL";') diff --git a/gamefixes-steam/260130.py b/gamefixes-steam/260130.py index 7fd6f282..5aa67f4e 100755 --- a/gamefixes-steam/260130.py +++ b/gamefixes-steam/260130.py @@ -1,9 +1,8 @@ -""" Game fix for Agarest Zero -""" -#pylint: disable=C0103 +"""Game fix for Agarest Zero""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('wmp9') util.disable_protonmediaconverter() diff --git a/gamefixes-steam/261510.py b/gamefixes-steam/261510.py index 31553000..2818bb21 100755 --- a/gamefixes-steam/261510.py +++ b/gamefixes-steam/261510.py @@ -1,12 +1,9 @@ -""" Game fix for Tesla Effect -""" -#pylint: disable=C0103 +"""Game fix for Tesla Effect""" from protonfixes import util -def main(): - """ Install corefonts - """ +def main() -> None: + """Install corefonts""" # https://github.com/ValveSoftware/Proton/issues/1317 util.protontricks('corefonts') diff --git a/gamefixes-steam/2620.py b/gamefixes-steam/2620.py index 4f0238a8..bf2337d3 100755 --- a/gamefixes-steam/2620.py +++ b/gamefixes-steam/2620.py @@ -1,13 +1,10 @@ -""" Game fix for Call of Duty (2003) -""" -#pylint: disable=C0103 +"""Game fix for Call of Duty (2003)""" from protonfixes import util -def main(): - """ Set Mesa env vars - """ +def main() -> None: + """Set Mesa env vars""" # https://github.com/ValveSoftware/Proton/pull/1423/commits/1a1d25c7d95691e37c94aea4e5f94e0c917aba6f util.set_environment('MESA_EXTENSION_MAX_YEAR', '2003') util.set_environment('__GL_ExtensionStringVersion', '17700') diff --git a/gamefixes-steam/266840.py b/gamefixes-steam/266840.py index 116fd319..ac79854d 100755 --- a/gamefixes-steam/266840.py +++ b/gamefixes-steam/266840.py @@ -1,13 +1,11 @@ -""" Game fix for Age of Mythology: Extended Edition +"""Game fix for Age of Mythology: Extended Edition Source: https://github.com/JamesHealdUK/protonfixes/blob/master/fixes/266840.sh """ -#pylint: disable=C0103 from protonfixes import util -def main(): - """ Changes the proton argument from the launcher to the game - """ +def main() -> None: + """Changes the proton argument from the launcher to the game""" # Replace launcher with game exe in proton arguments util.replace_command('Launcher.exe', 'aomx.exe') diff --git a/gamefixes-steam/268050.py b/gamefixes-steam/268050.py index f1500ea7..e308efa2 100755 --- a/gamefixes-steam/268050.py +++ b/gamefixes-steam/268050.py @@ -1,13 +1,10 @@ -""" Game fix for The Evil Within(268050) -""" -#pylint: disable=C0103 +"""Game fix for The Evil Within(268050)""" from protonfixes import util -def main(): - """ Changes the proton argument from the launcher to the game - """ +def main() -> None: + """Changes the proton argument from the launcher to the game""" util.protontricks('win7') util.set_environment('PULSE_LATENCY_MSEC', '60') diff --git a/gamefixes-steam/271590.py b/gamefixes-steam/271590.py index 0d3b8588..fb26acb3 100755 --- a/gamefixes-steam/271590.py +++ b/gamefixes-steam/271590.py @@ -1,11 +1,9 @@ -""" Game fix for GTAV -""" -#pylint: disable=C0103 +"""Game fix for GTAV""" + from protonfixes import util -def main(): - """ Game fix for GTAV - """ +def main() -> None: + """Game fix for GTAV""" # Set SteamGameId so that non-steam versions can pick up steam-specific fixes in proton's wine code - util.set_environment('SteamGameId','271590') + util.set_environment('SteamGameId', '271590') diff --git a/gamefixes-steam/282900.py b/gamefixes-steam/282900.py index 46f0bf6d..2def67f6 100755 --- a/gamefixes-steam/282900.py +++ b/gamefixes-steam/282900.py @@ -1,10 +1,10 @@ -""" Hyperdimension Neptunia Re;Birth1 +"""Hyperdimension Neptunia Re;Birth1 Poor performance on some AMD hardware """ -#pylint: disable=C0103 from protonfixes import util -def main(): + +def main() -> None: util.set_environment('radeonsi_disable_sam', 'true') util.set_environment('AMD_DEBUG', 'nowc') diff --git a/gamefixes-steam/284160.py b/gamefixes-steam/284160.py index d4495ccd..c64a2cd4 100755 --- a/gamefixes-steam/284160.py +++ b/gamefixes-steam/284160.py @@ -1,13 +1,10 @@ -""" Game fix for BeamNG.drive -""" -#pylint: disable=C0103 +"""Game fix for BeamNG.drive""" from protonfixes import util -def main(): - """ installs d3dx9_43, d3dcompiler_43, d3dx11_43, d3dcompiler_47 - """ +def main() -> None: + """Installs d3dx9_43, d3dcompiler_43, d3dx11_43, d3dcompiler_47""" # https://github.com/ValveSoftware/Proton/issues/544#issuecomment-826150012 util.protontricks('d3dx9_43') util.protontricks('d3dcompiler_43') diff --git a/gamefixes-steam/286360.py b/gamefixes-steam/286360.py index 339d10cc..f6ce2312 100755 --- a/gamefixes-steam/286360.py +++ b/gamefixes-steam/286360.py @@ -1,11 +1,11 @@ -""" Shadows on the Vatican - Act I: Greed +"""Shadows on the Vatican - Act I: Greed Launcher keeps it's process running in the background but nothing shows up """ -#pylint: disable=C0103 import os from protonfixes import util -def main(): + +def main() -> None: util.replace_command('SotV_Launcher.exe', 'hd/SotV1.exe') os.chdir('hd') diff --git a/gamefixes-steam/287310.py b/gamefixes-steam/287310.py index 999aa3e6..4aa90e9a 100755 --- a/gamefixes-steam/287310.py +++ b/gamefixes-steam/287310.py @@ -1,14 +1,10 @@ -""" Game fix for Re-Volt (287310) -""" - -#pylint: disable=C0103 +"""Game fix for Re-Volt (287310)""" from protonfixes import util -def main(): - """ Sets the necessary dll overrides for the wrappers that are shipped with the game - """ +def main() -> None: + """Sets the necessary dll overrides for the wrappers that are shipped with the game""" # Set overrides util.winedll_override('ddraw', 'n') util.winedll_override('dinput', 'n') diff --git a/gamefixes-steam/287450.py b/gamefixes-steam/287450.py index 8916b154..adad905d 100755 --- a/gamefixes-steam/287450.py +++ b/gamefixes-steam/287450.py @@ -1,15 +1,12 @@ -""" Game fix for Rise of Nations: Extended Edition +"""Game fix for Rise of Nations: Extended Edition Source: https://github.com/simons-public/protonfixes/issues/24#issue-372384148 """ -#pylint: disable=C0103 - from protonfixes import util -def main(): - """ Installs crypt32 and and bypasses launcher - """ +def main() -> None: + """Installs crypt32 and and bypasses launcher""" # Install crypt32 (not required for Proton 3.16-3 and up) util.protontricks('crypt32') diff --git a/gamefixes-steam/289130.py b/gamefixes-steam/289130.py index 7e9c8cbf..b53032e4 100755 --- a/gamefixes-steam/289130.py +++ b/gamefixes-steam/289130.py @@ -1,11 +1,9 @@ -""" Game fix for Endless Legend -""" -#pylint: disable=C0103 +"""Game fix for Endless Legend""" from protonfixes import util -def main(): - """ Enable -useembedded to get past loading hang - """ + +def main() -> None: + """Enable -useembedded to get past loading hang""" # Enable preload options util.append_argument('-useembedded') diff --git a/gamefixes-steam/292410.py b/gamefixes-steam/292410.py index a4aab892..53333230 100644 --- a/gamefixes-steam/292410.py +++ b/gamefixes-steam/292410.py @@ -1,9 +1,10 @@ -""" Street Racing Syndicate -""" -#pylint: disable=C0103 +"""Street Racing Syndicate""" from protonfixes import util -def main(): - util.protontricks('lavfilters') # fix videos - util.winedll_override('d3d9', 'n,b') # in case user uses the ThirteenAG widescreen fix + +def main() -> None: + util.protontricks('lavfilters') # fix videos + util.winedll_override( + 'd3d9', 'n,b' + ) # in case user uses the ThirteenAG widescreen fix diff --git a/gamefixes-steam/294700.py b/gamefixes-steam/294700.py index 72fcbc61..c5593333 100755 --- a/gamefixes-steam/294700.py +++ b/gamefixes-steam/294700.py @@ -1,17 +1,27 @@ -""" Game fix for Putt-Putt: Pep's Birthday Surprise -""" - -#pylint: disable=C0103 +"""Game fix for Putt-Putt: Pep's Birthday Surprise""" import os from protonfixes import util + # Putt-Putt: PBS doesn't run unless there is a CD-ROM drive attached. -def main(): +def main() -> None: dosdevice = os.path.join(util.protonprefix(), 'dosdevices/r:') if not os.path.exists(dosdevice): - os.symlink('/tmp', dosdevice) #create symlink for dosdevices + os.symlink('/tmp', dosdevice) # create symlink for dosdevices - util.regedit_add('HKLM\\System\\MountedDevices','\\??\\Volume{00000000-0000-0000-0000-000000000052}','REG_BINARY','2f746d7000') #sets up ID? exported from regedit - util.regedit_add('HKLM\\System\\MountedDevices','\\DosDevices\\R:','REG_BINARY','5c005c002e005c0064003a000000') #sets up dosdevice? exported from regedit - util.regedit_add('HKLM\\Software\\Wine\\Drives','r:','REG_SZ','cdrom', True) #designate drive as CD-ROM, requires 64-bit access + util.regedit_add( + 'HKLM\\System\\MountedDevices', + '\\??\\Volume{00000000-0000-0000-0000-000000000052}', + 'REG_BINARY', + '2f746d7000', + ) # sets up ID? exported from regedit + util.regedit_add( + 'HKLM\\System\\MountedDevices', + '\\DosDevices\\R:', + 'REG_BINARY', + '5c005c002e005c0064003a000000', + ) # sets up dosdevice? exported from regedit + util.regedit_add( + 'HKLM\\Software\\Wine\\Drives', 'r:', 'REG_SZ', 'cdrom', True + ) # designate drive as CD-ROM, requires 64-bit access diff --git a/gamefixes-steam/298110.py b/gamefixes-steam/298110.py index c150093b..3c746d5d 100755 --- a/gamefixes-steam/298110.py +++ b/gamefixes-steam/298110.py @@ -1,13 +1,9 @@ -""" FarCry 4 -""" -#pylint: disable=C0103 +"""FarCry 4""" from protonfixes import util -def main(): - """ FarCry 4 chokes on more than 24 cores - """ - +def main() -> None: + """FarCry 4 chokes on more than 24 cores""" util.protontricks('d3dcompiler_43') util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/302370.py b/gamefixes-steam/302370.py index 837f7f9b..725e7574 100755 --- a/gamefixes-steam/302370.py +++ b/gamefixes-steam/302370.py @@ -1,19 +1,34 @@ -""" Tex Murphy: Overseer +"""Tex Murphy: Overseer Digital Sound Initialization Error (Intel RSX 3D drivers are not installed) LAV Filters for video and DgVoodoo for textures edit registry to avoid ffdshow compatibility manager popup """ -#pylint: disable=C0103 import os import subprocess from protonfixes import util -def main(): + +def main() -> None: util.protontricks('rsx3d') if util.protontricks('lavfilters'): - util.regedit_add('HKEY_CURRENT_USER\\Software\\GNU\\ffdshow','blacklist','REG_SZ','OVERSEER.EXE') - util.regedit_add('HKEY_CURRENT_USER\\Software\\GNU\\ffdshow_audio','blacklist','REG_SZ','OVERSEER.EXE') + util.regedit_add( + 'HKEY_CURRENT_USER\\Software\\GNU\\ffdshow', + 'blacklist', + 'REG_SZ', + 'OVERSEER.EXE', + ) + util.regedit_add( + 'HKEY_CURRENT_USER\\Software\\GNU\\ffdshow_audio', + 'blacklist', + 'REG_SZ', + 'OVERSEER.EXE', + ) if util.protontricks('dgvoodoo2'): - syswow64 = os.path.join(util.protonprefix(), 'drive_c/windows/syswow64', 'dgvoodoo.conf') - subprocess.call([f"sed -i '/[DirectX]/ {{/Resolution/s/max/unforced/}}' {syswow64}"], shell=True) + syswow64 = os.path.join( + util.protonprefix(), 'drive_c/windows/syswow64', 'dgvoodoo.conf' + ) + subprocess.call( + [f"sed -i '/[DirectX]/ {{/Resolution/s/max/unforced/}}' {syswow64}"], + shell=True, + ) diff --git a/gamefixes-steam/307690.py b/gamefixes-steam/307690.py index 6d1fecbc..34aa2cb7 100755 --- a/gamefixes-steam/307690.py +++ b/gamefixes-steam/307690.py @@ -1,15 +1,13 @@ -""" Game fix for Sleeping Dogs: Definitive Edition +"""Game fix for Sleeping Dogs: Definitive Edition Note: It does not work with WINED3D. After the game start fullscreen and resolution can be set from game display settings. Sometimes the game is crashing. """ -#pylint: disable=C0103 from protonfixes import util -def main(): - """ Set virtual desktop - """ +def main() -> None: + """Set virtual desktop""" # https://github.com/ValveSoftware/Proton/issues/872 util.protontricks('vd=1280x720') diff --git a/gamefixes-steam/307780.py b/gamefixes-steam/307780.py index 4e008176..d70dd0e8 100755 --- a/gamefixes-steam/307780.py +++ b/gamefixes-steam/307780.py @@ -1,9 +1,8 @@ -""" Game fix for Mortal Kombat X -""" -#pylint: disable=C0103 +"""Game fix for Mortal Kombat X""" from protonfixes import util -def main(): + +def main() -> None: # Fix pre-rendered cutscene playback util.protontricks('xact_x64') diff --git a/gamefixes-steam/311210.py b/gamefixes-steam/311210.py index 0270059d..37d7fceb 100755 --- a/gamefixes-steam/311210.py +++ b/gamefixes-steam/311210.py @@ -1,12 +1,10 @@ -""" Game fix for Black Ops III -""" -#pylint: disable=C0103 +"""Game fix for Black Ops III""" from protonfixes import util -def main(): - """ installs devenum, quartz, wmp9 - """ + +def main() -> None: + """Installs devenum, quartz, wmp9""" # If you have too many audio devices the game shows a black screen with audio only, this works around the issue. # https://www.reddit.com/r/blackops3/comments/3rpd4f/black_screen_with_only_audio_pc/ util.protontricks('sound=alsa') diff --git a/gamefixes-steam/311730.py b/gamefixes-steam/311730.py index 27aa9495..1a573364 100755 --- a/gamefixes-steam/311730.py +++ b/gamefixes-steam/311730.py @@ -1,13 +1,10 @@ -""" Game fix for DEAD OR ALIVE 5 Last Round -""" -#pylint: disable=C0103 +"""Game fix for DEAD OR ALIVE 5 Last Round""" from protonfixes import util -def main(): - """ Disables esync - """ +def main() -> None: + """Disables esync""" # https://github.com/ValveSoftware/Proton/issues/1834#issuecomment-433672443 util.disable_esync() util.disable_fsync() diff --git a/gamefixes-steam/312060.py b/gamefixes-steam/312060.py index 439e3861..6f64b536 100755 --- a/gamefixes-steam/312060.py +++ b/gamefixes-steam/312060.py @@ -1,13 +1,11 @@ -""" Game fix for FFXIV -""" -#pylint: disable=C0103 +"""Game fix for FFXIV""" import os from protonfixes import util -def main(): - """ FFXIV add NOSTEAM option. - """ + +def main() -> None: + """FFXIV add NOSTEAM option.""" # Fixes the startup process. if 'NOSTEAM' in os.environ: util.replace_command('-issteam', '') diff --git a/gamefixes-steam/312450.py b/gamefixes-steam/312450.py index 342e80f0..e4d6275d 100755 --- a/gamefixes-steam/312450.py +++ b/gamefixes-steam/312450.py @@ -1,13 +1,11 @@ -""" Game fix for Order of Battle: World War II +"""Game fix for Order of Battle: World War II Still missing intro video codecs """ -#pylint: disable=C0103 from protonfixes import util -def main(): - """ Install corefonts - """ +def main() -> None: + """Install corefonts""" # https://github.com/ValveSoftware/Proton/issues/639 util.protontricks('corefonts') diff --git a/gamefixes-steam/312670.py b/gamefixes-steam/312670.py index fada2f79..86aeda2c 100755 --- a/gamefixes-steam/312670.py +++ b/gamefixes-steam/312670.py @@ -1,12 +1,10 @@ -""" Game fix for Strange Brigade -""" -#pylint: disable=C0103 +"""Game fix for Strange Brigade""" from protonfixes import util -def main(): - """ This bypasses Strange Brigade's Launcher, which renders all black. - """ + +def main() -> None: + """This bypasses Strange Brigade's Launcher, which renders all black.""" # Fixes the startup process. util.replace_command('StrangeBrigade.exe', 'StrangeBrigade_Vulkan.exe') util.append_argument('-skipdrivercheck -noHDR') diff --git a/gamefixes-steam/312790.py b/gamefixes-steam/312790.py index ceec4a69..e74bc2f3 100755 --- a/gamefixes-steam/312790.py +++ b/gamefixes-steam/312790.py @@ -1,9 +1,8 @@ -""" Game fix for Agarest: Generations of War 2 -""" -#pylint: disable=C0103 +"""Game fix for Agarest: Generations of War 2""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('wmp9') util.disable_protonmediaconverter() diff --git a/gamefixes-steam/321040.py b/gamefixes-steam/321040.py index 59a13955..6f93e4c2 100755 --- a/gamefixes-steam/321040.py +++ b/gamefixes-steam/321040.py @@ -1,11 +1,8 @@ -""" Game fix for Dirt 3 Complete Edition -""" +"""Game fix for Dirt 3 Complete Edition""" from protonfixes import util -def main(): - """ installs openal as redistributable install script is borked. - """ - +def main() -> None: + """Installs openal as redistributable install script is borked.""" util.protontricks('openal') diff --git a/gamefixes-steam/328500.py b/gamefixes-steam/328500.py index ee967969..4ce9fe38 100755 --- a/gamefixes-steam/328500.py +++ b/gamefixes-steam/328500.py @@ -1,13 +1,11 @@ -""" Game fix for Potatoman Seeks the Troof -""" -#pylint: disable=C0103 +"""Game fix for Potatoman Seeks the Troof""" import os from protonfixes import util -def main(): - """ The file mms.cfg must have the string OverrideGPUValidation=1 written - """ + +def main() -> None: + """The file mms.cfg must have the string OverrideGPUValidation=1 written""" fix_installed = False prefix = util.protonprefix() macro_path = 'drive_c/windows/syswow64/Macromed/Flash' @@ -22,4 +20,4 @@ def main(): if not fix_installed: with open(mms_path, 'a', encoding='utf-8') as f: f.write('\n') - f.write("OverrideGPUValidation=1") + f.write('OverrideGPUValidation=1') diff --git a/gamefixes-steam/329380.py b/gamefixes-steam/329380.py index e28ddd22..efd82106 100755 --- a/gamefixes-steam/329380.py +++ b/gamefixes-steam/329380.py @@ -1,13 +1,10 @@ -""" Game fix Stealth Inc 2: A Game of Clones -""" -# pylint: disable=C0103 +"""Game fix Stealth Inc 2: A Game of Clones""" from protonfixes import util from protonfixes.logger import log -def main(): - """ dsound is needed for audio - """ +def main() -> None: + """Dsound is needed for audio""" log('Installing dsound') util.protontricks('dsound') diff --git a/gamefixes-steam/33990.py b/gamefixes-steam/33990.py index 220544e5..5e31d1bd 100755 --- a/gamefixes-steam/33990.py +++ b/gamefixes-steam/33990.py @@ -1,11 +1,11 @@ -""" Alternativa +"""Alternativa wmp11 (Fixes missing logo videos and problems with working videos) hangs on logo without override """ -#pylint: disable=C0103 from protonfixes import util -def main(): + +def main() -> None: util.winedll_override('libvkd3d-1', 'n') util.protontricks('wmp11') diff --git a/gamefixes-steam/34330.py b/gamefixes-steam/34330.py index a6325c72..aabd5ee2 100755 --- a/gamefixes-steam/34330.py +++ b/gamefixes-steam/34330.py @@ -1,10 +1,8 @@ -""" Total War: Shogun 2 -""" -#pylint: disable=C0103 +"""Total War: Shogun 2""" from protonfixes import util -def main(): +def main() -> None: util.protontricks('d3dx11_42') util.protontricks('d3dcompiler_43') diff --git a/gamefixes-steam/348550.py b/gamefixes-steam/348550.py index 7396186b..f780ab4a 100755 --- a/gamefixes-steam/348550.py +++ b/gamefixes-steam/348550.py @@ -1,11 +1,8 @@ -""" Game fix for Guilty Gear Accent Core Plus R -""" -#pylint: disable=C0103 +"""Game fix for Guilty Gear Accent Core Plus R""" from protonfixes import util -def main(): - """ Uses physx - """ +def main() -> None: + """Uses physx""" util.protontricks('quartz') diff --git a/gamefixes-steam/35140.py b/gamefixes-steam/35140.py index ac79c8de..5bdf0e00 100755 --- a/gamefixes-steam/35140.py +++ b/gamefixes-steam/35140.py @@ -1,13 +1,12 @@ -""" Game fix Batman Arkham Asylum - (Currently no contollers) +"""Game fix Batman Arkham Asylum +(Currently no contollers) """ -#pylint: disable=C0103 from protonfixes import util -def main(): - """ Needs windxp, dotnet35, phyzx, d3dx9 """ +def main() -> None: + """Needs windxp, dotnet35, phyzx, d3dx9""" # Probably not needed when proton will be merged with newer wine # TODO Controllers fixes util.protontricks('d3dcompiler_43') diff --git a/gamefixes-steam/351710.py b/gamefixes-steam/351710.py index 9f74a897..b18fb4dd 100755 --- a/gamefixes-steam/351710.py +++ b/gamefixes-steam/351710.py @@ -1,10 +1,10 @@ -""" Hyperdimension Neptunia Re;Birth2 +"""Hyperdimension Neptunia Re;Birth2 Poor performance on some AMD hardware """ -#pylint: disable=C0103 from protonfixes import util -def main(): + +def main() -> None: util.set_environment('radeonsi_disable_sam', 'true') util.set_environment('AMD_DEBUG', 'nowc') diff --git a/gamefixes-steam/356190.py b/gamefixes-steam/356190.py index 96544648..67a7391e 100755 --- a/gamefixes-steam/356190.py +++ b/gamefixes-steam/356190.py @@ -1,9 +1,8 @@ -""" Game fix Shadow of War -""" -#pylint: disable=C0103 +"""Game fix Shadow of War""" from protonfixes import util -def main(): + +def main() -> None: # Requires vcrun2019 to launch util.protontricks('vcrun2019') diff --git a/gamefixes-steam/356500.py b/gamefixes-steam/356500.py index 13445cd7..1fd45d8f 100755 --- a/gamefixes-steam/356500.py +++ b/gamefixes-steam/356500.py @@ -1,10 +1,8 @@ -""" Game fix for STAR WARS Galactic Battlegrounds Saga -""" - -#pylint: disable=C0103 +"""Game fix for STAR WARS Galactic Battlegrounds Saga""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('icodecs') util.protontricks('directplay') diff --git a/gamefixes-steam/3590.py b/gamefixes-steam/3590.py index 3cf9f168..9b3fde62 100755 --- a/gamefixes-steam/3590.py +++ b/gamefixes-steam/3590.py @@ -1,13 +1,11 @@ -""" Game fix for Plants vs. Zombies: Game of the Year +"""Game fix for Plants vs. Zombies: Game of the Year Source: https://github.com/JamesHealdUK/protonfixes/blob/master/fixes/3590.sh """ -#pylint: disable=C0103 from protonfixes import util -def main(): - """ Changes the proton argument from the launcher to the game - """ +def main() -> None: + """Changes the proton argument from the launcher to the game""" # Game expects this to be set util.append_argument('-changedir') diff --git a/gamefixes-steam/359550.py b/gamefixes-steam/359550.py index 32c36895..e7160a30 100755 --- a/gamefixes-steam/359550.py +++ b/gamefixes-steam/359550.py @@ -1,12 +1,9 @@ -""" Rainbow Six Siege -""" -#pylint: disable=C0103 +"""Rainbow Six Siege""" from protonfixes import util -def main(): - """ Rainbow Six Siege needs vk_x11_override_min_image_count=2 for AMD, and overlay disabled for Vulkan - """ +def main() -> None: + """Rainbow Six Siege needs vk_x11_override_min_image_count=2 for AMD, and overlay disabled for Vulkan""" util.disable_uplay_overlay() util.set_environment('vk_x11_override_min_image_count', '2') diff --git a/gamefixes-steam/359870.py b/gamefixes-steam/359870.py index eebc96d5..7a167497 100755 --- a/gamefixes-steam/359870.py +++ b/gamefixes-steam/359870.py @@ -1,16 +1,18 @@ -""" Game fix for FFX/X-2 HD Remaster -""" -#pylint: disable=C0103 +"""Game fix for FFX/X-2 HD Remaster""" import os from protonfixes import util -def main(): + +def main() -> None: # disable new character intro cutscene to prevent black screen loop - configpath = os.path.join(util.protonprefix(), 'drive_c/users/steamuser/My Documents/SQUARE ENIX/FINAL FANTASY X&X-2 HD Remaster') + configpath = os.path.join( + util.protonprefix(), + 'drive_c/users/steamuser/My Documents/SQUARE ENIX/FINAL FANTASY X&X-2 HD Remaster', + ) if not os.path.exists(configpath): os.makedirs(configpath) configgame = os.path.join(configpath, 'GameSetting.ini') if not os.path.isfile(configgame): - with open(configgame,"w+", encoding='utf-8') as f: - f.write("Language=en") + with open(configgame, 'w+', encoding='utf-8') as f: + f.write('Language=en') diff --git a/gamefixes-steam/366250.py b/gamefixes-steam/366250.py index 3b9e9410..bb8ea0d9 100755 --- a/gamefixes-steam/366250.py +++ b/gamefixes-steam/366250.py @@ -1,8 +1,7 @@ -""" Metal Slug -""" -#pylint: disable=C0103 +"""Metal Slug""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('d3dcompiler_46') diff --git a/gamefixes-steam/371660.py b/gamefixes-steam/371660.py index 812f1df0..71ac4558 100755 --- a/gamefixes-steam/371660.py +++ b/gamefixes-steam/371660.py @@ -1,12 +1,8 @@ -""" Far Cry Primal -""" -#pylint: disable=C0103 +"""Far Cry Primal""" from protonfixes import util -def main(): - """ chokes on more than 31 cores - """ - +def main() -> None: + """Chokes on more than 31 cores""" util.set_cpu_topology_limit(31) diff --git a/gamefixes-steam/372000.py b/gamefixes-steam/372000.py index 00ba5352..7654828a 100755 --- a/gamefixes-steam/372000.py +++ b/gamefixes-steam/372000.py @@ -1,10 +1,8 @@ -""" Game fix Tree Of Savior -""" -#pylint: disable=C0103 +"""Game fix Tree Of Savior""" from protonfixes import util -def main(): - """ https://forum.treeofsavior.com/t/linux-the-graphic-card-does-not-support-directx11-13ep/418073/13 - """ + +def main() -> None: + """https://forum.treeofsavior.com/t/linux-the-graphic-card-does-not-support-directx11-13ep/418073/13""" util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/377160.py b/gamefixes-steam/377160.py index 1e46d7fd..428455e5 100755 --- a/gamefixes-steam/377160.py +++ b/gamefixes-steam/377160.py @@ -1,14 +1,11 @@ -""" Game fix for Fallout 4 -""" -#pylint: disable=C0103 +"""Game fix for Fallout 4""" import os from protonfixes import util -def main(): - """ Run script extender if it exists. - """ +def main() -> None: + """Run script extender if it exists.""" # Fixes the startup process. if os.path.isfile(os.path.join(os.getcwd(), 'f4se_loader.exe')): util.replace_command('Fallout4Launcher.exe', 'f4se_loader.exe') diff --git a/gamefixes-steam/377840.py b/gamefixes-steam/377840.py index b8462a95..08e03e77 100755 --- a/gamefixes-steam/377840.py +++ b/gamefixes-steam/377840.py @@ -1,13 +1,10 @@ -""" Game fix for FINAL FANTASY IX -""" -#pylint: disable=C0103 +"""Game fix for FINAL FANTASY IX""" from protonfixes import util -def main(): - """ Changes the proton argument from the launcher to the game - """ +def main() -> None: + """Changes the proton argument from the launcher to the game""" # Fix crackling audio util.set_environment('PULSE_LATENCY_MSEC', '60') diff --git a/gamefixes-steam/378630.py b/gamefixes-steam/378630.py index a4e09d81..6e6a6732 100755 --- a/gamefixes-steam/378630.py +++ b/gamefixes-steam/378630.py @@ -1,11 +1,11 @@ -""" Shadows on the Vatican - Act II: Wrath +"""Shadows on the Vatican - Act II: Wrath Launcher keeps it's process running in the background but nothing shows up """ -#pylint: disable=C0103 import os from protonfixes import util -def main(): + +def main() -> None: util.replace_command('SotV_Launcher.exe', 'hd/SotV2.exe') os.chdir('hd') diff --git a/gamefixes-steam/379720.py b/gamefixes-steam/379720.py index 4a475f41..d31cd39f 100755 --- a/gamefixes-steam/379720.py +++ b/gamefixes-steam/379720.py @@ -1,6 +1,5 @@ -""" Game fix for Doom 2016 -""" -#pylint: disable=C0103 +"""Game fix for Doom 2016""" + import os import shutil import urllib.request @@ -9,19 +8,21 @@ from protonfixes import util -def main(): - """ Enable preload options - """ - +def main() -> None: + """Enable preload options""" # Enable preload options util.append_argument('+r_renderAPI 1') installpath = os.path.abspath(os.getcwd()) - url = "https://github.com/Riesi/CChromaEditor/files/2277158/CChromaEditorLibrary.zip" + url = ( + 'https://github.com/Riesi/CChromaEditor/files/2277158/CChromaEditorLibrary.zip' + ) if not os.path.isfile(os.path.join(installpath, 'CChromaEditorLibrary.dll.bak')): - urllib.request.urlretrieve (url, "CChromaEditorLibrary.zip") - shutil.move(os.path.join(installpath, 'CChromaEditorLibrary.dll'), - os.path.join(installpath, 'CChromaEditorLibrary.dll.bak')) - with zipfile.ZipFile("CChromaEditorLibrary.zip", "r") as zip_ref: + urllib.request.urlretrieve(url, 'CChromaEditorLibrary.zip') + shutil.move( + os.path.join(installpath, 'CChromaEditorLibrary.dll'), + os.path.join(installpath, 'CChromaEditorLibrary.dll.bak'), + ) + with zipfile.ZipFile('CChromaEditorLibrary.zip', 'r') as zip_ref: zip_ref.extractall(installpath) diff --git a/gamefixes-steam/386360.py b/gamefixes-steam/386360.py index 4e69c931..868bc435 100755 --- a/gamefixes-steam/386360.py +++ b/gamefixes-steam/386360.py @@ -1,6 +1,4 @@ -""" Game fix for Smite -""" -#pylint: disable=C0103 +"""Game fix for Smite""" import glob import os @@ -8,14 +6,27 @@ from protonfixes import util -def main(): - """ Fix EAC location in smite - """ +def main() -> None: + """Fix EAC location in smite""" install_dir = glob.escape(util.get_game_install_path()) # Fix EAC incorrect location: if not os.path.exists(install_dir + '/Win64/EasyAntiCheat/easyanticheat_x64.so'): - subprocess.call(['ln', '-s', install_dir + '/EasyAntiCheat/easyanticheat_x64.so', install_dir + '/Win64/EasyAntiCheat/']) + subprocess.call( + [ + 'ln', + '-s', + install_dir + '/EasyAntiCheat/easyanticheat_x64.so', + install_dir + '/Win64/EasyAntiCheat/', + ] + ) if not os.path.exists(install_dir + '/Win32/EasyAntiCheat/easyanticheat_x86.so'): - subprocess.call(['ln', '-s', install_dir + '/EasyAntiCheat/easyanticheat_x86.so', install_dir + '/Win32/EasyAntiCheat/']) + subprocess.call( + [ + 'ln', + '-s', + install_dir + '/EasyAntiCheat/easyanticheat_x86.so', + install_dir + '/Win32/EasyAntiCheat/', + ] + ) diff --git a/gamefixes-steam/388750.py b/gamefixes-steam/388750.py index 80bc28e6..b81050ca 100755 --- a/gamefixes-steam/388750.py +++ b/gamefixes-steam/388750.py @@ -1,13 +1,10 @@ -""" Game fix for Chronophantasma Extend -""" -#pylint: disable=C0103 +"""Game fix for Chronophantasma Extend""" from protonfixes import util -def main(): - """ Uses installs devenum wmp9 - """ +def main() -> None: + """Uses installs devenum wmp9""" # https://github.com/ValveSoftware/Proton/issues/703#issuecomment-416075961 util.protontricks('devenum') - util.protontricks("wmp9") + util.protontricks('wmp9') diff --git a/gamefixes-steam/390710.py b/gamefixes-steam/390710.py index 270b4734..4cb5f164 100755 --- a/gamefixes-steam/390710.py +++ b/gamefixes-steam/390710.py @@ -1,12 +1,9 @@ -""" Game fix for SUGURI 2 -""" -#pylint: disable=C0103 +"""Game fix for SUGURI 2""" from protonfixes import util -def main(): - """ Installs d3dxof - """ +def main() -> None: + """Installs d3dxof""" # https://github.com/ValveSoftware/Proton/issues/970#issuecomment-420421289 util.protontricks('d3dxof') diff --git a/gamefixes-steam/39140.py b/gamefixes-steam/39140.py index c8e80409..dd57e95c 100755 --- a/gamefixes-steam/39140.py +++ b/gamefixes-steam/39140.py @@ -1,13 +1,10 @@ -""" Game fix for Final Fantasy VII -""" -#pylint: disable=C0103 +"""Game fix for Final Fantasy VII""" from protonfixes import util -def main(): - """ installs vcrun2019 and d3dcompiler47 - """ +def main() -> None: + """Installs vcrun2019 and d3dcompiler47""" # FFVII needs vcrun2019 and d3dcompiler_47 util.protontricks('vcrun2019') util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/39210.py b/gamefixes-steam/39210.py index 439e3861..6f64b536 100755 --- a/gamefixes-steam/39210.py +++ b/gamefixes-steam/39210.py @@ -1,13 +1,11 @@ -""" Game fix for FFXIV -""" -#pylint: disable=C0103 +"""Game fix for FFXIV""" import os from protonfixes import util -def main(): - """ FFXIV add NOSTEAM option. - """ + +def main() -> None: + """FFXIV add NOSTEAM option.""" # Fixes the startup process. if 'NOSTEAM' in os.environ: util.replace_command('-issteam', '') diff --git a/gamefixes-steam/39500.py b/gamefixes-steam/39500.py index 1a54e474..be94ed27 100755 --- a/gamefixes-steam/39500.py +++ b/gamefixes-steam/39500.py @@ -1,18 +1,15 @@ -""" Game fix for Gothic 3 -""" -#pylint: disable=C0103 +"""Game fix for Gothic 3""" import os from protonfixes import util -def main(): - """ Modify ge3.ini - """ +def main() -> None: + """Modify ge3.ini""" game_opts = """ [Engine.Setup] Timer.ThreadSafe=false FpS.Max=0 """ - util.set_ini_options(game_opts,os.path.join('Ini','ge3.ini'),'cp1251','game') + util.set_ini_options(game_opts, os.path.join('Ini', 'ge3.ini'), 'cp1251', 'game') diff --git a/gamefixes-steam/39690.py b/gamefixes-steam/39690.py index ca112f07..d70ddbd3 100755 --- a/gamefixes-steam/39690.py +++ b/gamefixes-steam/39690.py @@ -1,12 +1,8 @@ -""" Game fix for Arkania -""" - -# pylint: disable=C0103 +"""Game fix for Arkania""" from protonfixes import util -def main(): - +def main() -> None: # This requires Proton 5.0 installed util.protontricks('wmp11') diff --git a/gamefixes-steam/397540.py b/gamefixes-steam/397540.py index 0f2bfdc2..68490f61 100755 --- a/gamefixes-steam/397540.py +++ b/gamefixes-steam/397540.py @@ -1,12 +1,10 @@ -""" Game fix for Borderlands 3 -""" -#pylint: disable=C0103 +"""Game fix for Borderlands 3""" + from protonfixes import util -def main(): - """ Borderlands 3 vcrun2019 fix - """ +def main() -> None: + """Borderlands 3 vcrun2019 fix""" # Fixes the startup process. util.protontricks('vcrun2019') util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/40800.py b/gamefixes-steam/40800.py index b9d440ce..c3ad29ec 100755 --- a/gamefixes-steam/40800.py +++ b/gamefixes-steam/40800.py @@ -1,12 +1,10 @@ -""" Game fix for Super Meat Boy -""" -#pylint: disable=C0103 +"""Game fix for Super Meat Boy""" + # from protonfixes import util -def main(): - """ installs d3dcompiler, xact - """ +def main() -> None: + """Installs d3dcompiler, xact""" util.protontricks('d3dcompiler_47') util.protontricks('xact') diff --git a/gamefixes-steam/409090.py b/gamefixes-steam/409090.py index 0227c248..b629685d 100755 --- a/gamefixes-steam/409090.py +++ b/gamefixes-steam/409090.py @@ -1,18 +1,25 @@ -""" The Big Secret of a Small Town +"""The Big Secret of a Small Town No cursor or double cursor selecting custom cursor in options PROTON_USE_WINED3D=1 fixes the problem but removes the antialising dgvoodoo2 fixes the cursors and keeps the antialising copy dgvoodoo2 d3d9.dll every time otherwise it gets overwritten """ -#pylint: disable=C0103 import os import subprocess import shutil from protonfixes import util -def main(): + +def main() -> None: syswow64 = os.path.join(util.protonprefix(), 'drive_c/windows/syswow64') if util.protontricks('dgvoodoo2'): - subprocess.call([f"sed -i '/[DirectX]/ {{/Resolution/s/max/unforced/}}' {syswow64}/dgvoodoo.conf"], shell=True) - shutil.copy(os.path.join(syswow64, 'dgd3d9.dll'),os.path.join(syswow64, 'd3d9.dll')) + subprocess.call( + [ + f"sed -i '/[DirectX]/ {{/Resolution/s/max/unforced/}}' {syswow64}/dgvoodoo.conf" + ], + shell=True, + ) + shutil.copy( + os.path.join(syswow64, 'dgd3d9.dll'), os.path.join(syswow64, 'd3d9.dll') + ) diff --git a/gamefixes-steam/40950.py b/gamefixes-steam/40950.py index 042d2586..df5a4416 100755 --- a/gamefixes-steam/40950.py +++ b/gamefixes-steam/40950.py @@ -1,13 +1,10 @@ -""" Game fix for Stronghold HD +"""Game fix for Stronghold HD Fixes Multiplayer """ -# pylint: disable=C0103 from protonfixes import util -def main(): - """ Installs directplay - """ - +def main() -> None: + """Installs directplay""" util.protontricks('directplay') diff --git a/gamefixes-steam/40970.py b/gamefixes-steam/40970.py index 3ac324a6..6bd49bbb 100755 --- a/gamefixes-steam/40970.py +++ b/gamefixes-steam/40970.py @@ -1,14 +1,10 @@ -""" Game fix for Stronghold Crusader HD +"""Game fix for Stronghold Crusader HD Fixes Multiplayer """ -# pylint: disable=C0103 - from protonfixes import util -def main(): - """ Installs directplay - """ - +def main() -> None: + """Installs directplay""" util.protontricks('directplay') diff --git a/gamefixes-steam/409720.py b/gamefixes-steam/409720.py index b5aca1f7..917b84b5 100755 --- a/gamefixes-steam/409720.py +++ b/gamefixes-steam/409720.py @@ -1,13 +1,10 @@ -""" Game fix for BioShock 2 Remastered -""" -#pylint: disable=C0103 +"""Game fix for BioShock 2 Remastered""" from protonfixes import util -def main(): - """ Disable ESYNC, disable intro's - """ +def main() -> None: + """Disable ESYNC, disable intro's""" # After loading the game, or a save file, a key needs to be pressed # to continue. That screen does not respond to keyboard or mouse, # so there is no way to continue. -nointro disables that screen diff --git a/gamefixes-steam/410900.py b/gamefixes-steam/410900.py index a14f16d7..37cec684 100755 --- a/gamefixes-steam/410900.py +++ b/gamefixes-steam/410900.py @@ -1,11 +1,8 @@ -""" Game fix for Forts -""" -#pylint: disable=C0103 +"""Game fix for Forts""" from protonfixes import util -def main(): - """ Uses winetricks to install the ole32 verb - """ +def main() -> None: + """Uses winetricks to install the ole32 verb""" util.protontricks('ole32') diff --git a/gamefixes-steam/424840.py b/gamefixes-steam/424840.py index 1d6a4b0f..ea624bc6 100755 --- a/gamefixes-steam/424840.py +++ b/gamefixes-steam/424840.py @@ -1,13 +1,10 @@ -""" Game fix for Little Nightmares -""" -# pylint: disable=C0103 +"""Game fix for Little Nightmares""" from protonfixes import util -def main(): - """ Add launch parameter - """ +def main() -> None: + """Add launch parameter""" # The game crashes if running with more than one CPU thread, # adding "-onethread" will force the game to use only one CPU thread util.append_argument('-onethread') diff --git a/gamefixes-steam/428660.py b/gamefixes-steam/428660.py index 846ca1e0..f562699f 100755 --- a/gamefixes-steam/428660.py +++ b/gamefixes-steam/428660.py @@ -1,9 +1,10 @@ -""" Deliver us the Moon fix -""" -#pylint: disable=C0103 +"""Deliver us the Moon fix""" from protonfixes import util -def main(): + +def main() -> None: # Replace launcher with game exe in proton arguments - util.replace_command('MoonMan.exe', 'MoonMan/Binaries/Win64/MoonMan-Win64-Shipping.exe') + util.replace_command( + 'MoonMan.exe', 'MoonMan/Binaries/Win64/MoonMan-Win64-Shipping.exe' + ) diff --git a/gamefixes-steam/429720.py b/gamefixes-steam/429720.py index 8015aaac..01b39cd6 100755 --- a/gamefixes-steam/429720.py +++ b/gamefixes-steam/429720.py @@ -1,13 +1,11 @@ -""" Game fix for IMSCARED -""" - -#pylint: disable=C0103 +"""Game fix for IMSCARED""" import os import getpass from protonfixes import util -def main(): + +def main() -> None: # IMSCARED relies on a folder on the user's Desktop being accessible # The problem is that all of the folders in Proton are sandboxed # So this protonfix works around that diff --git a/gamefixes-steam/43110.py b/gamefixes-steam/43110.py index 7ab05729..e8f3da09 100755 --- a/gamefixes-steam/43110.py +++ b/gamefixes-steam/43110.py @@ -1,13 +1,10 @@ -""" Game fix for Metro 2033 -""" -#pylint: disable=C0103 +"""Game fix for Metro 2033""" from protonfixes import util -def main(): - """ Installs d3dx11_42 - """ +def main() -> None: + """Installs d3dx11_42""" # Fixes D3D10 and D3D11 render path crash on launch. util.protontricks('d3dx11_42') util.protontricks('d3dcompiler_42') diff --git a/gamefixes-steam/434570.py b/gamefixes-steam/434570.py index 5318a1cf..8f04d388 100755 --- a/gamefixes-steam/434570.py +++ b/gamefixes-steam/434570.py @@ -1,9 +1,7 @@ -""" Game fix for Blood and Bacon -""" - -#pylint: disable=C0103 +"""Game fix for Blood and Bacon""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('dotnet40') diff --git a/gamefixes-steam/436670.py b/gamefixes-steam/436670.py index e64a90fc..0fd11bca 100644 --- a/gamefixes-steam/436670.py +++ b/gamefixes-steam/436670.py @@ -1,11 +1,10 @@ -""" Game fix for The Legend of Heroes: Trails in the Sky the 3rd -""" -# pylint: disable=C0103 +"""Game fix for The Legend of Heroes: Trails in the Sky the 3rd""" from protonfixes import util -def main(): - util.protontricks('quartz') # Cutscene fixes + +def main() -> None: + util.protontricks('quartz') # Cutscene fixes util.protontricks('amstream') util.protontricks('lavfilters') - util.winedll_override('dinput8', 'n,b') # Set for the SoraVoice mod + util.winedll_override('dinput8', 'n,b') # Set for the SoraVoice mod diff --git a/gamefixes-steam/440900.py b/gamefixes-steam/440900.py index 4b097001..5c272184 100755 --- a/gamefixes-steam/440900.py +++ b/gamefixes-steam/440900.py @@ -1,14 +1,13 @@ -""" Game fix for Conan Exiles -""" -#pylint: disable=C0103 +"""Game fix for Conan Exiles""" from protonfixes import util -def main(): - """ Launcher workaround - """ +def main() -> None: + """Launcher workaround""" # Fixes the startup process. util.install_battleye_runtime() - util.replace_command('FuncomLauncher.exe', '../ConanSandbox/Binaries/Win64/ConanSandbox.exe') + util.replace_command( + 'FuncomLauncher.exe', '../ConanSandbox/Binaries/Win64/ConanSandbox.exe' + ) util.append_argument('-BattlEye') diff --git a/gamefixes-steam/44690.py b/gamefixes-steam/44690.py index a49f1eaa..13583845 100755 --- a/gamefixes-steam/44690.py +++ b/gamefixes-steam/44690.py @@ -1,11 +1,8 @@ -""" Game fix for GT Legends -""" -#pylint: disable=C0103 +"""Game fix for GT Legends""" from protonfixes import util -def main(): - """ installs mfc42 - """ +def main() -> None: + """Installs mfc42""" util.protontricks('mfc42') diff --git a/gamefixes-steam/447040.py b/gamefixes-steam/447040.py index 00dbf675..f8fc893e 100755 --- a/gamefixes-steam/447040.py +++ b/gamefixes-steam/447040.py @@ -1,10 +1,9 @@ """Game fix for Watch_Dogs 2""" -# pylint: disable=C0103 from protonfixes import util -def main(): +def main() -> None: """Disable Easy Anti-Cheat and online play""" # Replace launcher with game exe in proton arguments - util.append_argument("-eac_launcher -nosplash") + util.append_argument('-eac_launcher -nosplash') diff --git a/gamefixes-steam/452440.py b/gamefixes-steam/452440.py index e5eaeb4e..722d8f70 100644 --- a/gamefixes-steam/452440.py +++ b/gamefixes-steam/452440.py @@ -15,34 +15,34 @@ from protonfixes.logger import log -def main(): +def main() -> None: env = protonmain.g_session.env.copy() - wine = f"{util.protondir()}/files/bin/wine64" + wine = f'{util.protondir()}/files/bin/wine64' install_dir = util.get_game_install_path() # Font installer inside the `fonts` subdir - font_installer = "overlock_mod_font_installer.exe" + font_installer = 'overlock_mod_font_installer.exe' # Digest of the font installer - hashsum = "d3bd48162d91322c3d2861cdccc538955336eff7f0fe50eeafee1b7551a52152" + hashsum = 'd3bd48162d91322c3d2861cdccc538955336eff7f0fe50eeafee1b7551a52152' - if os.path.isfile(f"{util.protonprefix()}/drive_c/windows/Fonts/Overlock-Mod.ttf"): + if os.path.isfile(f'{util.protonprefix()}/drive_c/windows/Fonts/Overlock-Mod.ttf'): log.info("Font 'Overlock-Mod.ttf' already installed in prefix, skipping...") return - if not os.path.isfile(f"{install_dir}/font/{font_installer}"): + if not os.path.isfile(f'{install_dir}/font/{font_installer}'): log.warn(f"Could not find '{font_installer}' in '{install_dir}', skipping...") return - with open(f"{install_dir}/font/{font_installer}", mode="rb") as file: + with open(f'{install_dir}/font/{font_installer}', mode='rb') as file: if sha256(file.read()).hexdigest() != hashsum: - log.warn(f"Digest mismatched: {font_installer}") + log.warn(f'Digest mismatched: {font_installer}') log.warn(f"Expected '{hashsum}', skipping...") return log.info("Installing font 'Overlock-Mod.ttf' in prefix...") retc = run( - [wine, "start", "/unix", f"{install_dir}/font/{font_installer}", "/silent"], + [wine, 'start', '/unix', f'{install_dir}/font/{font_installer}', '/silent'], check=False, env=env, ).returncode diff --git a/gamefixes-steam/45750.py b/gamefixes-steam/45750.py index 3c4b864d..a0292dcd 100755 --- a/gamefixes-steam/45750.py +++ b/gamefixes-steam/45750.py @@ -1,13 +1,13 @@ -""" Game fix for Lost Planet 2 (2010) +"""Game fix for Lost Planet 2 (2010) This game requires two fixes to work: 1. A mocked xlive.dll for GFWL (multiplayer will not work, but the single player does) 2. No more than 12 CPU cores (on PCGamingWiki is described as 6, but on my personal test I was able to set until 12 of 16) [source: https://www.pcgamingwiki.com/wiki/Lost_Planet_2#Alternate_solution_for_high_core_CPUs] """ -#pylint: disable=C0103 from protonfixes import util -def main(): + +def main() -> None: util.protontricks('xliveless') # According to PCGW, no more than 6 physical cores work diff --git a/gamefixes-steam/460120.py b/gamefixes-steam/460120.py index 0adeb7be..ab7b2f52 100755 --- a/gamefixes-steam/460120.py +++ b/gamefixes-steam/460120.py @@ -1,12 +1,12 @@ -""" Game fix for Megadimension Neptunia VII -""" -#pylint: disable=C0103 +"""Game fix for Megadimension Neptunia VII""" + # from protonfixes import util -#Fixes cinematics not showing or spawning in a different window -#also fixes cinematics not playing sound -def main(): + +# Fixes cinematics not showing or spawning in a different window +# also fixes cinematics not playing sound +def main() -> None: util.protontricks('quartz_feb2010') util.protontricks('wmp11') util.protontricks('qasf') diff --git a/gamefixes-steam/46500.py b/gamefixes-steam/46500.py index 7562c3e1..750bb4b0 100755 --- a/gamefixes-steam/46500.py +++ b/gamefixes-steam/46500.py @@ -1,14 +1,12 @@ -""" Game fix for Syberia -""" -#pylint: disable=C0103 +"""Game fix for Syberia""" import os import subprocess -def main(): - """ needs player.ini to prevent black screen on load - """ + +def main() -> None: + """Needs player.ini to prevent black screen on load""" if not os.path.isfile('player.ini'): subprocess.call(['touch', 'player.ini']) - with open('player.ini',"w+", encoding='utf-8') as f: - f.write("800 600 32 0 BaseCMO.cmo") + with open('player.ini', 'w+', encoding='utf-8') as f: + f.write('800 600 32 0 BaseCMO.cmo') diff --git a/gamefixes-steam/465280.py b/gamefixes-steam/465280.py index 8fa42312..d1bd601b 100755 --- a/gamefixes-steam/465280.py +++ b/gamefixes-steam/465280.py @@ -1,12 +1,9 @@ -""" Game fix for Yesterday Origins -""" -#pylint: disable=C0103 +"""Game fix for Yesterday Origins""" from protonfixes import util -def main(): - """ Set to win7 - """ +def main() -> None: + """Set to win7""" # Fixes black screen during cutscenes. util.protontricks('win7') diff --git a/gamefixes-steam/465840.py b/gamefixes-steam/465840.py index c91ac135..e4af6334 100644 --- a/gamefixes-steam/465840.py +++ b/gamefixes-steam/465840.py @@ -1,9 +1,7 @@ -""" -The Last Blade -""" -#pylint: disable=C0103 +"""The Last Blade""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('d3dcompiler_46') diff --git a/gamefixes-steam/4730.py b/gamefixes-steam/4730.py index 0297c5cb..0db01f48 100644 --- a/gamefixes-steam/4730.py +++ b/gamefixes-steam/4730.py @@ -1,9 +1,8 @@ -""" Outrun 2006: Coast 2 Coast -""" -#pylint: disable=C0103 +"""Outrun 2006: Coast 2 Coast""" from protonfixes import util + # Fix water rendering as black -def main(): +def main() -> None: util.protontricks('d3dx9') diff --git a/gamefixes-steam/48190.py b/gamefixes-steam/48190.py index 2361416c..38e80a64 100755 --- a/gamefixes-steam/48190.py +++ b/gamefixes-steam/48190.py @@ -1,10 +1,10 @@ -""" Game fix for Assassin's Creed: Brotherhood +"""Game fix for Assassin's Creed: Brotherhood Game uses an old customized Ubisoft launcher that's currently not working with Proton. """ -#pylint: disable=C0103 from protonfixes import util -def main(): + +def main() -> None: util.append_argument('-playoffline') diff --git a/gamefixes-steam/489830.py b/gamefixes-steam/489830.py index 5e2cd72f..6a274ecd 100755 --- a/gamefixes-steam/489830.py +++ b/gamefixes-steam/489830.py @@ -1,13 +1,11 @@ -""" Game fix for Skyrim SE -""" -#pylint: disable=C0103 +"""Game fix for Skyrim SE""" import os from protonfixes import util -def main(): - """ Run script extender if it exists. - """ + +def main() -> None: + """Run script extender if it exists.""" if os.path.isfile(os.path.join(os.getcwd(), 'skse64_loader.exe')): if 'MODS' in os.environ: util.replace_command('SkyrimSELauncher.exe', 'skse64_loader.exe') diff --git a/gamefixes-steam/49520.py b/gamefixes-steam/49520.py index 0674b46a..8eee00d7 100755 --- a/gamefixes-steam/49520.py +++ b/gamefixes-steam/49520.py @@ -1,13 +1,10 @@ -""" Game fix for Borderlands 2 -""" -#pylint: disable=C0103 +"""Game fix for Borderlands 2""" from protonfixes import util -def main(): - """ Launcherfix and NVIDIA PhysX support. - """ +def main() -> None: + """Launcherfix and NVIDIA PhysX support.""" # Fixes the startup process. util.replace_command('Launcher.exe', 'Borderlands2.exe') util.append_argument('-NoSplash') diff --git a/gamefixes-steam/495420.py b/gamefixes-steam/495420.py index 4412b50d..6042b406 100755 --- a/gamefixes-steam/495420.py +++ b/gamefixes-steam/495420.py @@ -1,11 +1,9 @@ -""" Game fix for State of Decay 2 -""" -#pylint: disable=C0103 +"""Game fix for State of Decay 2""" from protonfixes import util -def main(): - """ Fix game crashes with d3dcompiler_47 and multiplayer crashes with win7 - """ + +def main() -> None: + """Fix game crashes with d3dcompiler_47 and multiplayer crashes with win7""" util.protontricks('d3dcompiler_47') util.protontricks('win7') diff --git a/gamefixes-steam/497360.py b/gamefixes-steam/497360.py index 60d07b17..4ed5fe3f 100644 --- a/gamefixes-steam/497360.py +++ b/gamefixes-steam/497360.py @@ -1,4 +1,4 @@ -""" Gabriel Knight 3: Blood of the Sacred, Blood of the Damned +"""Gabriel Knight 3: Blood of the Sacred, Blood of the Damned Fix for Insert CD Fixes graphical issues Video errors in Sydney @@ -6,37 +6,93 @@ Widescreen supported (16:9/21:9, 32:9 not tested) """ -#pylint: disable=C0103 - import os import subprocess from protonfixes import util -def main(): + +def main() -> None: dosdevice = os.path.join(util.protonprefix(), 'dosdevices/r:') if not os.path.exists(dosdevice): - os.symlink('/tmp', dosdevice) #create symlink for dosdevices - util.regedit_add("HKLM\\Software\\Wine\\Drives",'r:','REG_SZ','cdrom', True) #designate drive as CD-ROM, requires 64-bit access + os.symlink('/tmp', dosdevice) # create symlink for dosdevices + util.regedit_add( + 'HKLM\\Software\\Wine\\Drives', 'r:', 'REG_SZ', 'cdrom', True + ) # designate drive as CD-ROM, requires 64-bit access util.protontricks('quartz') util.protontricks('amstream') - #No errors but doesn't show videos on SYDNEY - #util.protontricks('lavfilters') - #Show videos but green background is visible + # No errors but doesn't show videos on SYDNEY + # util.protontricks('lavfilters') + # Show videos but green background is visible util.protontricks('klite') syswow64 = os.path.join(util.protonprefix(), 'drive_c/windows/syswow64') if util.protontricks('dgvoodoo2'): - screen_width,screen_height = util.get_resolution() + screen_width, screen_height = util.get_resolution() width = int(screen_width / screen_height * 768 // 1) - subprocess.call([f"sed -i '/[DirectX]/ {{/Resolution/s/max/{width}x768/}}' {syswow64}/dgvoodoo.conf"], shell=True) - subprocess.call([f"sed -i '/[DirectXExt]/ {{/ExtraEnumeratedResolutions/s/= /= {width}x768,/}}' {syswow64}/dgvoodoo.conf"], shell=True) + subprocess.call( + [ + f"sed -i '/[DirectX]/ {{/Resolution/s/max/{width}x768/}}' {syswow64}/dgvoodoo.conf" + ], + shell=True, + ) + subprocess.call( + [ + f"sed -i '/[DirectXExt]/ {{/ExtraEnumeratedResolutions/s/= /= {width}x768,/}}' {syswow64}/dgvoodoo.conf" + ], + shell=True, + ) util.regedit_add('HKCU\\Software\\Sierra On-Line') util.regedit_add('HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3') - util.regedit_add('HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3\\App','Run Count','REG_DWORD','0x1') - util.regedit_add('HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3\\Engine','Full Screen','REG_DWORD','0x1') - util.regedit_add('HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3\\Engine','Monitor','REG_DWORD','0x0') - util.regedit_add('HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3\\Engine','Rasterizer','REG_SZ','detect') - util.regedit_add('HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3\\Engine','Rasterizer GUID','REG_SZ','{00000000-0000-0000-0000-000000000000}') - util.regedit_add('HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3\\Engine','Screen Height','REG_DWORD','0x300') - util.regedit_add('HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3\\Engine','Screen Width','REG_DWORD',hex(width)) - util.regedit_add('HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3\\Engine\\Hardware','Gamma','REG_SZ','1.5') - util.regedit_add('HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3\\Engine\\Hardware','Surface Quality','REG_SZ','High') + util.regedit_add( + 'HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3\\App', + 'Run Count', + 'REG_DWORD', + '0x1', + ) + util.regedit_add( + 'HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3\\Engine', + 'Full Screen', + 'REG_DWORD', + '0x1', + ) + util.regedit_add( + 'HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3\\Engine', + 'Monitor', + 'REG_DWORD', + '0x0', + ) + util.regedit_add( + 'HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3\\Engine', + 'Rasterizer', + 'REG_SZ', + 'detect', + ) + util.regedit_add( + 'HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3\\Engine', + 'Rasterizer GUID', + 'REG_SZ', + '{00000000-0000-0000-0000-000000000000}', + ) + util.regedit_add( + 'HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3\\Engine', + 'Screen Height', + 'REG_DWORD', + '0x300', + ) + util.regedit_add( + 'HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3\\Engine', + 'Screen Width', + 'REG_DWORD', + hex(width), + ) + util.regedit_add( + 'HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3\\Engine\\Hardware', + 'Gamma', + 'REG_SZ', + '1.5', + ) + util.regedit_add( + 'HKCU\\Software\\Sierra On-Line\\Gabriel Knight 3\\Engine\\Hardware', + 'Surface Quality', + 'REG_SZ', + 'High', + ) diff --git a/gamefixes-steam/508980.py b/gamefixes-steam/508980.py index ad7a5846..f5de81a9 100755 --- a/gamefixes-steam/508980.py +++ b/gamefixes-steam/508980.py @@ -1,21 +1,19 @@ -""" Game fix for Crashday Redline Edition -""" - -# pylint: disable=C0103 +"""Game fix for Crashday Redline Edition""" import json from protonfixes import util -def main(): - """ Change setting FSAA to 0 in graphics.config - """ - - config = (util.protonprefix() + "drive_c/users/steamuser/Local Settings/" + - "Application Data/Crashday/config/graphics.config") +def main() -> None: + """Change setting FSAA to 0 in graphics.config""" + config = ( + util.protonprefix() + + 'drive_c/users/steamuser/Local Settings/' + + 'Application Data/Crashday/config/graphics.config' + ) # https://stackoverflow.com/a/45435707 - with open(config, 'r', encoding='utf-8') as file: + with open(config, encoding='utf-8') as file: json_data = json.load(file) if 'FSAA' in json_data: json_data['FSAA'] = 0 diff --git a/gamefixes-steam/518790.py b/gamefixes-steam/518790.py index cb8384e5..76a6f0a5 100755 --- a/gamefixes-steam/518790.py +++ b/gamefixes-steam/518790.py @@ -1,10 +1,8 @@ -""" The Hunter: Call of the Wild -""" -#pylint: disable=C0103 +"""The Hunter: Call of the Wild""" from protonfixes import util -def main(): - """ Requires nvapi disabled. - """ + +def main() -> None: + """Requires nvapi disabled.""" util.disable_nvapi() diff --git a/gamefixes-steam/550340.py b/gamefixes-steam/550340.py index f58547a3..535e277b 100755 --- a/gamefixes-steam/550340.py +++ b/gamefixes-steam/550340.py @@ -1,9 +1,8 @@ -""" Ougon Musoukyoku -""" -#pylint: disable=C0103 +"""Ougon Musoukyoku""" from protonfixes import util -def main(): + +def main() -> None: # Codecs required for opening playback util.protontricks('lavfilters') diff --git a/gamefixes-steam/559620.py b/gamefixes-steam/559620.py index bf350acf..cb707692 100755 --- a/gamefixes-steam/559620.py +++ b/gamefixes-steam/559620.py @@ -1,10 +1,10 @@ -""" Game fix for Outlaws + A Handful of Missions -""" -#pylint: disable=C0103 +"""Game fix for Outlaws + A Handful of Missions""" + # from protonfixes import util -def main(): + +def main() -> None: # Override ddraw (cutscenes+menu perf) and WinMM (Music) util.winedll_override('ddraw', 'n,b') util.winedll_override('winmm', 'n,b') diff --git a/gamefixes-steam/570940.py b/gamefixes-steam/570940.py index 4e3d90a5..f3f6844f 100755 --- a/gamefixes-steam/570940.py +++ b/gamefixes-steam/570940.py @@ -1,9 +1,8 @@ -""" Game fix Dark Souls Remastered -""" -#pylint: disable=C0103 +"""Game fix Dark Souls Remastered""" from protonfixes import util -def main(): + +def main() -> None: # Requires vcrun2017 to launch util.protontricks('vcrun2017') diff --git a/gamefixes-steam/582660.py b/gamefixes-steam/582660.py index a526de02..3f976770 100755 --- a/gamefixes-steam/582660.py +++ b/gamefixes-steam/582660.py @@ -1,17 +1,15 @@ -""" Game fix for Black Desert Online -""" -#pylint: disable=C0103 +"""Game fix for Black Desert Online""" import os from protonfixes import util -def main(): - """ Black Desert Online add NOSTEAM option. - """ + +def main() -> None: + """Black Desert Online add NOSTEAM option.""" # Fixes the startup process. if 'NOSTEAM' in os.environ: util.replace_command('--steam', '') # Needed for settings archive - util.set_environment('SteamGameId','582660') + util.set_environment('SteamGameId', '582660') # Needed for Launcher - util.set_environment('WINE_DISABLE_KERNEL_WRITEWATCH','1') + util.set_environment('WINE_DISABLE_KERNEL_WRITEWATCH', '1') diff --git a/gamefixes-steam/586140.py b/gamefixes-steam/586140.py index ab94d0ed..3e946797 100755 --- a/gamefixes-steam/586140.py +++ b/gamefixes-steam/586140.py @@ -1,11 +1,10 @@ -""" BlazBlue Centralfiction +"""BlazBlue Centralfiction Missing voices/sounds in cutscenes Requires disabling the gstreamer protonaudioconverterbin plugin to get full audio in cutscenes """ -#pylint: disable=C0103 - from protonfixes import util -def main(): + +def main() -> None: util.disable_protonmediaconverter() diff --git a/gamefixes-steam/593600.py b/gamefixes-steam/593600.py index ce486632..fbfe8b78 100755 --- a/gamefixes-steam/593600.py +++ b/gamefixes-steam/593600.py @@ -1,11 +1,8 @@ -""" Game fix for PixARK -""" -#pylint: disable=C0103 +"""Game fix for PixARK""" from protonfixes import util -def main(): - """ Overrides the mprapi.dll to native. - """ +def main() -> None: + """Overrides the mprapi.dll to native.""" util.winedll_override('mprapi', 'x') diff --git a/gamefixes-steam/601510.py b/gamefixes-steam/601510.py index ca2e4d67..3f9c179c 100755 --- a/gamefixes-steam/601510.py +++ b/gamefixes-steam/601510.py @@ -1,9 +1,8 @@ -""" Yu-Gi-Oh Duel Links needs vcrun2019 -""" -#pylint: disable=C0103 +"""Yu-Gi-Oh Duel Links needs vcrun2019""" from protonfixes import util -def main(): + +def main() -> None: # Replace launcher with game exe in proton arguments util.protontricks('vcrun2019') diff --git a/gamefixes-steam/61500.py b/gamefixes-steam/61500.py index 3f285159..2ecabc91 100755 --- a/gamefixes-steam/61500.py +++ b/gamefixes-steam/61500.py @@ -1,9 +1,7 @@ -""" Game fix for Age of Wonders -""" - -#pylint: disable=C0103 +"""Game fix for Age of Wonders""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('icodecs') diff --git a/gamefixes-steam/6270.py b/gamefixes-steam/6270.py index 5bfb3438..b6f7da54 100644 --- a/gamefixes-steam/6270.py +++ b/gamefixes-steam/6270.py @@ -1,8 +1,7 @@ -""" Ducati World Championship -""" -#pylint: disable=C0103 +"""Ducati World Championship""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('icodecs') diff --git a/gamefixes-steam/627270.py b/gamefixes-steam/627270.py index 0d4d7108..f009d018 100755 --- a/gamefixes-steam/627270.py +++ b/gamefixes-steam/627270.py @@ -1,9 +1,8 @@ -""" Game fix Injustice 2 -""" -#pylint: disable=C0103 +"""Game fix Injustice 2""" from protonfixes import util -def main(): + +def main() -> None: # Requires vcrun2019 to launch util.protontricks('vcrun2019') diff --git a/gamefixes-steam/63110.py b/gamefixes-steam/63110.py index ef0e5f21..5059238b 100755 --- a/gamefixes-steam/63110.py +++ b/gamefixes-steam/63110.py @@ -1,11 +1,11 @@ -""" Alter Ego +"""Alter Ego Launcher crashes immediately without displaying any windows """ -#pylint: disable=C0103 from protonfixes import util -def main(): + +def main() -> None: util.replace_command('AlterEgo.exe', './RunDev.exe') util.append_argument('AlterEgo.ebr') util.set_environment('SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS', '0') diff --git a/gamefixes-steam/633230.py b/gamefixes-steam/633230.py index cc157abf..7c21c952 100755 --- a/gamefixes-steam/633230.py +++ b/gamefixes-steam/633230.py @@ -1,10 +1,11 @@ -""" Game fix for Naruto To Boruto -""" -#pylint: disable=C0103 +"""Game fix for Naruto To Boruto""" from protonfixes import util -def main(): - util.replace_command('NARUTO.exe', 'NARUTO/Binaries/Win64/NARUTO-Win64-Shipping.exe') + +def main() -> None: + util.replace_command( + 'NARUTO.exe', 'NARUTO/Binaries/Win64/NARUTO-Win64-Shipping.exe' + ) util.append_argument('-eac-nop-loaded') util.protontricks('hidewineexports=enable') diff --git a/gamefixes-steam/63700.py b/gamefixes-steam/63700.py index 9583984f..b2e3c0fc 100755 --- a/gamefixes-steam/63700.py +++ b/gamefixes-steam/63700.py @@ -1,10 +1,8 @@ -""" Game fix for BIT.TRIP BEAT -""" - -#pylint: disable=C0103 +"""Game fix for BIT.TRIP BEAT""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('d3dcompiler_43') util.protontricks('d3dx9_43') diff --git a/gamefixes-steam/63710.py b/gamefixes-steam/63710.py index d2799d2d..df0813ba 100755 --- a/gamefixes-steam/63710.py +++ b/gamefixes-steam/63710.py @@ -1,13 +1,10 @@ -""" Game fix for BIT.TRIP RUNNER -""" -#pylint: disable=C0103 +"""Game fix for BIT.TRIP RUNNER""" from protonfixes import util -def main(): - """ From: https://www.protondb.com/app/63710 - """ +def main() -> None: + """From: https://www.protondb.com/app/63710""" util.protontricks('d3dcompiler_43') util.protontricks('d3dx9_43') util.winedll_override('openal32', 'b') diff --git a/gamefixes-steam/638160.py b/gamefixes-steam/638160.py index 15084641..c1873bb0 100755 --- a/gamefixes-steam/638160.py +++ b/gamefixes-steam/638160.py @@ -1,10 +1,9 @@ -""" Game fix for Moero Chronicle -""" -#pylint: disable=C0103 +"""Game fix for Moero Chronicle""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('quartz_feb2010') util.protontricks('wmp11') util.protontricks('qasf') diff --git a/gamefixes-steam/638970.py b/gamefixes-steam/638970.py index 7d948d8f..2e58afbe 100755 --- a/gamefixes-steam/638970.py +++ b/gamefixes-steam/638970.py @@ -1,12 +1,9 @@ -""" Game fix for Yakuza 0 -""" -#pylint: disable=C0103 +"""Game fix for Yakuza 0""" from protonfixes import util -def main(): - """ Disable FSYNC - """ +def main() -> None: + """Disable FSYNC""" # Disable fsync to fix saving issues util.disable_fsync() diff --git a/gamefixes-steam/644930.py b/gamefixes-steam/644930.py index 7a72e98a..07175b99 100644 --- a/gamefixes-steam/644930.py +++ b/gamefixes-steam/644930.py @@ -1,9 +1,8 @@ -""" They Are Billions -""" -#pylint: disable=C0103 +"""They Are Billions""" from protonfixes import util -def main(): + +def main() -> None: # fix broken or missing font in UI - util.protontricks("gdiplus") + util.protontricks('gdiplus') diff --git a/gamefixes-steam/65540.py b/gamefixes-steam/65540.py index b253fa2c..c1444ed6 100755 --- a/gamefixes-steam/65540.py +++ b/gamefixes-steam/65540.py @@ -1,18 +1,17 @@ -""" Game fix for Gothic 1 Classic - Game fix for Gothic II: Gold Classic +"""Game fix for Gothic 1 Classic +Game fix for Gothic II: Gold Classic """ -#pylint: disable=C0103 from protonfixes import util -def main(): +def main() -> None: # Fix resolution, not necessary with 'GD3D11' - but doesn't hurt set_resolution() # Fix background music / Gothic 2 startup util.protontricks('directmusic') - util.winedll_override('*dsound', 'b') # Override registry entry + util.winedll_override('*dsound', 'b') # Override registry entry # Fix crackling audio util.set_environment('PULSE_LATENCY_MSEC', '90') @@ -33,18 +32,24 @@ def main(): def set_resolution() -> None: # Patch the config to match the system resolution - screen_width,screen_height = util.get_resolution() + screen_width, screen_height = util.get_resolution() zVidResFullscreenX = str(screen_width) zVidResFullscreenY = str(screen_height) - game_opts = """ + game_opts = ( + """ [GAME] scaleVideos=1 [VIDEO] - zVidResFullscreenX=""" + zVidResFullscreenX + """ - zVidResFullscreenY=""" + zVidResFullscreenY + """ + zVidResFullscreenX=""" + + zVidResFullscreenX + + """ + zVidResFullscreenY=""" + + zVidResFullscreenY + + """ zVidResFullscreenBPP=32 """ + ) util.set_ini_options(game_opts, 'system/Gothic.ini', 'cp1251', 'game') diff --git a/gamefixes-steam/65600.py b/gamefixes-steam/65600.py index 73bd00f6..edd3b888 100755 --- a/gamefixes-steam/65600.py +++ b/gamefixes-steam/65600.py @@ -1,18 +1,15 @@ -""" Game fix for Gothic 3 Forsaken Gods Enhanced Edition -""" -#pylint: disable=C0103 +"""Game fix for Gothic 3 Forsaken Gods Enhanced Edition""" import os from protonfixes import util -def main(): - """ Modify ge3.ini - """ +def main() -> None: + """Modify ge3.ini""" game_opts = """ [Engine.Setup] Timer.ThreadSafe=false FpS.Max=0 """ - util.set_ini_options(game_opts,os.path.join('Ini','ge3.ini'),'cp1251','game') + util.set_ini_options(game_opts, os.path.join('Ini', 'ge3.ini'), 'cp1251', 'game') diff --git a/gamefixes-steam/65610.py b/gamefixes-steam/65610.py index ca112f07..d70ddbd3 100755 --- a/gamefixes-steam/65610.py +++ b/gamefixes-steam/65610.py @@ -1,12 +1,8 @@ -""" Game fix for Arkania -""" - -# pylint: disable=C0103 +"""Game fix for Arkania""" from protonfixes import util -def main(): - +def main() -> None: # This requires Proton 5.0 installed util.protontricks('wmp11') diff --git a/gamefixes-steam/658150.py b/gamefixes-steam/658150.py index 5f5e296e..e617e7d3 100755 --- a/gamefixes-steam/658150.py +++ b/gamefixes-steam/658150.py @@ -1,12 +1,8 @@ -""" Skeleton Boomerang -""" -#pylint: disable=C0103 +"""Skeleton Boomerang""" from protonfixes import util -def main(): - """ Fixes shader compilation error - """ - +def main() -> None: + """Fixes shader compilation error""" util.protontricks('d3dcompiler_43') diff --git a/gamefixes-steam/658260.py b/gamefixes-steam/658260.py index d5c14b38..75a90e69 100644 --- a/gamefixes-steam/658260.py +++ b/gamefixes-steam/658260.py @@ -1,10 +1,9 @@ -""" BLUE REFLECTION +"""BLUE REFLECTION Missing voices/sounds in cutscenes """ -#pylint: disable=C0103 - from protonfixes import util -def main(): + +def main() -> None: util.disable_protonmediaconverter() diff --git a/gamefixes-steam/65930.py b/gamefixes-steam/65930.py index e4f7823e..2fd9d81f 100755 --- a/gamefixes-steam/65930.py +++ b/gamefixes-steam/65930.py @@ -1,13 +1,10 @@ -""" Game fix for The Bureau: XCOM Declassified -""" -#pylint: disable=C0103 +"""Game fix for The Bureau: XCOM Declassified""" from protonfixes import util -def main(): - """ Disables esync and fsync - """ +def main() -> None: + """Disables esync and fsync""" # https://github.com/ValveSoftware/Proton/issues/797#issuecomment-955180056 util.disable_esync() util.disable_fsync() diff --git a/gamefixes-steam/678950.py b/gamefixes-steam/678950.py index 17d5ee88..bd76153b 100755 --- a/gamefixes-steam/678950.py +++ b/gamefixes-steam/678950.py @@ -1,10 +1,9 @@ -""" Game fix for DRAGON BALL FighterZ -""" -#pylint: disable=C0103 +"""Game fix for DRAGON BALL FighterZ""" from protonfixes import util -def main(): + +def main() -> None: util.replace_command('DBFighterZ.exe', 'RED/Binaries/Win64/RED-Win64-Shipping.exe') util.append_argument('-eac-nop-loaded') diff --git a/gamefixes-steam/700600.py b/gamefixes-steam/700600.py index adc169bf..f0bca178 100755 --- a/gamefixes-steam/700600.py +++ b/gamefixes-steam/700600.py @@ -1,12 +1,9 @@ -""" Game fix for Evil Genius 2 -""" -#pylint: disable=C0103 +"""Game fix for Evil Genius 2""" from protonfixes import util -def main(): - """ Launcher workaround - """ +def main() -> None: + """Launcher workaround""" # Fixes the startup process. util.replace_command('eg2.exe', '../bin/evilgenius_vulkan.exe') diff --git a/gamefixes-steam/702050.py b/gamefixes-steam/702050.py index 4b431fe4..30f2abbd 100755 --- a/gamefixes-steam/702050.py +++ b/gamefixes-steam/702050.py @@ -1,12 +1,10 @@ -""" Game fix for The Song of Saya -""" +"""Game fix for The Song of Saya""" from protonfixes import util -def main(): - """ Disable esync and fsync - """ +def main() -> None: + """Disable esync and fsync""" # Fixes random crashing during gameplay util.disable_esync() util.disable_fsync() diff --git a/gamefixes-steam/70400.py b/gamefixes-steam/70400.py index 4bd57c21..23bde81a 100755 --- a/gamefixes-steam/70400.py +++ b/gamefixes-steam/70400.py @@ -1,13 +1,10 @@ -""" Game fix for Recettear: An Item Shop's Tale -""" -#pylint: disable=C0103 +"""Game fix for Recettear: An Item Shop's Tale""" from protonfixes import util -def main(): - """ Install directsound libraries - """ +def main() -> None: + """Install directsound libraries""" util.protontricks('dmime') util.protontricks('dmloader') util.protontricks('dmsynth') diff --git a/gamefixes-steam/70420.py b/gamefixes-steam/70420.py index d0b6ce35..4be9e8fd 100755 --- a/gamefixes-steam/70420.py +++ b/gamefixes-steam/70420.py @@ -1,13 +1,10 @@ -""" Game fix for Chantelise - A Tale of Two Sisters -""" -#pylint: disable=C0103 +"""Game fix for Chantelise - A Tale of Two Sisters""" from protonfixes import util -def main(): - """ Install directsound libraries - """ +def main() -> None: + """Install directsound libraries""" util.protontricks('dmime') util.protontricks('dmloader') util.protontricks('dmsynth') diff --git a/gamefixes-steam/72850.py b/gamefixes-steam/72850.py index 339db182..0e1c7289 100755 --- a/gamefixes-steam/72850.py +++ b/gamefixes-steam/72850.py @@ -1,14 +1,11 @@ -""" Game fix for Skyrim -""" -#pylint: disable=C0103 +"""Game fix for Skyrim""" import os from protonfixes import util -def main(): - """ Run script extender if it exists. - """ +def main() -> None: + """Run script extender if it exists.""" # Fixes the startup process. if os.path.isfile(os.path.join(os.getcwd(), 'skse_loader.exe')): if 'MODS' in os.environ: diff --git a/gamefixes-steam/729040.py b/gamefixes-steam/729040.py index 956cfeab..93efeef5 100755 --- a/gamefixes-steam/729040.py +++ b/gamefixes-steam/729040.py @@ -1,8 +1,7 @@ -""" Borderlands GOTY -""" -#pylint: disable=C0103 +"""Borderlands GOTY""" from protonfixes import util -def main(): + +def main() -> None: util.replace_command('Launcher.exe', 'BorderlandsGOTY.exe') diff --git a/gamefixes-steam/730830.py b/gamefixes-steam/730830.py index 3c2eb64c..834603f5 100755 --- a/gamefixes-steam/730830.py +++ b/gamefixes-steam/730830.py @@ -1,9 +1,9 @@ -""" Escape From Monkey Island +"""Escape From Monkey Island dgvoodoo2 to force anti-aliasing and higher resolution """ -#pylint: disable=C0103 from protonfixes import util -def main(): + +def main() -> None: util.protontricks('dgvoodoo2') diff --git a/gamefixes-steam/73170.py b/gamefixes-steam/73170.py index de2868e5..daaecd3a 100755 --- a/gamefixes-steam/73170.py +++ b/gamefixes-steam/73170.py @@ -1,12 +1,9 @@ -""" Game fix for Darkest Hour: A Hearts of Iron Game -""" -#pylint: disable=C0103 +"""Game fix for Darkest Hour: A Hearts of Iron Game""" from protonfixes import util -def main(): - """ Set virtual desktop - """ +def main() -> None: + """Set virtual desktop""" # https://github.com/ValveSoftware/Proton/issues/3338 util.protontricks('vd=1280x720') diff --git a/gamefixes-steam/740550.py b/gamefixes-steam/740550.py index cdfa84a0..acf79ac0 100755 --- a/gamefixes-steam/740550.py +++ b/gamefixes-steam/740550.py @@ -1,9 +1,8 @@ -""" Game fix for Record of Agarest War Mariage -""" -#pylint: disable=C0103 +"""Game fix for Record of Agarest War Mariage""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('wmp9') util.disable_protonmediaconverter() diff --git a/gamefixes-steam/750920.py b/gamefixes-steam/750920.py index 8547775a..c75b6665 100755 --- a/gamefixes-steam/750920.py +++ b/gamefixes-steam/750920.py @@ -1,11 +1,8 @@ -""" Shadow of the Tomb Raider -""" -#pylint: disable=C0103 +"""Shadow of the Tomb Raider""" from protonfixes import util -def main(): - """ Requires media foundation dlls - """ +def main() -> None: + """Requires media foundation dlls""" util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/773370.py b/gamefixes-steam/773370.py index 687d0ccc..e276cc19 100755 --- a/gamefixes-steam/773370.py +++ b/gamefixes-steam/773370.py @@ -1,11 +1,8 @@ -""" Exo One -""" -#pylint: disable=C0103 +"""Exo One""" from protonfixes import util -def main(): - """ Requires d3dcompiler_47 - """ +def main() -> None: + """Requires d3dcompiler_47""" util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/78000.py b/gamefixes-steam/78000.py index 4a12a307..4de6d698 100755 --- a/gamefixes-steam/78000.py +++ b/gamefixes-steam/78000.py @@ -1,10 +1,8 @@ -""" Game fix for Bejeweled 3 -""" -#pylint: disable=C0103 +"""Game fix for Bejeweled 3""" from protonfixes import util -def main(): - """ game needs d3dcompiler_43 for dx10 mode, but still does not work. disabling dx10 mode allows dx9 mode to work with dxvk - """ + +def main() -> None: + """Game needs d3dcompiler_43 for dx10 mode, but still does not work. disabling dx10 mode allows dx9 mode to work with dxvk""" util.set_environment('PROTON_NO_D3D10', '1') diff --git a/gamefixes-steam/782330.py b/gamefixes-steam/782330.py index 24e192e5..b29e1eb6 100755 --- a/gamefixes-steam/782330.py +++ b/gamefixes-steam/782330.py @@ -1,8 +1,7 @@ -""" DOOM Eternal -""" -#pylint: disable=C0103 +"""DOOM Eternal""" from protonfixes import util -def main(): + +def main() -> None: util.append_argument('+com_skipSignInManager 1') diff --git a/gamefixes-steam/7850.py b/gamefixes-steam/7850.py index e4ef519b..f7aed4f7 100755 --- a/gamefixes-steam/7850.py +++ b/gamefixes-steam/7850.py @@ -1,11 +1,8 @@ -""" Game fix for Cryostasis -""" -#pylint: disable=C0103 +"""Game fix for Cryostasis""" from protonfixes import util -def main(): - """ Uses physx - """ +def main() -> None: + """Uses physx""" util.protontricks('physx') diff --git a/gamefixes-steam/812140.py b/gamefixes-steam/812140.py index 110db21d..8603cdeb 100755 --- a/gamefixes-steam/812140.py +++ b/gamefixes-steam/812140.py @@ -3,7 +3,7 @@ from protonfixes import util -def main(): +def main() -> None: # Disable uplay overlay and change close behavior # See https://github.com/Open-Wine-Components/umu-protonfixes/pull/94#issuecomment-2227475597 util.disable_uplay_overlay() diff --git a/gamefixes-steam/813780.py b/gamefixes-steam/813780.py index 27c4752f..69fa6976 100755 --- a/gamefixes-steam/813780.py +++ b/gamefixes-steam/813780.py @@ -1,9 +1,8 @@ -""" Game fix Age of Empires II: DE -""" -#pylint: disable=C0103 +"""Game fix Age of Empires II: DE""" from protonfixes import util -def main(): + +def main() -> None: # Requires vcrun2019 to launch util.protontricks('vcrun2019') diff --git a/gamefixes-steam/816020.py b/gamefixes-steam/816020.py index cd6f1975..cfa473ac 100755 --- a/gamefixes-steam/816020.py +++ b/gamefixes-steam/816020.py @@ -1,11 +1,12 @@ -""" Game fix for JUMP FORCE -""" -#pylint: disable=C0103 +"""Game fix for JUMP FORCE""" from protonfixes import util -def main(): - util.replace_command('JUMP_FORCE.exe', 'JUMP_FORCE/Binaries/Win64/JUMP_FORCE-Win64-Shipping.exe') + +def main() -> None: + util.replace_command( + 'JUMP_FORCE.exe', 'JUMP_FORCE/Binaries/Win64/JUMP_FORCE-Win64-Shipping.exe' + ) util.append_argument('-eac-nop-loaded') util.protontricks('hidewineexports=enable') diff --git a/gamefixes-steam/8190.py b/gamefixes-steam/8190.py index 93aded98..1faf89a7 100755 --- a/gamefixes-steam/8190.py +++ b/gamefixes-steam/8190.py @@ -1,13 +1,10 @@ -""" Just Cause 2 -""" -#pylint: disable=C0103 +"""Just Cause 2""" from protonfixes import util -def main(): - """ Requires seccomp - """ +def main() -> None: + """Requires seccomp""" util.protontricks('d3dcompiler_43') util.protontricks('d3dcompiler_47') util.protontricks('d3dx10') diff --git a/gamefixes-steam/834530.py b/gamefixes-steam/834530.py index 869251fc..d6e9d33b 100755 --- a/gamefixes-steam/834530.py +++ b/gamefixes-steam/834530.py @@ -1,12 +1,9 @@ -""" Game fix for Yakuza Kiwami -""" -#pylint: disable=C0103 +"""Game fix for Yakuza Kiwami""" from protonfixes import util -def main(): - """ Disable FSYNC - """ +def main() -> None: + """Disable FSYNC""" # Disable fsync to fix saving issues and hang on exit util.disable_fsync() diff --git a/gamefixes-steam/888790.py b/gamefixes-steam/888790.py index 67428044..862d74ca 100644 --- a/gamefixes-steam/888790.py +++ b/gamefixes-steam/888790.py @@ -3,11 +3,9 @@ from protonfixes import util -def main(): - """ - Fixes in-game video playback for the intro and ending. - """ +def main() -> None: + """Fixes in-game video playback for the intro and ending.""" util.disable_protonmediaconverter() # Changes the video renderer to 'overlay' to prevent random crashes # See https://github.com/Open-Wine-Components/umu-protonfixes/pull/115#issuecomment-2319197337 - util.append_argument("-vomstyle=overlay") + util.append_argument('-vomstyle=overlay') diff --git a/gamefixes-steam/893180.py b/gamefixes-steam/893180.py index 3f768a68..02c34e38 100755 --- a/gamefixes-steam/893180.py +++ b/gamefixes-steam/893180.py @@ -1,10 +1,9 @@ -""" Game fix Catherine Classic -""" -#pylint: disable=C0103 +"""Game fix Catherine Classic""" from protonfixes import util -def main(): + +def main() -> None: util.protontricks('directshow') util.protontricks('cinepak') util.protontricks('lavfilters') diff --git a/gamefixes-steam/895870.py b/gamefixes-steam/895870.py index 034f02b7..282cab9e 100755 --- a/gamefixes-steam/895870.py +++ b/gamefixes-steam/895870.py @@ -1,11 +1,8 @@ -""" Project Wingman -""" -#pylint: disable=C0103 +"""Project Wingman""" from protonfixes import util -def main(): - """ Requires d3dcompiler_47 - """ +def main() -> None: + """Requires d3dcompiler_47""" util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/906510.py b/gamefixes-steam/906510.py index a0501b26..849292fa 100755 --- a/gamefixes-steam/906510.py +++ b/gamefixes-steam/906510.py @@ -1,13 +1,9 @@ - -""" Game fix for Conception PLUS: Maidens of the Twelve Stars -""" -#pylint: disable=C0103 +"""Game fix for Conception PLUS: Maidens of the Twelve Stars""" from protonfixes import util -def main(): - """ installs d3dcompiler_47 - """ +def main() -> None: + """Installs d3dcompiler_47""" # https://github.com/ValveSoftware/Proton/issues/3493#issuecomment-1521636321 util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/910830.py b/gamefixes-steam/910830.py index be4f76b5..971483a0 100755 --- a/gamefixes-steam/910830.py +++ b/gamefixes-steam/910830.py @@ -1,12 +1,9 @@ -""" Game fix for Rebel Galaxy Outlaw -""" -#pylint: disable=C0103 +"""Game fix for Rebel Galaxy Outlaw""" from protonfixes import util -def main(): - """ installs mfc42 - """ +def main() -> None: + """Installs mfc42""" # https://github.com/ValveSoftware/Proton/issues/4216 util.protontricks('mfc42') diff --git a/gamefixes-steam/913740.py b/gamefixes-steam/913740.py index ab77ae0c..e43d05ae 100755 --- a/gamefixes-steam/913740.py +++ b/gamefixes-steam/913740.py @@ -1,12 +1,9 @@ -""" Game fix for WORLD OF HORROR -""" -#pylint: disable=C0103 +"""Game fix for WORLD OF HORROR""" from protonfixes import util -def main(): - """ Disable esync - """ +def main() -> None: + """Disable esync""" # esync causes occasional crashing util.disable_esync() diff --git a/gamefixes-steam/936160.py b/gamefixes-steam/936160.py index 792d3235..7ba8e801 100644 --- a/gamefixes-steam/936160.py +++ b/gamefixes-steam/936160.py @@ -1,12 +1,12 @@ -""" Atelier Rorona ~The Alchemist of Arland~ DX +"""Atelier Rorona ~The Alchemist of Arland~ DX Missing voices/sounds in cutscenes Requires disabling the gstreamer protonaudioconverterbin plugin to get full audio in cutscenes. fixed by Swish in Protondb further stolen from marianoag by bitwolf """ -#pylint: disable=C0103 from protonfixes import util -def main(): + +def main() -> None: util.disable_protonmediaconverter() diff --git a/gamefixes-steam/963930.py b/gamefixes-steam/963930.py index a1a36d8e..132c167f 100644 --- a/gamefixes-steam/963930.py +++ b/gamefixes-steam/963930.py @@ -1,8 +1,7 @@ -""" Contractors VR -""" -#pylint: disable=C0103 +"""Contractors VR""" from protonfixes import util -def main(): - util.protontricks('vcrun2022') # Game crashes without it + +def main() -> None: + util.protontricks('vcrun2022') # Game crashes without it diff --git a/gamefixes-steam/968370.py b/gamefixes-steam/968370.py index 47761a87..5b0f06c0 100755 --- a/gamefixes-steam/968370.py +++ b/gamefixes-steam/968370.py @@ -1,10 +1,10 @@ -""" The Blind Prophet +"""The Blind Prophet garbled fonts & No cursive font (Segoe Script) """ -#pylint: disable=C0103 from protonfixes import util -def main(): + +def main() -> None: util.winedll_override('d3d9', 'd') util.protontricks('segoe_script') diff --git a/gamefixes-steam/976310.py b/gamefixes-steam/976310.py index fb3d310b..aa3415f6 100755 --- a/gamefixes-steam/976310.py +++ b/gamefixes-steam/976310.py @@ -1,9 +1,8 @@ -""" Game fix Mortal Kombat 11 -""" -#pylint: disable=C0103 +"""Game fix Mortal Kombat 11""" from protonfixes import util -def main(): + +def main() -> None: # Requires vcrun2019 to launch util.protontricks('vcrun2019') diff --git a/gamefixes-steam/976730.py b/gamefixes-steam/976730.py index 117b88d2..bed84fd6 100755 --- a/gamefixes-steam/976730.py +++ b/gamefixes-steam/976730.py @@ -1,9 +1,8 @@ -""" Game fix Halo:MCC -""" -#pylint: disable=C0103 +"""Game fix Halo:MCC""" from protonfixes import util -def main(): + +def main() -> None: # Requires vcrun2019 to launch util.protontricks('vcrun2019') diff --git a/gamefixes-steam/9900.py b/gamefixes-steam/9900.py index 38cabeeb..01b157f2 100755 --- a/gamefixes-steam/9900.py +++ b/gamefixes-steam/9900.py @@ -1,9 +1,8 @@ -""" Game fix for Star Trek Online launcher -""" -#pylint: disable=C0103 +"""Game fix for Star Trek Online launcher""" + from protonfixes import util -def main(): - """ Ensure d3dcompiler_47 is installed so the launcher window content is visible - """ + +def main() -> None: + """Ensure d3dcompiler_47 is installed so the launcher window content is visible""" util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/99300.py b/gamefixes-steam/99300.py index 7dbc8796..b9f43162 100755 --- a/gamefixes-steam/99300.py +++ b/gamefixes-steam/99300.py @@ -1,10 +1,8 @@ -""" Game fix Renegade Ops -""" -#pylint: disable=C0103 +"""Game fix Renegade Ops""" from protonfixes import util -def main(): - """ This fixed the black screen issue - """ + +def main() -> None: + """This fixed the black screen issue""" util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/997070.py b/gamefixes-steam/997070.py index 41176480..089a93ea 100755 --- a/gamefixes-steam/997070.py +++ b/gamefixes-steam/997070.py @@ -1,10 +1,9 @@ -""" Game fix Marvel's Avengers -""" -#pylint: disable=C0103 +"""Game fix Marvel's Avengers""" from protonfixes import util -def main(): + +def main() -> None: # Requires vcrun2019 to launch util.protontricks('vcrun2019') util.protontricks('d3dcompiler_47') diff --git a/gamefixes-steam/default.py b/gamefixes-steam/default.py index 74b84f64..385e923d 100755 --- a/gamefixes-steam/default.py +++ b/gamefixes-steam/default.py @@ -1,19 +1,18 @@ -""" Default file for Steam game fixes - This file is always executed for games that are identified as Steam games, - even if no game fix is present. It is run before game fixes are applied. +"""Default file for Steam game fixes +This file is always executed for games that are identified as Steam games, +even if no game fix is present. It is run before game fixes are applied. """ import sys from protonfixes import util -def main(): - """ global defaults - """ + +def main() -> None: + """Global defaults""" # Steam commandline - def use_steam_commands(): - """ Parse aliases from Steam launch options - """ + def use_steam_commands() -> None: + """Parse aliases from Steam launch options""" pf_alias_list = list(filter(lambda item: '-pf_' in item, sys.argv)) for pf_alias in pf_alias_list: diff --git a/gamefixes-umu/default.py b/gamefixes-umu/default.py index 699f2f15..9d832c22 100755 --- a/gamefixes-umu/default.py +++ b/gamefixes-umu/default.py @@ -1,8 +1,8 @@ -""" Default file for UMU game fixes - This file is always executed for games that are identified as UMU games, - even if no game fix is present. It is run before game fixes are applied. +"""Default file for UMU game fixes +This file is always executed for games that are identified as UMU games, +even if no game fix is present. It is run before game fixes are applied. """ -def main(): - """ global defaults - """ + +def main() -> None: + """Global defaults""" diff --git a/gamefixes-umu/umu-2016590.py b/gamefixes-umu/umu-2016590.py index 8c01f30f..dc3369c2 100644 --- a/gamefixes-umu/umu-2016590.py +++ b/gamefixes-umu/umu-2016590.py @@ -1,18 +1,26 @@ -""" Game fix for Dark and Darker -""" -#pylint: disable=C0103 +"""Game fix for Dark and Darker""" from protonfixes import util -def main(): - """ Installs wininet and urlmon in order to allow Blacksmith Launcher to properly install the game. - - This also has the side effect of breaking voip in DungeonCrawler.exe, so we add registry entries - to only use native wininet and urlmon for Blacksmith.exe, and not DungeonCrawler.exe. - """ +def main() -> None: + """Installs wininet and urlmon in order to allow Blacksmith Launcher to properly install the game. + + This also has the side effect of breaking voip in DungeonCrawler.exe, so we add registry entries + to only use native wininet and urlmon for Blacksmith.exe, and not DungeonCrawler.exe. + """ util.protontricks('wininet') util.protontricks('urlmon') - util.regedit_add('HKEY_CURRENT_USER\\Software\\Wine\\AppDefaults\\DungeonCrawler.exe\\DllOverrides','wininet','REG_SZ','builtin') - util.regedit_add('HKEY_CURRENT_USER\\Software\\Wine\\AppDefaults\\DungeonCrawler.exe\\DllOverrides','urlmon','REG_SZ','builtin') + util.regedit_add( + 'HKEY_CURRENT_USER\\Software\\Wine\\AppDefaults\\DungeonCrawler.exe\\DllOverrides', + 'wininet', + 'REG_SZ', + 'builtin', + ) + util.regedit_add( + 'HKEY_CURRENT_USER\\Software\\Wine\\AppDefaults\\DungeonCrawler.exe\\DllOverrides', + 'urlmon', + 'REG_SZ', + 'builtin', + ) diff --git a/gamefixes-umu/umu-model2.py b/gamefixes-umu/umu-model2.py index 3ed6bbb5..309edeb0 100755 --- a/gamefixes-umu/umu-model2.py +++ b/gamefixes-umu/umu-model2.py @@ -1,13 +1,11 @@ -""" Application fix Model 2 emulator -""" +"""Application fix Model 2 emulator""" # from protonfixes import util -def main(): - """ installs d3dcompiler_42, d3dx9_42, d3dx9, xact, xact_64 - """ +def main() -> None: + """Installs d3dcompiler_42, d3dx9_42, d3dx9, xact, xact_64""" util.protontricks('d3dcompiler_42') util.protontricks('d3dx9_42') util.protontricks('d3dx9') diff --git a/gamefixes-umu/umu-starcitizen.py b/gamefixes-umu/umu-starcitizen.py index a880e2fa..186bede6 100644 --- a/gamefixes-umu/umu-starcitizen.py +++ b/gamefixes-umu/umu-starcitizen.py @@ -1,21 +1,18 @@ -""" Game fix for Star Citizen -""" -#pylint: disable=C0103,E0401 +"""Game fix for Star Citizen""" from protonfixes import util -def main(): - """ EAC Workaround - """ - #eac workaround - util.set_environment('EOS_USE_ANTICHEATCLIENTNULL','1') +def main() -> None: + """EAC Workaround""" + # eac workaround + util.set_environment('EOS_USE_ANTICHEATCLIENTNULL', '1') - #needed for nvidia vulkan - util.set_environment('WINE_HIDE_NVIDIA_GPU','1') + # needed for nvidia vulkan + util.set_environment('WINE_HIDE_NVIDIA_GPU', '1') - #needed for amd vulkan - util.set_environment('dual_color_blend_by_location','true') + # needed for amd vulkan + util.set_environment('dual_color_blend_by_location', 'true') - #allow the RSI Launcher to auto-update itself + # allow the RSI Launcher to auto-update itself util.protontricks('powershell') diff --git a/gamefixes-umu/winetricks-gui.py b/gamefixes-umu/winetricks-gui.py index b0b9e185..aa308f3e 100755 --- a/gamefixes-umu/winetricks-gui.py +++ b/gamefixes-umu/winetricks-gui.py @@ -1,11 +1,8 @@ -""" Call Winetricks GUI -""" -#pylint: disable=C0103 +"""Call Winetricks GUI""" from protonfixes import util -def main(): - """ Requires seccomp - """ +def main() -> None: + """Requires seccomp""" util.protontricks('gui') diff --git a/gamefixes-zoomplatform/umu-240200.py b/gamefixes-zoomplatform/umu-240200.py index d62c97e8..af4740bf 100644 --- a/gamefixes-zoomplatform/umu-240200.py +++ b/gamefixes-zoomplatform/umu-240200.py @@ -1,9 +1,8 @@ -""" Duke Nukem: Manhattan Project - Enhanced Edition -""" -#pylint: disable=C0103 +"""Duke Nukem: Manhattan Project - Enhanced Edition""" from protonfixes import util -def main(): + +def main() -> None: util.winedll_override('d3d8', 'n,b') util.protontricks('vcrun2019') diff --git a/gamefixes-zoomplatform/umu-4bff76f4-566a-4714-b481-95d3343afe22.py b/gamefixes-zoomplatform/umu-4bff76f4-566a-4714-b481-95d3343afe22.py index 19ced8c9..0972f586 100644 --- a/gamefixes-zoomplatform/umu-4bff76f4-566a-4714-b481-95d3343afe22.py +++ b/gamefixes-zoomplatform/umu-4bff76f4-566a-4714-b481-95d3343afe22.py @@ -1,10 +1,9 @@ -""" Incoming Trilogy -""" -#pylint: disable=C0103 +"""Incoming Trilogy""" from protonfixes import util -def main(): + +def main() -> None: util.winedll_override('d3d8', 'n,b') util.winedll_override('ddraw', 'b') util.winedll_override('winmm', 'n,b') diff --git a/logger.py b/logger.py index 41cf925c..5905d6c6 100644 --- a/logger.py +++ b/logger.py @@ -1,34 +1,28 @@ -""" Simple logging to stdout the same way Proton does -""" +"""Simple logging to stdout the same way Proton does""" -import io import os import sys -class Log(): - """Log to stderr for steam dumps - """ - def __init__(self) -> None: +class Log: + """Log to stderr for steam dumps""" + + def __init__(self) -> None: # noqa: D107 self.pfx = 'ProtonFixes[' + str(os.getpid()) + '] ' self.colors = { 'RESET': '\u001b[0m', 'INFO': '\u001b[34m', 'WARN': '\u001b[33m', 'CRIT': '\u001b[31m', - 'DEBUG': '\u001b[35m' + 'DEBUG': '\u001b[35m', } def __call__(self, msg: str) -> None: - """ Allows the Log instance to be called directly - """ - + """Allows the Log instance to be called directly""" self.log(msg) def log(self, msg: str = '', level: str = 'INFO') -> None: - """ Prints the log message to stdout the same way as Proton - """ - + """Prints the log message to stdout the same way as Proton""" pfx = self.pfx + level + ': ' color = self.colors[level] reset = self.colors['RESET'] @@ -36,34 +30,25 @@ def log(self, msg: str = '', level: str = 'INFO') -> None: fulltext = color + pfx + str(msg) + reset + os.linesep sys.stderr.write(fulltext) sys.stderr.flush() - with io.open('/tmp/test', 'a', 1, encoding='utf-8') as testfile: + with open('/tmp/test', 'a', 1, encoding='utf-8') as testfile: testfile.write(logtext) - def info(self, msg: str) -> None: - """ Wrapper for printing info messages - """ - + """Wrapper for printing info messages""" self.log(msg, 'INFO') def warn(self, msg: str) -> None: - """ Wrapper for printing warning messages - """ - + """Wrapper for printing warning messages""" self.log(msg, 'WARN') def crit(self, msg: str) -> None: - """ Wrapper for printing critical messages - """ - + """Wrapper for printing critical messages""" self.log(msg, 'CRIT') def debug(self, msg: str) -> None: - """ Wrapper for printing debug messages - """ - + """Wrapper for printing debug messages""" if 'DEBUG' in os.environ: self.log(msg, 'DEBUG') -log = Log() #pylint: disable=C0103 +log = Log() diff --git a/protonfixes_test.py b/protonfixes_test.py index 7a3d6edb..c1e0fe3e 100644 --- a/protonfixes_test.py +++ b/protonfixes_test.py @@ -1,4 +1,3 @@ -# pylint: disable=C0114 import unittest import os import tempfile @@ -8,7 +7,7 @@ import urllib.request import fix -# pylint: disable=C0115,R0904 + class TestProtonfixes(unittest.TestCase): def setUp(self): self.env = { @@ -17,7 +16,7 @@ def setUp(self): 'SteamGameId': '', 'STEAM_COMPAT_DATA_PATH': '', 'UMU_ID': '', - 'DEBUG': '' + 'DEBUG': '', } self.game_id = '1293820' self.pfx = Path(tempfile.mkdtemp()) @@ -28,14 +27,16 @@ def tearDown(self): os.environ.pop(key) if self.pfx.is_dir(): if self.pfx.joinpath('steamapps').is_dir(): - self.pfx.joinpath('steamapps', 'appmanifest_1628350.acf').unlink(missing_ok=True) + self.pfx.joinpath('steamapps', 'appmanifest_1628350.acf').unlink( + missing_ok=True + ) self.pfx.joinpath('steamapps').rmdir() self.pfx.joinpath('game_title').unlink(missing_ok=True) self.pfx.rmdir() def testModuleName(self): """Pass a non-numeric game id - + Expects a string that refers to a module in gamefixes-umu """ game_id = 'umu-default' @@ -44,7 +45,7 @@ def testModuleName(self): def testModuleNameNum(self): """Pass a numeric game id - + In this case, it's assumed the game is from Steam when the game id is numeric Expects a string that refers to a module in gamefixes-steam @@ -55,7 +56,7 @@ def testModuleNameNum(self): def testModuleNameNoneAndNumeric(self): """Pass a numeric gameid and set STORE - + In this case, when the game id is numeric, we always refer to a module in the gamefixes-steam. """ @@ -66,7 +67,7 @@ def testModuleNameNoneAndNumeric(self): def testModuleNameStoreAndNumeric(self): """Pass a numeric gameid and set STORE - + In this case, when the game id is numeric, we always refer to a module in gamefixes-steam When passed a valid store, that value should not be used @@ -76,10 +77,9 @@ def testModuleNameStoreAndNumeric(self): result = fix.get_module_name(game_id) self.assertEqual(result, f'protonfixes.gamefixes-steam.{game_id}') - def testModuleNameStore(self): """Pass a non-numeric game id and setting valid STORE - + For non-numeric game ids, the umu database should always be referenced Expects a string that refers to a module in gamefixes-$STORE """ @@ -90,7 +90,7 @@ def testModuleNameStore(self): def testModuleNameNoStore(self): """Pass a non-numeric game id and setting an invalid STORE - + Expects a string that refers to a module in gamefixes-umu """ os.environ['STORE'] = 'foo' @@ -100,7 +100,7 @@ def testModuleNameNoStore(self): def testModuleNameStoreEmpty(self): """Pass a non-numeric game id and setting an empty store - + Expects a string that refers to a module in gamefixes-umu """ os.environ['STORE'] = '' @@ -132,7 +132,7 @@ def testModuleNameLocal(self): def testModuleNameLocalDefault(self): """Pass a gameid and set local=True,default=True - + In this case, the game id will be completely ignored """ game_id = '1091500' @@ -141,13 +141,13 @@ def testModuleNameLocalDefault(self): def testGetGameSteamAppId(self): """Only set the SteamAppId - + Protonfixes depends on being supplied an app id when applying fixes to games. - + This appid is typically set by a client application, but the user can set it in some cases (e.g., umu-launcher). - + If the app id is numeric, then protonfixes will refer to the gamefixes-steam folder. Otherwise, the STORE environment variable will be used to determine which fix will be applied. @@ -176,15 +176,19 @@ def testGetGameCompatPath(self): os.environ['STEAM_COMPAT_DATA_PATH'] = self.game_id result = fix.get_game_id() self.assertEqual(result, self.game_id) - self.assertTrue(os.environ.get('STEAM_COMPAT_DATA_PATH'), 'STEAM_COMPAT_DATA_PATH was unset') + self.assertTrue( + os.environ.get('STEAM_COMPAT_DATA_PATH'), 'STEAM_COMPAT_DATA_PATH was unset' + ) def testGetGameNone(self): """Set no environment variables - + Expect None to be returned """ func = fix.get_game_id.__wrapped__ # Do not reference the cache - self.assertTrue('STEAM_COMPAT_DATA_PATH' not in os.environ, 'STEAM_COMPAT_DATA_PATH is set') + self.assertTrue( + 'STEAM_COMPAT_DATA_PATH' not in os.environ, 'STEAM_COMPAT_DATA_PATH is set' + ) self.assertTrue('SteamGameId' not in os.environ, 'SteamGameId is set') self.assertTrue('UMU_ID' not in os.environ, 'UMU_ID is set') self.assertTrue('SteamAppId' not in os.environ, 'SteamAppId is set') @@ -193,10 +197,10 @@ def testGetGameNone(self): def testGetStoreNameZoom(self): """Pass zoomplatform as store name - + The get_store_name function returns a string associated with a supported store in the umu database. - + The string will be used to display a message in the console to let the user know which fix will be applied. """ @@ -274,10 +278,10 @@ def testGetStoreNameFoo(self): def testGetGameName(self): """Set UMU_ID and access the game_title file for its title - + The get_game_name function returns a string of the running game's title. - + It checks a few system paths in the user's system to try to determine it, and makes a callout to an owc endpoint to get an official title by its UMU_ID. @@ -290,7 +294,7 @@ def testGetGameName(self): def testGetGameNameDB(self): """Set UMU_ID and access umu database - + Makes a request to the umu database for a title name to be displayed if a UMU_ID is supplied. This function should be fail safe in case of a TimeoutError, OSError, IndexError or UnicodeDecodeError @@ -302,7 +306,7 @@ def testGetGameNameDB(self): data = io.StringIO(data) with ( patch.object(fix, 'check_internet', return_value=True), - patch.object(urllib.request, 'urlopen', return_value=data) + patch.object(urllib.request, 'urlopen', return_value=data), ): func = fix.get_game_name.__wrapped__ # Do not reference the cache result = func() @@ -310,7 +314,7 @@ def testGetGameNameDB(self): def testGetGameNameDBTimeout(self): """Set UMU_ID and access umu database - + Mock the TimeoutError """ os.environ['UMU_ID'] = 'umu-35140' @@ -318,7 +322,7 @@ def testGetGameNameDBTimeout(self): # Mock a valid umu db response with ( patch.object(fix, 'check_internet', return_value=True), - patch.object(urllib.request, 'urlopen') as mock_function + patch.object(urllib.request, 'urlopen') as mock_function, ): mock_function.side_effect = TimeoutError func = fix.get_game_name.__wrapped__ # Do not reference the cache @@ -327,7 +331,7 @@ def testGetGameNameDBTimeout(self): def testGetGameNameDbOS(self): """Set UMU_ID and access umu database - + Mock the OSError, which only shown if debugging is enabled """ os.environ['UMU_ID'] = 'umu-35140' @@ -336,7 +340,7 @@ def testGetGameNameDbOS(self): # Mock a valid umu db response with ( patch.object(fix, 'check_internet', return_value=True), - patch.object(urllib.request, 'urlopen') as mock_function + patch.object(urllib.request, 'urlopen') as mock_function, ): mock_function.side_effect = OSError func = fix.get_game_name.__wrapped__ # Do not reference the cache @@ -345,7 +349,7 @@ def testGetGameNameDbOS(self): def testGetGameNameDbIndex(self): """Set UMU_ID and access umu database - + Mock the IndexError """ os.environ['UMU_ID'] = 'umu-35140' @@ -354,7 +358,7 @@ def testGetGameNameDbIndex(self): # Mock a valid umu db response with ( patch.object(fix, 'check_internet', return_value=True), - patch.object(urllib.request, 'urlopen') as mock_function + patch.object(urllib.request, 'urlopen') as mock_function, ): mock_function.side_effect = IndexError func = fix.get_game_name.__wrapped__ # Do not reference the cache @@ -363,18 +367,20 @@ def testGetGameNameDbIndex(self): def testGetGameNameDbUnicode(self): """Set UMU_ID and access umu database - + Mock the UnicodeError """ os.environ['UMU_ID'] = 'umu-35140' os.environ['WINEPREFIX'] = self.pfx.as_posix() os.environ['DEBUG'] = '1' + def mock_urlopen_raise_error(*args, **kwargs): raise UnicodeDecodeError('utf-8', b'', 0, 1, '') + # Mock a valid umu db response with ( patch.object(fix, 'check_internet', return_value=True), - patch.object(urllib.request, 'urlopen') as mock_function + patch.object(urllib.request, 'urlopen') as mock_function, ): mock_function.side_effect = mock_urlopen_raise_error func = fix.get_game_name.__wrapped__ # Do not reference the cache @@ -397,5 +403,6 @@ def testGetGameNameNoManifest(self): result = func() self.assertEqual(result, 'UNKNOWN') + if __name__ == '__main__': unittest.main() diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 6da8c50a..00000000 --- a/pyproject.toml +++ /dev/null @@ -1,540 +0,0 @@ -[tool.pylint.main] -# Analyse import fallback blocks. This can be used to support both Python 2 and 3 -# compatible code, which means that the block might have code that exists only in -# one or another interpreter, leading to false positives when analysed. -# analyse-fallback-blocks = - -# Clear in-memory caches upon conclusion of linting. Useful if running pylint in -# a server-like mode. -# clear-cache-post-run = - -# Always return a 0 (non-error) status code, even if lint errors are found. This -# is primarily useful in continuous integration scripts. -# exit-zero = - -# A comma-separated list of package or module names from where C extensions may -# be loaded. Extensions are loading into the active Python interpreter and may -# run arbitrary code. -# extension-pkg-allow-list = - -# A comma-separated list of package or module names from where C extensions may -# be loaded. Extensions are loading into the active Python interpreter and may -# run arbitrary code. (This is an alternative name to extension-pkg-allow-list -# for backward compatibility.) -# extension-pkg-whitelist = - -# Return non-zero exit code if any of these messages/categories are detected, -# even if score is above --fail-under value. Syntax same as enable. Messages -# specified are enabled, while categories only check already-enabled messages. -# fail-on = - -# Specify a score threshold under which the program will exit with error. -fail-under = 10 - -# Interpret the stdin as a python script, whose filename needs to be passed as -# the module_or_package argument. -# from-stdin = - -# Files or directories to be skipped. They should be base names, not paths. -ignore = ["CVS"] - -# Add files or directories matching the regular expressions patterns to the -# ignore-list. The regex matches against paths and can be in Posix or Windows -# format. Because '\\' represents the directory delimiter on Windows systems, it -# can't be used as an escape character. -# ignore-paths = - -# Files or directories matching the regular expression patterns are skipped. The -# regex matches against base names, not paths. The default value ignores Emacs -# file locks -# ignore-patterns = - -# List of module names for which member attributes should not be checked (useful -# for modules/projects where namespaces are manipulated during runtime and thus -# existing member attributes cannot be deduced by static analysis). It supports -# qualified module names, as well as Unix pattern matching. -# ignored-modules = - -# Python code to execute, usually for sys.path manipulation such as -# pygtk.require(). -# init-hook = - -# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the -# number of processors available to use, and will cap the count on Windows to -# avoid hangs. -jobs = 0 - -# Control the amount of potential inferred values when inferring a single object. -# This can help the performance when dealing with large functions or complex, -# nested conditions. -limit-inference-results = 100 - -# List of plugins (as comma separated values of python module names) to load, -# usually to register additional checkers. -# load-plugins = - -# Pickle collected data for later comparisons. -persistent = true - -# Minimum Python version to use for version dependent checks. Will default to the -# version used to run pylint. -py-version = "3.9" - -# Discover python modules and packages in the file system subtree. -# recursive = - -# Add paths to the list of the source roots. Supports globbing patterns. The -# source root is an absolute path or a path relative to the current working -# directory used to determine a package namespace for modules located under the -# source root. -# source-roots = - -# When enabled, pylint would attempt to guess common misconfiguration and emit -# user-friendly hints instead of false-positive error messages. -suggestion-mode = true - -# Allow loading of arbitrary C extensions. Extensions are imported into the -# active Python interpreter and may run arbitrary code. -# unsafe-load-any-extension = - -[tool.pylint.basic] -# Naming style matching correct argument names. -argument-naming-style = "snake_case" - -# Regular expression matching correct argument names. Overrides argument-naming- -# style. If left empty, argument names will be checked with the set naming style. -argument-rgx = "(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$" - -# Naming style matching correct attribute names. -attr-naming-style = "snake_case" - -# Regular expression matching correct attribute names. Overrides attr-naming- -# style. If left empty, attribute names will be checked with the set naming -# style. -attr-rgx = "(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$" - -# Bad variable names which should always be refused, separated by a comma. -bad-names = ["foo", "bar", "baz", "toto", "tutu", "tata"] - -# Bad variable names regexes, separated by a comma. If names match any regex, -# they will always be refused -# bad-names-rgxs = - -# Naming style matching correct class attribute names. -class-attribute-naming-style = "any" - -# Regular expression matching correct class attribute names. Overrides class- -# attribute-naming-style. If left empty, class attribute names will be checked -# with the set naming style. -class-attribute-rgx = "([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$" - -# Naming style matching correct class constant names. -class-const-naming-style = "UPPER_CASE" - -# Regular expression matching correct class constant names. Overrides class- -# const-naming-style. If left empty, class constant names will be checked with -# the set naming style. -# class-const-rgx = - -# Naming style matching correct class names. -class-naming-style = "PascalCase" - -# Regular expression matching correct class names. Overrides class-naming-style. -# If left empty, class names will be checked with the set naming style. -class-rgx = "[A-Z_][a-zA-Z0-9]+$" - -# Naming style matching correct constant names. -const-naming-style = "UPPER_CASE" - -# Regular expression matching correct constant names. Overrides const-naming- -# style. If left empty, constant names will be checked with the set naming style. -const-rgx = "(([A-Z_][A-Z0-9_]*)|(__.*__))$" - -# Minimum line length for functions/classes that require docstrings, shorter ones -# are exempt. -docstring-min-length = -1 - -# Naming style matching correct function names. -function-naming-style = "snake_case" - -# Regular expression matching correct function names. Overrides function-naming- -# style. If left empty, function names will be checked with the set naming style. -function-rgx = "(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$" - -# Good variable names which should always be accepted, separated by a comma. -good-names = ["i", "j", "k", "ex", "Run", "_"] - -# Good variable names regexes, separated by a comma. If names match any regex, -# they will always be accepted -# good-names-rgxs = - -# Include a hint for the correct naming format with invalid-name. -# include-naming-hint = - -# Naming style matching correct inline iteration names. -inlinevar-naming-style = "any" - -# Regular expression matching correct inline iteration names. Overrides -# inlinevar-naming-style. If left empty, inline iteration names will be checked -# with the set naming style. -inlinevar-rgx = "[A-Za-z_][A-Za-z0-9_]*$" - -# Naming style matching correct method names. -method-naming-style = "snake_case" - -# Regular expression matching correct method names. Overrides method-naming- -# style. If left empty, method names will be checked with the set naming style. -method-rgx = "(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$" - -# Naming style matching correct module names. -module-naming-style = "snake_case" - -# Regular expression matching correct module names. Overrides module-naming- -# style. If left empty, module names will be checked with the set naming style. -module-rgx = "(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$" - -# Colon-delimited sets of names that determine each other's naming style when the -# name regexes allow several styles. -# name-group = - -# Regular expression which should only match function or class names that do not -# require a docstring. -no-docstring-rgx = "^_" - -# List of decorators that produce properties, such as abc.abstractproperty. Add -# to this list to register other decorators that produce valid properties. These -# decorators are taken in consideration only for invalid-name. -property-classes = ["abc.abstractproperty"] - -# Regular expression matching correct type alias names. If left empty, type alias -# names will be checked with the set naming style. -# typealias-rgx = - -# Regular expression matching correct type variable names. If left empty, type -# variable names will be checked with the set naming style. -# typevar-rgx = - -# Naming style matching correct variable names. -variable-naming-style = "snake_case" - -# Regular expression matching correct variable names. Overrides variable-naming- -# style. If left empty, variable names will be checked with the set naming style. -variable-rgx = "(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$" - -[tool.pylint.classes] -# Warn about protected attribute access inside special methods -# check-protected-access-in-special-methods = - -# List of method names used to declare (i.e. assign) instance attributes. -defining-attr-methods = ["__init__", "__new__", "setUp"] - -# List of member names, which should be excluded from the protected access -# warning. -exclude-protected = ["_asdict", "_fields", "_replace", "_source", "_make"] - -# List of valid names for the first argument in a class method. -valid-classmethod-first-arg = ["cls"] - -# List of valid names for the first argument in a metaclass class method. -valid-metaclass-classmethod-first-arg = ["mcs"] - -[tool.pylint.design] -# List of regular expressions of class ancestor names to ignore when counting -# public methods (see R0903) -# exclude-too-few-public-methods = - -# List of qualified class names to ignore when counting class parents (see R0901) -# ignored-parents = - -# Maximum number of arguments for function / method. -max-args = 5 - -# Maximum number of attributes for a class (see R0902). -max-attributes = 7 - -# Maximum number of boolean expressions in an if statement (see R0916). -max-bool-expr = 5 - -# Maximum number of branch for function / method body. -max-branches = 12 - -# Maximum number of locals for function / method body. -max-locals = 15 - -# Maximum number of parents for a class (see R0901). -max-parents = 7 - -# Maximum number of public methods for a class (see R0904). -max-public-methods = 20 - -# Maximum number of return / yield for function / method body. -max-returns = 6 - -# Maximum number of statements in function / method body. -max-statements = 50 - -# Minimum number of public methods for a class (see R0903). -min-public-methods = 2 - -[tool.pylint.exceptions] -# Exceptions that will emit a warning when caught. -# overgeneral-exceptions = ["Exception"] - -[tool.pylint.format] -# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. -# expected-line-ending-format = - -# Regexp for a line that is allowed to be longer than the limit. -ignore-long-lines = "^\\s*(# )??$" - -# Number of spaces of indent required inside a hanging or continued line. -indent-after-paren = 4 - -# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 -# tab). -indent-string = " " - -# Maximum number of characters on a single line. -max-line-length = 100 - -# Maximum number of lines in a module. -max-module-lines = 1000 - -# Allow the body of a class to be on the same line as the declaration if body -# contains single statement. -# single-line-class-stmt = - -# Allow the body of an if to be on the same line as the test if there is no else. -# single-line-if-stmt = - -[tool.pylint.imports] -# List of modules that can be imported at any level, not just the top level one. -# allow-any-import-level = - -# Allow explicit reexports by alias from a package __init__. -# allow-reexport-from-package = - -# Allow wildcard imports from modules that define __all__. -# allow-wildcard-with-all = - -# Deprecated modules which should not be used, separated by a comma. -deprecated-modules = ["optparse", "tkinter.tix"] - -# Output a graph (.gv or any supported image format) of external dependencies to -# the given file (report RP0402 must not be disabled). -# ext-import-graph = - -# Output a graph (.gv or any supported image format) of all (i.e. internal and -# external) dependencies to the given file (report RP0402 must not be disabled). -# import-graph = - -# Output a graph (.gv or any supported image format) of internal dependencies to -# the given file (report RP0402 must not be disabled). -# int-import-graph = - -# Force import order to recognize a module as part of the standard compatibility -# libraries. -# known-standard-library = - -# Force import order to recognize a module as part of a third party library. -known-third-party = ["enchant"] - -# Couples of modules and preferred modules, separated by a comma. -# preferred-modules = - -[tool.pylint.logging] -# The type of string formatting that logging methods do. `old` means using % -# formatting, `new` is for `{}` formatting. -logging-format-style = "old" - -# Logging modules to check that the string format arguments are in logging -# function parameter format. -logging-modules = ["logging"] - -[tool.pylint."messages control"] -# Only show warnings with the listed confidence levels. Leave empty to show all. -# Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, UNDEFINED. -confidence = ["HIGH", "CONTROL_FLOW", "INFERENCE", "INFERENCE_FAILURE", "UNDEFINED"] - -# Disable the message, report, category or checker with the given id(s). You can -# either give multiple identifiers separated by comma (,) or put this option -# multiple times (only on the command line, not in the configuration file where -# it should appear only once). You can also use "--disable=all" to disable -# everything first and then re-enable specific checks. For example, if you want -# to run only the similarities checker, you can use "--disable=all -# --enable=similarities". If you want to run only the classes checker, but have -# no Warning level messages displayed, use "--disable=all --enable=classes -# --disable=W". -disable = ["raw-checker-failed", "bad-inline-option", "locally-disabled", "file-ignored", "suppressed-message", "useless-suppression", "deprecated-pragma", "use-symbolic-message-instead", "use-implicit-booleaness-not-comparison-to-string", "use-implicit-booleaness-not-comparison-to-zero", "duplicate-code", "fixme", "too-many-branches", "c-extension-no-member", "literal-comparison", "pointless-string-statement"] - -# Enable the message, report, category or checker with the given id(s). You can -# either give multiple identifier separated by comma (,) or put this option -# multiple time (only on the command line, not in the configuration file where it -# should appear only once). See also the "--disable" option for examples. -# enable = - -[tool.pylint.method_args] -# List of qualified names (i.e., library.method) which require a timeout -# parameter e.g. 'requests.api.get,requests.api.post' -timeout-methods = ["urllib.request.urlopen", "requests.api.delete", "requests.api.get", "requests.api.head", "requests.api.options", "requests.api.patch", "requests.api.post", "requests.api.put", "requests.api.request"] - -[tool.pylint.miscellaneous] -# List of note tags to take in consideration, separated by a comma. -notes = ["FIXME", "XXX", "TODO"] - -# Regular expression of note tags to take in consideration. -# notes-rgx = - -[tool.pylint.refactoring] -# Maximum number of nested blocks for function / method body -max-nested-blocks = 5 - -# Complete name of functions that never returns. When checking for inconsistent- -# return-statements if a never returning function is called then it will be -# considered as an explicit return statement and no message will be printed. -never-returning-functions = ["sys.exit", "argparse.parse_error"] - -# Let 'consider-using-join' be raised when the separator to join on would be non- -# empty (resulting in expected fixes of the type: ``"- " + " - ".join(items)``) -suggest-join-with-non-empty-separator = true - -[tool.pylint.reports] -# Python expression which should return a score less than or equal to 10. You -# have access to the variables 'fatal', 'error', 'warning', 'refactor', -# 'convention', and 'info' which contain the number of messages in each category, -# as well as 'statement' which is the total number of statements analyzed. This -# score is used by the global evaluation report (RP0004). -evaluation = "10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)" - -# Template used to display messages. This is a python new-style format string -# used to format the message information. See doc for all details. -# msg-template = - -# Set the output format. Available formats are: text, parseable, colorized, json2 -# (improved json format), json (old json format) and msvs (visual studio). You -# can also give a reporter class, e.g. mypackage.mymodule.MyReporterClass. -# output-format = - -# Tells whether to display a full report or only the messages. -# reports = - -# Activate the evaluation score. -score = true - -[tool.pylint.similarities] -# Comments are removed from the similarity computation -ignore-comments = true - -# Docstrings are removed from the similarity computation -ignore-docstrings = true - -# Imports are removed from the similarity computation -ignore-imports = true - -# Signatures are removed from the similarity computation -ignore-signatures = true - -# Minimum lines number of a similarity. -min-similarity-lines = 4 - -[tool.pylint.spelling] -# Limits count of emitted suggestions for spelling mistakes. -max-spelling-suggestions = 4 - -# Spelling dictionary name. No available dictionaries : You need to install both -# the python package and the system dependency for enchant to work. -# spelling-dict = - -# List of comma separated words that should be considered directives if they -# appear at the beginning of a comment and should not be checked. -spelling-ignore-comment-directives = "fmt: on,fmt: off,noqa:,noqa,nosec,isort:skip,mypy:" - -# List of comma separated words that should not be checked. -# spelling-ignore-words = - -# A path to a file that contains the private dictionary; one word per line. -# spelling-private-dict-file = - -# Tells whether to store unknown words to the private dictionary (see the -# --spelling-private-dict-file option) instead of raising a message. -# spelling-store-unknown-words = - -[tool.pylint.typecheck] -# List of decorators that produce context managers, such as -# contextlib.contextmanager. Add to this list to register other decorators that -# produce valid context managers. -contextmanager-decorators = ["contextlib.contextmanager"] - -# List of members which are set dynamically and missed by pylint inference -# system, and so shouldn't trigger E1101 when accessed. Python regular -# expressions are accepted. -generated-members = "env,dlloverrides,wine_path,bindir,config.*" - -# Tells whether missing members accessed in mixin class should be ignored. A -# class is considered mixin if its name matches the mixin-class-rgx option. -# Tells whether to warn about missing members when the owner of the attribute is -# inferred to be None. -ignore-none = true - -# This flag controls whether pylint should warn about no-member and similar -# checks whenever an opaque object is returned when inferring. The inference can -# return multiple potential results while evaluating a Python object, but some -# branches might not be evaluated, which results in partial inference. In that -# case, it might be useful to still emit no-member and other checks for the rest -# of the inferred objects. -ignore-on-opaque-inference = true - -# List of symbolic message names to ignore for Mixin members. -ignored-checks-for-mixins = ["no-member", "not-async-context-manager", "not-context-manager", "attribute-defined-outside-init"] - -# List of class names for which member attributes should not be checked (useful -# for classes with dynamically set attributes). This supports the use of -# qualified names. -ignored-classes = ["optparse.Values", "thread._local", "_thread._local"] - -# Show a hint with possible names when a member name was not found. The aspect of -# finding the hint is based on edit distance. -missing-member-hint = true - -# The minimum edit distance a name should have in order to be considered a -# similar match for a missing member name. -missing-member-hint-distance = 1 - -# The total number of similar names that should be taken in consideration when -# showing a hint for a missing member. -missing-member-max-choices = 1 - -# Regex pattern to define which classes are considered mixins. -mixin-class-rgx = ".*[Mm]ixin" - -# List of decorators that change the signature of a decorated function. -# signature-mutators = - -[tool.pylint.variables] -# List of additional names supposed to be defined in builtins. Remember that you -# should avoid defining new builtins when possible. -# additional-builtins = - -# Tells whether unused global variables should be treated as a violation. -allow-global-unused-variables = true - -# List of names allowed to shadow builtins -# allowed-redefined-builtins = - -# List of strings which can identify a callback function by name. A callback name -# must start or end with one of those strings. -callbacks = ["cb_", "_cb"] - -# A regular expression matching the name of dummy variables (i.e. expected to not -# be used). -dummy-variables-rgx = "_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_" - -# Argument names that match this expression will be ignored. -ignored-argument-names = "_.*|^ignored_|^unused_" - -# Tells whether we should check for unused import in __init__ files. -# init-import = - -# List of qualified module names which can have objects that can redefine -# builtins. -redefining-builtins-modules = ["six.moves", "future.builtins"] diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 00000000..a3e4fff4 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,113 @@ +# Exclude a variety of commonly ignored directories. +exclude = [ + ".bzr", + ".direnv", + ".eggs", + ".git", + ".git-rewrite", + ".hg", + ".ipynb_checkpoints", + ".mypy_cache", + ".nox", + ".pants.d", + ".pyenv", + ".pytest_cache", + ".pytype", + ".ruff_cache", + ".svn", + ".tox", + ".venv", + ".vscode", + "__pypackages__", + "_build", + "buck-out", + "build", + "dist", + "node_modules", + "site-packages", + "venv", + "protonfixes_test.py", +] + +# Same as Black. +line-length = 88 +indent-width = 4 + +# Assume Python 3.9 +# Note: Should sync with the SLR's Python +target-version = "py39" + +[lint] +# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. +# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or +# McCabe complexity (`C901`) by default. +select = [ + "E4", + "E7", + "E9", + "F", + "ANN", + # Detect for unused arguments + "ARG", + # Enforce f-string instead of str.join + "FLY", + # Simplify and update syntax to our target Python version + "UP", + "D" +] +ignore = [ + # Requiring a type for self is deprecated + "ANN101", + # Ignore starting with 'This' + "D404", + # Ignore imperative mood + "D401", + # Ignore period endings + "D400", + # Ignore punctuation + "D415", + # Ignore '1 blank line required before class docstring' + "D203", + # Ignore 'Multi-line docstring summary should start at the second line' + "D213", + # Ignore 'Missing docstring in public package' + "D104", +] + +# Allow fix for all enabled rules (when `--fix`) is provided. +fixable = ["ALL"] +unfixable = [] + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[lint.per-file-ignores] +# Relax docstring-related lint rules for gamefixes +"gamefixes-*" = ["D103", "D205"] + +[format] +# Like Black, use double quotes for strings. +quote-style = "single" + +# Like Black, indent with spaces, rather than tabs. +indent-style = "space" + +# Like Black, respect magic trailing commas. +skip-magic-trailing-comma = false + +# Like Black, automatically detect the appropriate line ending. +line-ending = "auto" + +# Enable auto-formatting of code examples in docstrings. Markdown, +# reStructuredText code/literal blocks and doctests are all supported. +# +# This is currently disabled by default, but it is planned for this +# to be opt-out in the future. +docstring-code-format = false + +# Set the line length limit used when formatting code snippets in +# docstrings. +# +# This only has an effect when the `docstring-code-format` setting is +# enabled. +docstring-code-line-length = "dynamic" diff --git a/steamhelper.py b/steamhelper.py index 2089a985..e742059f 100644 --- a/steamhelper.py +++ b/steamhelper.py @@ -1,5 +1,4 @@ -""" The Steamhelper allows the installation of Steam apps -""" +"""The Steamhelper allows the installation of Steam apps""" import os import re @@ -12,37 +11,37 @@ REGEX_LIB = re.compile(r'"path"\s*"(?P(.*))"') REGEX_STATE = re.compile(r'"StateFlags"\s*"(?P(\d))"') STEAM_DIRS = [ - "~/.steam/root", - "~/.steam/debian-installation", - "~/.local/share/Steam", - "~/.steam/steam" + '~/.steam/root', + '~/.steam/debian-installation', + '~/.local/share/Steam', + '~/.steam/steam', ] + def install_app(appid: str, delay: int = 1) -> None: - """ Wait for the installation of an appid - """ + """Wait for the installation of an appid""" _install_steam_appid(appid) while not _is_app_installed(appid): time.sleep(delay) + def _install_steam_appid(appid: str) -> None: - """ Call steam URL - """ - install_url = "steam://install/"+str(appid) - if shutil.which("xdg-open"): - subprocess.call(["xdg-open", install_url]) - elif shutil.which("gvfs-open"): - subprocess.call(["gvfs-open", install_url]) - elif shutil.which("gnome-open"): - subprocess.call(["gnome-open", install_url]) - elif shutil.which("kde-open"): - subprocess.call(["kde-open", install_url]) - elif shutil.which("exo-open"): - subprocess.call(["exo-open", install_url]) + """Call steam URL""" + install_url = f'steam://install/{appid}' + if shutil.which('xdg-open'): + subprocess.call(['xdg-open', install_url]) + elif shutil.which('gvfs-open'): + subprocess.call(['gvfs-open', install_url]) + elif shutil.which('gnome-open'): + subprocess.call(['gnome-open', install_url]) + elif shutil.which('kde-open'): + subprocess.call(['kde-open', install_url]) + elif shutil.which('exo-open'): + subprocess.call(['exo-open', install_url]) + def _is_app_installed(appid: str) -> bool: - """ Check if app is installed - """ + """Check if app is installed""" libraries_path = _get_steam_libraries_path() # bypass no library path @@ -54,17 +53,19 @@ def _is_app_installed(appid: str) -> bool: appmanifest_path = _get_manifest_path(appid, librarypath) if os.path.exists(appmanifest_path): state = _find_regex_groups(appmanifest_path, REGEX_STATE, 'state') - if(len(state)>0 and int(state[0])==4): + if len(state) > 0 and int(state[0]) == 4: is_installed = True break return is_installed + def _get_steam_libraries_path() -> list: - """ Get Steam Libraries Path - """ + """Get Steam Libraries Path""" if len(libpaths) == 0: for steampath in STEAM_DIRS: - libfile = os.path.join(os.path.expanduser(steampath),"steamapps","libraryfolders.vdf") + libfile = os.path.join( + os.path.expanduser(steampath), 'steamapps', 'libraryfolders.vdf' + ) if os.path.exists(libfile): libpaths.append(_find_regex_groups(libfile, REGEX_LIB, 'path')) break @@ -72,14 +73,12 @@ def _get_steam_libraries_path() -> list: def _get_manifest_path(appid: str, librarypath: str) -> str: - """Get appmanifest path - """ - return os.path.join(librarypath, "steamapps", f"appmanifest_{str(appid)}.acf") + """Get appmanifest path""" + return os.path.join(librarypath, 'steamapps', f'appmanifest_{str(appid)}.acf') + def _find_regex_groups(path: str, regex: re.Pattern, groupname: str) -> list: - """ Given a file and a regex with a named group groupname, return an - array of all the matches - """ + """Given a file and a regex with a named group groupname, return an array of all the matches""" matches = [] with open(path, encoding='ascii') as re_file: for line in re_file: diff --git a/tools/check_gamefixes.py b/tools/check_gamefixes.py index fb126b12..01e99314 100644 --- a/tools/check_gamefixes.py +++ b/tools/check_gamefixes.py @@ -1,9 +1,9 @@ -# pylint: disable=C0114 -import sys +import sys # noqa: D100 from pathlib import Path from urllib.request import urlopen, Request from http.client import HTTPSConnection -from typing import Any, Iterator, Generator +from typing import Any +from collections.abc import Iterator, Generator import ijson @@ -142,7 +142,7 @@ def check_gogfixes(project: Path, url: str, api: ApiEndpoint) -> None: raise ValueError(err) -def _batch_generator(gamefix: Path, size=50) -> Generator[set[str], Any, Any]: +def _batch_generator(gamefix: Path, size: int = 50) -> Generator[set[str], Any, Any]: appids = set() # Keep track of the count because some APIs enforce limits count = 0 diff --git a/tools/lint.sh b/tools/lint.sh deleted file mode 100644 index 882f8f36..00000000 --- a/tools/lint.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -# -# Lint with Pylint -# - -# Lint the following gamefix dir: -# steam, gog, amazon, egs, humble, itchio, ubisoft, umu, zoomplatform -mapfile -d '' files_array < <(find ./{,gamefixes-steam,gamefixes-amazon,gamefixes-gog,gamefixes-egs,gamefixes-humble,gamefixes-itchio,gamefixes-ubisoft,gamefixes-umu,gamefixes-zoomplatform} -type f -name "*.py" ! -name "__init__.py" -print0) - -# Disable these checks: -# - E0401: Import errors because umu-protonfixes will be renamed at release -# - C0103: Invalid identifier names for files, as gamefixes are numeric -# - C0116: Missing docstrings for functions or method -# - C0301: Long lines -pylint --rcfile pyproject.toml --disable E0401,C0103,C0116,C0301 "${files_array[@]}" diff --git a/util.py b/util.py index fda4cdba..dd015b17 100644 --- a/util.py +++ b/util.py @@ -1,7 +1,7 @@ -""" Utilities to make gamefixes easier -""" +"""Utilities to make gamefixes easier""" import configparser +from io import TextIOWrapper import os import sys import re @@ -13,14 +13,13 @@ import urllib.request import functools from socket import socket, AF_INET, SOCK_DGRAM -from typing import Union, Literal, Mapping +from typing import Literal, Any, Callable, Union +from collections.abc import Mapping, Generator try: - from . import config from .logger import log from .steamhelper import install_app except ImportError: - import config from logger import log from steamhelper import install_app @@ -30,10 +29,8 @@ log.warn('Unable to hook into Proton main script environment') -def which(appname: str) -> str: - """ Returns the full path of an executable in $PATH - """ - +def which(appname: str) -> Union[str, None]: + """Returns the full path of an executable in $PATH""" for path in os.environ['PATH'].split(os.pathsep): fullpath = os.path.join(path, appname) if os.path.exists(fullpath) and os.access(fullpath, os.X_OK): @@ -43,26 +40,18 @@ def which(appname: str) -> str: def protondir() -> str: - """ Returns the path to proton - """ - + """Returns the path to proton""" proton_dir = os.path.dirname(sys.argv[0]) return proton_dir def protonprefix() -> str: - """ Returns the wineprefix used by proton - """ + """Returns the wineprefix used by proton""" + return os.path.join(os.environ['STEAM_COMPAT_DATA_PATH'], 'pfx/') - return os.path.join( - os.environ['STEAM_COMPAT_DATA_PATH'], - 'pfx/') - - -def protonnameversion() -> str: - """ Returns the version of proton from sys.argv[0] - """ +def protonnameversion() -> Union[str, None]: + """Returns the version of proton from sys.argv[0]""" version = re.search('Proton ([0-9]*\\.[0-9]*)', sys.argv[0]) if version: return version.group(1) @@ -71,12 +60,10 @@ def protonnameversion() -> str: def protontimeversion() -> int: - """ Returns the version timestamp of proton from the `version` file - """ - + """Returns the version timestamp of proton from the `version` file""" fullpath = os.path.join(protondir(), 'version') try: - with open(fullpath, 'r', encoding='ascii') as version: + with open(fullpath, encoding='ascii') as version: for timestamp in version.readlines(): return int(timestamp.strip()) except OSError: @@ -86,16 +73,18 @@ def protontimeversion() -> int: return 0 -def protonversion(timestamp: bool = False) -> Union[str, int]: - """ Returns the version of proton - """ +def protonversion(timestamp: bool = False) -> Union[str, None, int]: + """Returns the version of proton""" if timestamp: return protontimeversion() return protonnameversion() -def once(func: callable = None, retry: bool = False): - """ Decorator to use on functions which should only run once in a prefix. +def once( + func: Union[Callable, None] = None, retry: bool = False +) -> Union[None, Callable[..., Any]]: + """Decorator to use on functions which should only run once in a prefix. + Error handling: By default, when an exception occurs in the decorated function, the function is not run again. To change that behavior, set retry to True. @@ -109,8 +98,7 @@ def once(func: callable = None, retry: bool = False): if func is None: return functools.partial(once, retry=retry) - #pylint: disable=missing-docstring - def wrapper(*args, **kwargs): + def wrapper(*args, **kwargs) -> None: # noqa: ANN002, ANN003 func_id = f'{func.__module__}.{func.__name__}' prefix = protonprefix() directory = os.path.join(prefix, 'drive_c/protonfixes/run/') @@ -123,7 +111,7 @@ def wrapper(*args, **kwargs): exception = None try: func(*args, **kwargs) - except Exception as exc: #pylint: disable=broad-except + except Exception as exc: if retry: raise exc exception = exc @@ -132,16 +120,15 @@ def wrapper(*args, **kwargs): tmp.close() if exception: - raise exception #pylint: disable=raising-bad-type + raise exception return + return wrapper def _killhanging() -> None: - """ Kills processes that hang when installing winetricks - """ - + """Kills processes that hang when installing winetricks""" # avoiding an external library as proc should be available on linux log.debug('Killing hanging wine processes') pids = [pid for pid in os.listdir('/proc') if pid.isdigit()] @@ -153,22 +140,19 @@ def _killhanging() -> None: for exe in badexes: if exe in cmdline.decode(): os.kill(int(pid), signal.SIGKILL) - except IOError: + except OSError: continue def _forceinstalled(verb: str) -> None: - """ Records verb into the winetricks.log.forced file - """ + """Records verb into the winetricks.log.forced file""" forced_log = os.path.join(protonprefix(), 'winetricks.log.forced') with open(forced_log, 'a', encoding='ascii') as forcedlog: forcedlog.write(verb + '\n') def _checkinstalled(verb: str, logfile: str = 'winetricks.log') -> bool: - """ Returns True if the winetricks verb is found in the winetricks log - """ - + """Returns True if the winetricks verb is found in the winetricks log""" if not isinstance(verb, str): return False @@ -180,7 +164,7 @@ def _checkinstalled(verb: str, logfile: str = 'winetricks.log') -> bool: wt_verb_param = verb.split('=')[1] wt_is_set = False try: - with open(winetricks_log, 'r', encoding='ascii') as tricklog: + with open(winetricks_log, encoding='ascii') as tricklog: for xline in tricklog.readlines(): if re.findall(r'^' + wt_verb, xline.strip()): wt_is_set = bool(xline.strip() == wt_verb + wt_verb_param) @@ -189,7 +173,7 @@ def _checkinstalled(verb: str, logfile: str = 'winetricks.log') -> bool: return False # Check for regular verbs try: - with open(winetricks_log, 'r', encoding='ascii') as tricklog: + with open(winetricks_log, encoding='ascii') as tricklog: if verb in reversed([x.strip() for x in tricklog.readlines()]): return True except OSError: @@ -198,9 +182,7 @@ def _checkinstalled(verb: str, logfile: str = 'winetricks.log') -> bool: def checkinstalled(verb: str) -> bool: - """ Returns True if the winetricks verb is found in the winetricks log - or in the 'winetricks.log.forced' file - """ + """Returns True if the winetricks verb is found in the winetricks log or in the 'winetricks.log.forced' file""" if verb == 'gui': return False @@ -210,9 +192,8 @@ def checkinstalled(verb: str) -> bool: return _checkinstalled(verb) -def is_custom_verb(verb: str) -> bool: - """ Returns path to custom winetricks verb, if found - """ +def is_custom_verb(verb: str) -> Union[bool, str]: + """Returns path to custom winetricks verb, if found""" if verb == 'gui': return False @@ -239,15 +220,14 @@ def check_internet() -> bool: try: with socket(AF_INET, SOCK_DGRAM) as sock: sock.settimeout(5) - sock.connect(("1.1.1.1", 53)) + sock.connect(('1.1.1.1', 53)) return True except (TimeoutError, OSError): return False def protontricks(verb: str) -> bool: - """ Runs winetricks if available - """ + """Runs winetricks if available""" if not checkinstalled(verb): if check_internet(): # Proceed with your function logic here @@ -265,7 +245,7 @@ def protontricks(verb: str) -> bool: env['WINETRICKS_LATEST_VERSION_CHECK'] = 'disabled' env['LD_PRELOAD'] = '' - winetricks_bin = os.path.abspath(__file__).replace('util.py','winetricks') + winetricks_bin = os.path.abspath(__file__).replace('util.py', 'winetricks') winetricks_cmd = [winetricks_bin, '--unattended'] + verb.split(' ') if verb == 'gui': winetricks_cmd = [winetricks_bin, '--unattended'] @@ -279,7 +259,6 @@ def protontricks(verb: str) -> bool: log.warn('No winetricks was found in $PATH') if winetricks_bin is not None: - log.debug('Using winetricks command: ' + str(winetricks_cmd)) # make sure proton waits for winetricks to finish @@ -311,10 +290,14 @@ def protontricks(verb: str) -> bool: return False -def regedit_add(folder: str, name: str = None, typ: str = None, value: str = None, arch: bool = False) -> None: - """ Add regedit keys - """ - +def regedit_add( + folder: str, + name: Union[str, None] = None, + typ: Union[str, None] = None, + value: Union[str, None] = None, + arch: bool = False, +) -> None: + """Add regedit keys""" env = dict(protonmain.g_session.env) env['WINEPREFIX'] = protonprefix() env['WINE'] = protonmain.g_proton.wine_bin @@ -322,23 +305,46 @@ def regedit_add(folder: str, name: str = None, typ: str = None, value: str = Non env['WINESERVER'] = protonmain.g_proton.wineserver_bin if name is not None and typ is not None and value is not None: - # Flag for if we want to force writing to the 64-bit registry sector if arch: - regedit_cmd = ['wine', 'reg' , 'add', folder, '/f', '/v', name, '/t', typ, '/d', value, '/reg:64'] + regedit_cmd = [ + 'wine', + 'reg', + 'add', + folder, + '/f', + '/v', + name, + '/t', + typ, + '/d', + value, + '/reg:64', + ] else: - regedit_cmd = ['wine', 'reg' , 'add', folder, '/f', '/v', name, '/t', typ, '/d', value] + regedit_cmd = [ + 'wine', + 'reg', + 'add', + folder, + '/f', + '/v', + name, + '/t', + typ, + '/d', + value, + ] log.info('Adding key: ' + folder) else: - # Flag for if we want to force writing to the 64-bit registry sector # We use name here because without the other flags we can't use the arch flag if name is not None: - regedit_cmd = ['wine', 'reg' , 'add', folder, '/f', '/reg:64'] + regedit_cmd = ['wine', 'reg', 'add', folder, '/f', '/reg:64'] else: - regedit_cmd = ['wine', 'reg' , 'add', folder, '/f'] + regedit_cmd = ['wine', 'reg', 'add', folder, '/f'] log.info('Adding key: ' + folder) @@ -346,12 +352,15 @@ def regedit_add(folder: str, name: str = None, typ: str = None, value: str = Non process.wait() -def replace_command(orig: str, repl: str, match_flags: re.RegexFlag = re.IGNORECASE) -> bool: - """ Make a commandline replacement in sys.argv - Returns if there was any match. +def replace_command( + orig: str, repl: str, match_flags: re.RegexFlag = re.IGNORECASE +) -> bool: + """Make a commandline replacement in sys.argv - By default the search is case insensitive, - you can override this behaviour with re.RegexFlag.NOFLAG + Returns if there was any match. + + By default the search is case insensitive, + you can override this behaviour with re.RegexFlag.NOFLAG """ found = False for idx, arg in enumerate(sys.argv): @@ -369,27 +378,21 @@ def replace_command(orig: str, repl: str, match_flags: re.RegexFlag = re.IGNOREC def append_argument(argument: str) -> None: - """ Append an argument to sys.argv - """ - + """Append an argument to sys.argv""" log.info('Adding argument ' + argument) sys.argv.append(argument) log.debug('New commandline: ' + str(sys.argv)) def set_environment(envvar: str, value: str) -> None: - """ Add or override an environment value - """ - + """Add or override an environment value""" log.info(f'Adding env: {envvar}={value}') os.environ[envvar] = value protonmain.g_session.env[envvar] = value def del_environment(envvar: str) -> None: - """ Remove an environment variable - """ - + """Remove an environment variable""" log.info('Removing env: ' + envvar) if envvar in os.environ: del os.environ[envvar] @@ -398,8 +401,7 @@ def del_environment(envvar: str) -> None: def get_game_install_path() -> str: - """ Game installation path - """ + """Game installation path""" install_path = os.environ['PWD'] if 'STEAM_COMPAT_INSTALL_PATH' in os.environ: install_path = os.environ['STEAM_COMPAT_INSTALL_PATH'] @@ -409,18 +411,16 @@ def get_game_install_path() -> str: def winedll_override(dll: str, dtype: Literal['n', 'b', 'n,b', 'b,n', '']) -> None: - """ Add WINE dll override - """ - + """Add WINE dll override""" log.info(f'Overriding {dll}.dll = {dtype}') setting = f'{dll}={dtype}' - protonmain.append_to_env_str(protonmain.g_session.env, 'WINEDLLOVERRIDES', setting, ';') + protonmain.append_to_env_str( + protonmain.g_session.env, 'WINEDLLOVERRIDES', setting, ';' + ) def disable_nvapi() -> None: - """ Disable WINE nv* dlls - """ - + """Disable WINE nv* dlls""" log.info('Disabling NvAPI') winedll_override('nvapi', '') winedll_override('nvapi64', '') @@ -431,34 +431,30 @@ def disable_nvapi() -> None: def disable_esync() -> None: - """ Disabling Esync - """ - + """Disabling Esync""" log.info('Disabling Esync') set_environment('WINEESYNC', '') def disable_fsync() -> None: - """ Disabling FSync - """ - + """Disabling FSync""" log.info('Disabling FSync') set_environment('WINEFSYNC', '') def disable_protonmediaconverter() -> None: - """ Disabling Proton Media Converter - """ - + """Disabling Proton Media Converter""" log.info('Disabling Proton Media Converter') set_environment('PROTON_AUDIO_CONVERT', '0') set_environment('PROTON_AUDIO_CONVERT_BIN', '0') set_environment('PROTON_VIDEO_CONVERT', '0') set_environment('PROTON_DEMUX', '0') + @once def disable_uplay_overlay() -> bool: """Disables the UPlay in-game overlay. + Creates or appends the UPlay settings.yml file with the correct setting to disable the overlay. UPlay will overwrite settings.yml on launch, but keep @@ -468,7 +464,7 @@ def disable_uplay_overlay() -> bool: protonprefix(), 'drive_c/users/steamuser/Local Settings/Application Data/Ubisoft Game Launcher/', ) - config_file = os.path.join(config_dir, "settings.yml") + config_file = os.path.join(config_dir, 'settings.yml') os.makedirs(config_dir, exist_ok=True) @@ -492,7 +488,9 @@ def disable_uplay_overlay() -> bool: return False -def create_dosbox_conf(conf_file: str, conf_dict: Mapping[str, Mapping[str, any]]) -> None: +def create_dosbox_conf( + conf_file: str, conf_dict: Mapping[str, Mapping[str, Any]] +) -> None: """Create DOSBox configuration file. DOSBox accepts multiple configuration files passed with -conf @@ -508,8 +506,9 @@ def create_dosbox_conf(conf_file: str, conf_dict: Mapping[str, Mapping[str, any] def _get_case_insensitive_name(path: str) -> str: - """ Find potentially differently-cased location - e.g /path/to/game/system/gothic.ini -> /path/to/game/System/GOTHIC.INI + """Find potentially differently-cased location + + e.g /path/to/game/system/gothic.ini -> /path/to/game/System/GOTHIC.INI """ if os.path.exists(path): return path @@ -548,13 +547,13 @@ def _get_case_insensitive_name(path: str) -> str: return root -def _get_config_full_path(cfile: str, base_path: str) -> str: - """ Find game's config file - """ - +def _get_config_full_path(cfile: str, base_path: str) -> Union[str, None]: + """Find game's config file""" # Start from 'user'/'game' directories or absolute path if base_path == 'user': - cfg_path = os.path.join(protonprefix(), 'drive_c/users/steamuser/My Documents', cfile) + cfg_path = os.path.join( + protonprefix(), 'drive_c/users/steamuser/My Documents', cfile + ) else: if base_path == 'game': cfg_path = os.path.join(get_game_install_path(), cfile) @@ -571,18 +570,17 @@ def _get_config_full_path(cfile: str, base_path: str) -> str: def create_backup_config(cfg_path: str) -> None: - """ Create backup config file - """ - + """Create backup config file""" # Backup if not os.path.exists(cfg_path + '.protonfixes.bak'): log.info('Creating backup for config file') shutil.copyfile(cfg_path, cfg_path + '.protonfixes.bak') -def set_ini_options(ini_opts: str, cfile: str, encoding: str, base_path: str = 'user') -> bool: - """ Edit game's INI config file - """ +def set_ini_options( + ini_opts: str, cfile: str, encoding: str, base_path: str = 'user' +) -> bool: + """Edit game's INI config file""" cfg_path = _get_config_full_path(cfile, base_path) if not cfg_path: return False @@ -590,10 +588,12 @@ def set_ini_options(ini_opts: str, cfile: str, encoding: str, base_path: str = ' create_backup_config(cfg_path) # set options - conf = configparser.ConfigParser(empty_lines_in_values=True, allow_no_value=True, strict=False) + conf = configparser.ConfigParser( + empty_lines_in_values=True, allow_no_value=True, strict=False + ) conf.optionxform = str - conf.read(cfg_path,encoding) + conf.read(cfg_path, encoding) log.info(f'Addinging INI options into {cfile}:\n{str(ini_opts)}') conf.read_string(ini_opts) @@ -603,9 +603,10 @@ def set_ini_options(ini_opts: str, cfile: str, encoding: str, base_path: str = ' return True -def set_xml_options(base_attibutte: str, xml_line: str, cfile: str, base_path: str = 'user') -> bool: - """ Edit game's XML config file - """ +def set_xml_options( + base_attibutte: str, xml_line: str, cfile: str, base_path: str = 'user' +) -> bool: + """Edit game's XML config file""" xml_path = _get_config_full_path(cfile, base_path) if not xml_path: return False @@ -620,7 +621,7 @@ def set_xml_options(base_attibutte: str, xml_line: str, cfile: str, base_path: s if base_size != backup_size: return False - with open(xml_path, 'r', encoding='utf-8') as file: + with open(xml_path, encoding='utf-8') as file: contents = file.readlines() i = 0 for line in contents: @@ -638,10 +639,9 @@ def set_xml_options(base_attibutte: str, xml_line: str, cfile: str, base_path: s def get_resolution() -> tuple[int, int]: - """ Returns screen res width, height using xrandr - """ + """Returns screen res width, height using xrandr""" # Execute xrandr command and capture its output - xrandr_bin = os.path.abspath(__file__).replace('util.py','xrandr') + xrandr_bin = os.path.abspath(__file__).replace('util.py', 'xrandr') xrandr_output = subprocess.check_output([xrandr_bin, '--current']).decode('utf-8') # Find the line that starts with 'Screen 0:' and extract the resolution @@ -658,16 +658,18 @@ def get_resolution() -> tuple[int, int]: return (0, 0) # or raise Exception('Resolution not found') -def read_dxvk_conf(cfp): - """ Add fake [DEFAULT] section to dxvk.conf - """ +def read_dxvk_conf(cfp: TextIOWrapper) -> Generator[str, None, None]: + """Add fake [DEFAULT] section to dxvk.conf""" yield f'[{configparser.ConfigParser().default_section}]' yield from cfp -def set_dxvk_option(opt: str, val: str, cfile: str = '/tmp/protonfixes_dxvk.conf') -> None: - """ Create custom DXVK config file - See https://github.com/doitsujin/dxvk/wiki/Configuration for details +def set_dxvk_option( + opt: str, val: str, cfile: str = '/tmp/protonfixes_dxvk.conf' +) -> None: + """Create custom DXVK config file + + See https://github.com/doitsujin/dxvk/wiki/Configuration for details """ conf = configparser.ConfigParser() conf.optionxform = str @@ -676,7 +678,10 @@ def set_dxvk_option(opt: str, val: str, cfile: str = '/tmp/protonfixes_dxvk.conf conf.read(cfile) - if not conf.has_option(section, 'session') or conf.getint(section, 'session') != os.getpid(): + if ( + not conf.has_option(section, 'session') + or conf.getint(section, 'session') != os.getpid() + ): log.info('Creating new DXVK config') set_environment('DXVK_CONFIG_FILE', cfile) @@ -687,10 +692,10 @@ def set_dxvk_option(opt: str, val: str, cfile: str = '/tmp/protonfixes_dxvk.conf if os.access(dxvk_conf, os.F_OK): with open(dxvk_conf, encoding='ascii') as dxvk: conf.read_file(read_dxvk_conf(dxvk)) - log.debug(conf.items(section)) + log.debug(f'{conf.items(section)}') # set option - log.info('Addinging DXVK option: '+ str(opt) + ' = ' + str(val)) + log.info('Addinging DXVK option: ' + str(opt) + ' = ' + str(val)) conf.set(section, opt, str(val)) with open(cfile, 'w', encoding='ascii') as configfile: @@ -698,21 +703,19 @@ def set_dxvk_option(opt: str, val: str, cfile: str = '/tmp/protonfixes_dxvk.conf def install_eac_runtime() -> None: - """ Install Proton Easyanticheat Runtime - """ - install_app(1826330) + """Install Proton Easyanticheat Runtime""" + install_app('1826330') def install_battleye_runtime() -> None: - """ Install Proton BattlEye Runtime - """ - install_app(1161040) + """Install Proton BattlEye Runtime""" + install_app('1161040') def install_all_from_tgz(url: str, path: str = os.getcwd()) -> None: - """ Install all files from a downloaded tar.gz - """ - cache_dir = config.cache_dir + """Install all files from a downloaded tar.gz""" + cache_dir = os.path.expanduser('~/.cache/protonfixes') + os.makedirs(cache_dir, exist_ok=True) tgz_file_name = os.path.basename(url) tgz_file_path = os.path.join(cache_dir, tgz_file_name) @@ -726,14 +729,13 @@ def install_all_from_tgz(url: str, path: str = os.getcwd()) -> None: def install_from_zip(url: str, filename: str, path: str = os.getcwd()) -> None: - """ Install a file from a downloaded zip - """ - + """Install a file from a downloaded zip""" if filename in os.listdir(path): log.info(f'File {filename} found in {path}') return - cache_dir = config.cache_dir + cache_dir = os.path.expanduser('~/.cache/protonfixes') + os.makedirs(cache_dir, exist_ok=True) zip_file_name = os.path.basename(url) zip_file_path = os.path.join(cache_dir, zip_file_name) @@ -747,13 +749,15 @@ def install_from_zip(url: str, filename: str, path: str = os.getcwd()) -> None: def try_show_gui_error(text: str) -> None: - """ Trys to show a message box with an error - 1. Try importing tkinter and show messagebox - 2. Try executing process 'notify-send' - 3. Failed, output info to log + """Trys to show a message box with an error + + 1. Try importing tkinter and show messagebox + 2. Try executing process 'notify-send' + 3. Failed, output info to log """ try: # in case in-use Python doesn't have tkinter, which is likely - from tkinter import messagebox # pylint: disable=C0415 + from tkinter import messagebox + messagebox.showerror('Proton Fixes', text) except ImportError: try: @@ -763,8 +767,9 @@ def try_show_gui_error(text: str) -> None: def is_smt_enabled() -> bool: - """ Returns whether SMT is enabled. - If the check has failed, False is returned. + """Returns whether SMT is enabled. + + If the check has failed, False is returned. """ try: with open('/sys/devices/system/cpu/smt/active', encoding='ascii') as smt_file: @@ -777,8 +782,9 @@ def is_smt_enabled() -> bool: def get_cpu_count() -> int: - """ Returns the cpu core count, provided by the OS. - If the request failed, 0 is returned. + """Returns the cpu core count, provided by the OS. + + If the request failed, 0 is returned. """ cpu_cores = os.cpu_count() if not cpu_cores or cpu_cores <= 0: @@ -788,11 +794,11 @@ def get_cpu_count() -> int: def set_cpu_topology(core_count: int, ignore_user_setting: bool = False) -> bool: - """ This sets the cpu topology to a fixed core count. - By default, a user provided topology is prioritized. - You can override this behavior by setting `ignore_user_setting`. - """ + """This sets the cpu topology to a fixed core count. + By default, a user provided topology is prioritized. + You can override this behavior by setting `ignore_user_setting`. + """ # Don't override the user's settings (except, if we override it) user_topo = os.getenv('WINE_CPU_TOPOLOGY') if user_topo and not ignore_user_setting: @@ -811,32 +817,36 @@ def set_cpu_topology(core_count: int, ignore_user_setting: bool = False) -> bool return True -def set_cpu_topology_nosmt(core_limit: int = 0, ignore_user_setting: bool = False, threads_per_core: int = 2) -> bool: - """ This sets the cpu topology to the count of physical cores. - If SMT is enabled, eg. a 4c8t cpu is limited to 4 logical cores. - You can limit the core count to the `core_limit` argument. - """ +def set_cpu_topology_nosmt( + core_limit: int = 0, ignore_user_setting: bool = False, threads_per_core: int = 2 +) -> bool: + """This sets the cpu topology to the count of physical cores. + If SMT is enabled, eg. a 4c8t cpu is limited to 4 logical cores. + You can limit the core count to the `core_limit` argument. + """ # Check first, if SMT is enabled if is_smt_enabled() is False: log.info('SMT is not active, skipping fix') return False # Currently (2024) SMT allows 2 threads per core, this might change in the future - cpu_cores = get_cpu_count() // threads_per_core # Apply divider - cpu_cores = max(cpu_cores, min(cpu_cores, core_limit)) # Apply limit + cpu_cores = get_cpu_count() // threads_per_core # Apply divider + cpu_cores = max(cpu_cores, min(cpu_cores, core_limit)) # Apply limit return set_cpu_topology(cpu_cores, ignore_user_setting) def set_cpu_topology_limit(core_limit: int, ignore_user_setting: bool = False) -> bool: - """ This sets the cpu topology to a limited number of logical cores. - A limit that exceeds the available cores, will be ignored. - """ + """This sets the cpu topology to a limited number of logical cores. + A limit that exceeds the available cores, will be ignored. + """ cpu_cores = get_cpu_count() if core_limit >= cpu_cores: - log.info(f'The count of logical cores ({cpu_cores}) is lower than ' - f'or equal to the set limit ({core_limit}), skipping fix') + log.info( + f'The count of logical cores ({cpu_cores}) is lower than ' + f'or equal to the set limit ({core_limit}), skipping fix' + ) return False # Apply the limit