-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
util.py: - Added create_dos_device() - Added patch_conf_value() - Added patch_voodoo_conf() - Added get_path_syswow64() - Moved class ReplaceType from Bethesda mod support (class Redirect) Other: - Refactored gamefixes to use pathlib - Simplified / reimplemented some fixes - Some docstrings - Linked Gobliiins 5 demo to main game - Unified Gothic 3 and Gothic 3 Forsaken Gods Enhanced Edition - Fixes after rebase
- Loading branch information
Showing
28 changed files
with
429 additions
and
390 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
"""Game fix for Titanfall 2""" | ||
|
||
import os | ||
import subprocess | ||
import glob | ||
from .. import util | ||
|
||
|
||
def main() -> None: | ||
"""Allow -northstar option to work""" | ||
# Define game directory | ||
install_dir = glob.escape(util.get_game_install_path()) | ||
# Path of backup file | ||
backup_file = util.get_game_install_path() / 'Titanfall2.exe.bak' | ||
|
||
# Restore original titanfall2.exe if NorthstarLauncher.exe was previously symlinked | ||
if os.path.isfile(install_dir + '/Titanfall2.exe.bak'): | ||
subprocess.run(['mv', 'Titanfall2.exe.bak', 'Titanfall2.exe'], check=False) | ||
if backup_file.is_file(): | ||
backup_file.rename(backup_file.with_suffix('')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
"""Game fix for Ghostbusters: The Video Game Remastered (2019)""" | ||
|
||
from pathlib import Path | ||
from .. import util | ||
from ..logger import log | ||
|
||
|
||
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 = ( | ||
util.protonprefix() | ||
/ 'drive_c/users/steamuser/Local Settings/' | ||
'Application Data/GHOSTBUSTERS' | ||
) | ||
|
||
try: | ||
Path(save_dir).mkdir(parents=True, exist_ok=True) | ||
save_dir.mkdir(parents=True, exist_ok=True) | ||
except OSError as e: | ||
log(f"Not able to make the settings directory at '{save_dir}': {e}") | ||
log.warn(f"Not able to make the settings directory at '{save_dir}': {e}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,52 @@ | ||
"""Cease to Breathe | ||
Replace included nwjs(0.71) wich doesn't work with 0.86 | ||
Replace included nwjs (0.71) - which 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. | ||
""" | ||
|
||
import os | ||
import glob | ||
import shutil | ||
import urllib.request | ||
import zipfile | ||
import subprocess | ||
import hashlib | ||
|
||
from .. import util | ||
from ..logger import log | ||
from pathlib import Path | ||
|
||
|
||
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')): | ||
url = 'https://dl.nwjs.io/v0.86.0/nwjs-v0.86.0-win-x64.zip' | ||
hashsum = 'ed2681847162e0fa457dd55e293b6f331ccd58acedd934a98e7fe1406c26dd4f' | ||
nwjs = os.path.basename(url) | ||
urllib.request.urlretrieve(url, nwjs) | ||
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: | ||
zip_ref.extractall(install_dir) | ||
nwjs = os.path.join(install_dir, nwjs.rsplit('.', 1)[0]) | ||
shutil.copytree(nwjs, install_dir, dirs_exist_ok=True) | ||
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, | ||
) | ||
install_dir = util.get_game_install_path() | ||
|
||
install_nwjs(install_dir) | ||
patch_package_json(install_dir) | ||
|
||
|
||
def install_nwjs(install_dir: Path) -> None: | ||
if (install_dir / 'nw.exe').is_file(): | ||
return | ||
|
||
url = 'https://dl.nwjs.io/v0.86.0/nwjs-v0.86.0-win-x64.zip' | ||
hashsum = 'ed2681847162e0fa457dd55e293b6f331ccd58acedd934a98e7fe1406c26dd4f' | ||
nwjs = Path(Path(url).name) | ||
urllib.request.urlretrieve(url, nwjs) | ||
|
||
# Check digest | ||
nwjs_sum = hashlib.sha256(nwjs.read_bytes()).hexdigest() | ||
if hashsum != nwjs_sum: | ||
log.warn(f"{nwjs} checksum doesn't match, fix not applied.") | ||
return | ||
|
||
# Install | ||
with zipfile.ZipFile(nwjs, 'r') as zip_ref: | ||
zip_ref.extractall(install_dir) | ||
nwjs_dir = install_dir / nwjs.with_suffix('') | ||
shutil.copytree(nwjs_dir, install_dir, dirs_exist_ok=True) | ||
shutil.rmtree(nwjs_dir) | ||
|
||
|
||
def patch_package_json(install_dir: Path) -> None: | ||
json_file = install_dir / 'package.json' | ||
json = json_file.read_text() | ||
json = json.replace('"frame": true', '"frame": false', 1) | ||
json_file.write_text(json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.