From 7128fe488ddff2588ba10065357a1003e356743e Mon Sep 17 00:00:00 2001 From: R1kaB3rN <100738684+R1kaB3rN@users.noreply.github.com> Date: Mon, 8 Jul 2024 18:14:07 -0700 Subject: [PATCH] Add fixes for Flowers - Le Volume series --- gamefixes-gog/umu-1685981342.py | 48 +++++++++++++++++++++++++++++++++ gamefixes-gog/umu-2044697588.py | 48 +++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 gamefixes-gog/umu-1685981342.py create mode 100644 gamefixes-gog/umu-2044697588.py diff --git a/gamefixes-gog/umu-1685981342.py b/gamefixes-gog/umu-1685981342.py new file mode 100644 index 00000000..03742304 --- /dev/null +++ b/gamefixes-gog/umu-1685981342.py @@ -0,0 +1,48 @@ +"""Game fix for Flowers - Le Volume Sur Ete + +Fixes in-game font. See umu-1697970811.py +""" + +import os +from hashlib import sha256 +from subprocess import run + +import __main__ as protonmain +from protonfixes import util +from protonfixes.logger import log + + +def main(): + env = protonmain.g_session.env.copy() + 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" + + # Digest of the font installer + hashsum = "d3bd48162d91322c3d2861cdccc538955336eff7f0fe50eeafee1b7551a52152" + + 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}"): + 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: + if sha256(file.read()).hexdigest() != hashsum: + 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"], + check=False, + env=env, + ).returncode + + if retc: + log.warn(f"Running '{font_installer}' exited with the status code: {retc}") diff --git a/gamefixes-gog/umu-2044697588.py b/gamefixes-gog/umu-2044697588.py new file mode 100644 index 00000000..c73535c9 --- /dev/null +++ b/gamefixes-gog/umu-2044697588.py @@ -0,0 +1,48 @@ +"""Game fix for Flowers - Le Volume Sur Automne + +Fixes in-game font. See umu-1697970811.py +""" + +import os +from hashlib import sha256 +from subprocess import run + +import __main__ as protonmain +from protonfixes import util +from protonfixes.logger import log + + +def main(): + env = protonmain.g_session.env.copy() + 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" + + # Digest of the font installer + hashsum = "d3bd48162d91322c3d2861cdccc538955336eff7f0fe50eeafee1b7551a52152" + + 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}"): + 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: + if sha256(file.read()).hexdigest() != hashsum: + 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"], + check=False, + env=env, + ).returncode + + if retc: + log.warn(f"Running '{font_installer}' exited with the status code: {retc}")