From 9d09f6de09f0ff1c29489906feb6a05511e986e8 Mon Sep 17 00:00:00 2001 From: rakelley Date: Thu, 5 Oct 2023 15:26:35 -0700 Subject: [PATCH] Add Linux patcher script --- README.md | 7 ++++++- toggle_darktide_mods.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100755 toggle_darktide_mods.sh diff --git a/README.md b/README.md index 8ef6333..ff145da 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,17 @@ ### This mod does not need to be added to your mod_load_order.txt file. -## Installation: +## Installation (Windows): 1. Copy the Darktide Mod Loader files to your game directory and overwrite existing. 2. Run the "toggle_darktide_mods.bat" script in your game folder. 3. Copy the Darktide Mod Framework files to your "mods" directory (/mods) and overwrite existing. 3. Install other mods by downloading them from the Nexus site (https://www.nexusmods.com/warhammer40kdarktide) then adding them to "/mods/mod_load_order.txt" with a text editor. +## Installation (Linux): + 1. All Windows instructions for installing/updating/removing apply to Linux, except: + - you need to use "toggle_darktide_mods.sh" instead of "toggle_darktide_mods.bat" + - you will need `cargo` and `git` installed on your system, please see the documentation for your distribution's package manager or the [Rust docs](https://doc.rust-lang.org/cargo/getting-started/installation.html) + ## Disable mods: * Disable individual mods by removing their name from your mods/mod_load_order.txt file. * Run the "toggle_darktide_mods.bat" script at your game folder and choose to unpatch the bundle database to disable all mod loading. diff --git a/toggle_darktide_mods.sh b/toggle_darktide_mods.sh new file mode 100755 index 0000000..53968f9 --- /dev/null +++ b/toggle_darktide_mods.sh @@ -0,0 +1,40 @@ +#!/bin/sh +set -e + +CLEANUP_PATCHER=0 + +if [ -e ./tools/dtkit-patch ] +then + read -p "Are you trying to update or remove the mod loader (y/n)? " RESPONSE + case "$RESPONSE" in + y|Y ) CLEANUP_PATCHER=1;; + esac +else + if ! command -v cargo >/dev/null 2>&1; then + echo >&2 "cargo not found, please install the cargo package, e.g. \"sudo apt install cargo\"" + exit 1 + fi + if ! command -v git >/dev/null 2>&1; then + echo >&2 "git not found, please install the git package, e.g. \"sudo apt install git\"" + exit 1 + fi + echo "Building database patcher" + rm -rf __dtkit 2>&1 || true + mkdir __dtkit + cd __dtkit + git clone https://github.com/ManShanko/dtkit-patch.git . + cargo build + cp ./target/debug/dtkit-patch ../tools/ + cd .. + rm -rf __dtkit + echo "Database patcher built" +fi + +echo "Starting Darktide patcher..." +./tools/dtkit-patch --toggle ./bundle || echo >&2 "Error patching the Darktide bundle database. See logs." + +if [ "$CLEANUP_PATCHER" = 1 ] && [ -e ./tools/dtkit-patch ] +then + rm ./tools/dtkit-patch +fi +