From 36c12329a2258d2f008018a2840ba458daeb40fb Mon Sep 17 00:00:00 2001 From: R1kaB3rN <100738684+R1kaB3rN@users.noreply.github.com> Date: Sun, 30 Jun 2024 22:22:06 -0700 Subject: [PATCH 1/6] Add fix for Flowers - Le Volume Sur Printemps --- gamefixes-gog/umu-1697970811.py | 61 +++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 gamefixes-gog/umu-1697970811.py diff --git a/gamefixes-gog/umu-1697970811.py b/gamefixes-gog/umu-1697970811.py new file mode 100644 index 00000000..65b5c5a3 --- /dev/null +++ b/gamefixes-gog/umu-1697970811.py @@ -0,0 +1,61 @@ +"""Game fix for Flowers - Le Volume Sur Printemps + +This fix installs the font that should be bundled with the game. Without this +fix, the default font will be used which doesn't wrap correctly, resulting in +the text breaking outside its text box area. +""" + +import os +import __main__ as protonmain +from hashlib import sha256 +from subprocess import run +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("Overlock-Mod.ttf already installed in prefix") + 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 + + # Run the font installer. Unfortunately a small window should popup... + # and it doesn't seem like there's a way around that + log.info("Installing font 'Overlock-Mod.ttf' in prefix") + + # Ensure DISPLAY=:0 to ensure we do not crash when running the installer + # when using gamescope + env["DISPLAY"] = ":0" + + retc = run( + [ + wine, + "start", + "/unix", + f"{install_dir}/font/{font_installer}", + ], + check=False, + env=env, + ).returncode + + if retc: + log.warn(f"Running '{font_installer}' exited with the status code: {retc}") From 4d4d452baae01b7c8be0b69c2c9f7e518914cf6d Mon Sep 17 00:00:00 2001 From: R1kaB3rN <100738684+R1kaB3rN@users.noreply.github.com> Date: Sun, 30 Jun 2024 22:30:00 -0700 Subject: [PATCH 2/6] Lint with Pylint --- gamefixes-gog/umu-1697970811.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gamefixes-gog/umu-1697970811.py b/gamefixes-gog/umu-1697970811.py index 65b5c5a3..b4d11361 100644 --- a/gamefixes-gog/umu-1697970811.py +++ b/gamefixes-gog/umu-1697970811.py @@ -6,9 +6,10 @@ """ import os -import __main__ as protonmain from hashlib import sha256 from subprocess import run + +import __main__ as protonmain from protonfixes import util from protonfixes.logger import log From bba36434caf4ebdfbb4f38a68d69109038fbc483 Mon Sep 17 00:00:00 2001 From: R1kaB3rN <100738684+R1kaB3rN@users.noreply.github.com> Date: Mon, 1 Jul 2024 11:50:46 -0700 Subject: [PATCH 3/6] Pass /silent option --- gamefixes-gog/umu-1697970811.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/gamefixes-gog/umu-1697970811.py b/gamefixes-gog/umu-1697970811.py index b4d11361..bbec4ad0 100644 --- a/gamefixes-gog/umu-1697970811.py +++ b/gamefixes-gog/umu-1697970811.py @@ -39,21 +39,9 @@ def main(): log.warn(f"Expected '{hashsum}', skipping...") return - # Run the font installer. Unfortunately a small window should popup... - # and it doesn't seem like there's a way around that log.info("Installing font 'Overlock-Mod.ttf' in prefix") - - # Ensure DISPLAY=:0 to ensure we do not crash when running the installer - # when using gamescope - env["DISPLAY"] = ":0" - retc = run( - [ - wine, - "start", - "/unix", - f"{install_dir}/font/{font_installer}", - ], + [wine, "start", "/unix", f"{install_dir}/font/{font_installer}", "/silent"], check=False, env=env, ).returncode From 9e601a1fbded37c6e98d1b326be84daecbb857d7 Mon Sep 17 00:00:00 2001 From: R1kaB3rN <100738684+R1kaB3rN@users.noreply.github.com> Date: Mon, 1 Jul 2024 11:57:06 -0700 Subject: [PATCH 4/6] Move GOG fix to Steam - Make this a Steam fix because this problem should effect Steam users too --- gamefixes-gog/umu-1697970811.py | 51 +-------------------------------- gamefixes-steam/1697970811.py | 50 ++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 50 deletions(-) mode change 100644 => 120000 gamefixes-gog/umu-1697970811.py create mode 100644 gamefixes-steam/1697970811.py diff --git a/gamefixes-gog/umu-1697970811.py b/gamefixes-gog/umu-1697970811.py deleted file mode 100644 index bbec4ad0..00000000 --- a/gamefixes-gog/umu-1697970811.py +++ /dev/null @@ -1,50 +0,0 @@ -"""Game fix for Flowers - Le Volume Sur Printemps - -This fix installs the font that should be bundled with the game. Without this -fix, the default font will be used which doesn't wrap correctly, resulting in -the text breaking outside its text box area. -""" - -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("Overlock-Mod.ttf already installed in prefix") - 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-1697970811.py b/gamefixes-gog/umu-1697970811.py new file mode 120000 index 00000000..f3164fdb --- /dev/null +++ b/gamefixes-gog/umu-1697970811.py @@ -0,0 +1 @@ +../gamefixes-steam/1697970811.py \ No newline at end of file diff --git a/gamefixes-steam/1697970811.py b/gamefixes-steam/1697970811.py new file mode 100644 index 00000000..bbec4ad0 --- /dev/null +++ b/gamefixes-steam/1697970811.py @@ -0,0 +1,50 @@ +"""Game fix for Flowers - Le Volume Sur Printemps + +This fix installs the font that should be bundled with the game. Without this +fix, the default font will be used which doesn't wrap correctly, resulting in +the text breaking outside its text box area. +""" + +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("Overlock-Mod.ttf already installed in prefix") + 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}") From 9c02d875a1e8f6d78cd085d68989f193625e76da Mon Sep 17 00:00:00 2001 From: R1kaB3rN <100738684+R1kaB3rN@users.noreply.github.com> Date: Mon, 1 Jul 2024 11:58:57 -0700 Subject: [PATCH 5/6] Update comments --- gamefixes-steam/1697970811.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gamefixes-steam/1697970811.py b/gamefixes-steam/1697970811.py index bbec4ad0..665f1a29 100644 --- a/gamefixes-steam/1697970811.py +++ b/gamefixes-steam/1697970811.py @@ -1,8 +1,9 @@ """Game fix for Flowers - Le Volume Sur Printemps -This fix installs the font that should be bundled with the game. Without this -fix, the default font will be used which doesn't wrap correctly, resulting in -the text breaking outside its text box area. +This fix installs the font that should be bundled with the game in case it +does not get installed during the setup process. Without this fix, the default +font will be used which doesn't wrap correctly, resulting in the text breaking +outside its text box area. """ import os From 67fc736155189ad52b2c3bfb7bb7e6220046efe3 Mon Sep 17 00:00:00 2001 From: R1kaB3rN <100738684+R1kaB3rN@users.noreply.github.com> Date: Mon, 1 Jul 2024 12:07:50 -0700 Subject: [PATCH 6/6] Update log statements --- gamefixes-steam/1697970811.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gamefixes-steam/1697970811.py b/gamefixes-steam/1697970811.py index 665f1a29..e5eaeb4e 100644 --- a/gamefixes-steam/1697970811.py +++ b/gamefixes-steam/1697970811.py @@ -27,7 +27,7 @@ def main(): hashsum = "d3bd48162d91322c3d2861cdccc538955336eff7f0fe50eeafee1b7551a52152" if os.path.isfile(f"{util.protonprefix()}/drive_c/windows/Fonts/Overlock-Mod.ttf"): - log.info("Overlock-Mod.ttf already installed in prefix") + log.info("Font 'Overlock-Mod.ttf' already installed in prefix, skipping...") return if not os.path.isfile(f"{install_dir}/font/{font_installer}"): @@ -40,7 +40,7 @@ def main(): log.warn(f"Expected '{hashsum}', skipping...") return - log.info("Installing font 'Overlock-Mod.ttf' in prefix") + log.info("Installing font 'Overlock-Mod.ttf' in prefix...") retc = run( [wine, "start", "/unix", f"{install_dir}/font/{font_installer}", "/silent"], check=False,