From 622d4b0a8ce1b88d6c1ef5e3163590dc57c34475 Mon Sep 17 00:00:00 2001 From: insolor <2442833+insolor@users.noreply.github.com> Date: Wed, 31 Jan 2024 19:21:00 +0300 Subject: [PATCH] Readme improvements (#38) --- README.md | 70 +++++++++++++++++++++---------------------------------- 1 file changed, 26 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 5d5aec1..152448b 100644 --- a/README.md +++ b/README.md @@ -2,57 +2,36 @@ [![Build](https://github.com/dfint/df-steam-hook-rs/actions/workflows/build.yml/badge.svg)](https://github.com/dfint/df-steam-hook-rs/actions/workflows/build.yml) -Re-implementation of [df-steam-hook](https://github.com/dfint/df-steam-hook) in -Rust. +Re-implementation of [df-steam-hook](https://github.com/dfint/df-steam-hook) in Rust. -Supports: - -- Windows (classic/steam/itch.io) -- Linux (classic/steam/itch.io) +Supports Windows and Linux versions of Dwarf Fortress, including [classic](http://www.bay12games.com/dwarves/), [steam](https://store.steampowered.com/app/975370/Dwarf_Fortress/) and [itch.io](https://kitfoxgames.itch.io/dwarf-fortress) versions. Implemented: -- config/offsets files -- dictionary from csv +- using of config/offsets files (more or less the same config format which is/was used in [df-steam-hook](https://github.com/dfint/df-steam-hook)) +- using dictionary from csv - translation hooks -- enter string hooks (search) +- text entry hooks (e.g. search) ## Build and run -The instructions provided here are for the Linux, but they will also work on Windows. -The process for running them is the same. - ### Install rustc, toolchain by using rustup -For install RUST and Cargo [see link](https://doc.rust-lang.org/cargo/getting-started/installation.h). - -Or type: -```shell -curl https://sh.rustup.rs -sSf | sh -``` - -NOTE: The use of system rustc and cargo often leads to build errors. - -Example: -``` -error: no such command: `+nightly-2022-11-06` +For installation of rust and cargo [see the link](https://doc.rust-lang.org/cargo/getting-started/installation.html). - Cargo does not handle `+toolchain` directives. - Did you mean to invoke `cargo` through `rustup` instead? - -``` - -After loading $HOME/.cargo/env: +> [!NOTE] +> The use of system `rustc` and `cargo` often leads to build errors. +On Linux, after the installation use the following command: ``` source "$HOME/.cargo/env" ``` +There's no `source` command on Windows, just install `rustup`, it will add cargo to the environment variables (follow the instructions at the link at the beginning of this section). -Install nightly-2022-11-06 toolchain from rustup: +Then install `nightly-2022-11-06` toolchain using `rustup`: ```shell rustup install nightly-2022-11-06-x86_64-unknown-linux-gnu - ``` ### Build @@ -61,24 +40,27 @@ rustup install nightly-2022-11-06-x86_64-unknown-linux-gnu cargo +nightly-2022-11-06 build --release ``` -### Prepare game - -To enable translation, you must change the game settings to your native language. -You can use [classic](http://www.bay12games.com/dwarves/), steam or itch.io version. +### Prepare the game Copy: -* target/release/libdfint_hook.so to libdfhooks.so -* [font](https://github.com/dfint/update-data/tree/main/store/fonts) to ./data/art/curses_640x300.png -* [encoding](https://github.com/dfint/update-data/tree/main/store/encodings) to dfint-data/encoding.toml -* [offsets](https://github.com/dfint/update-data/tree/main/store/offsets) to dfint-data/offsets.toml -* [dictionary](https://github.com/dfint/autobuild/tree/main/translation_build/csv/) to dfint-data/dictionary.csv -* [config](https://github.com/dfint/update-data/blob/main/store/config.toml) to ./dfint-data/config.toml +* `target/release/libdfint_hook.so` to `libdfhooks.so` in the game's directory on Linux +* or `target/release/dfint_hook.dll` to `dfhooks.dll` on Windows +* [font](https://github.com/dfint/update-data/tree/main/store/fonts) to `data/art/curses_640x300.png` +* [encoding](https://github.com/dfint/update-data/tree/main/store/encodings) to `dfint-data/encoding.toml` +* [offsets](https://github.com/dfint/update-data/tree/main/store/offsets) to `dfint-data/offsets.toml` +* [dictionary](https://github.com/dfint/autobuild/tree/main/translation_build/csv/) to `dfint-data/dictionary.csv` +* [config](https://github.com/dfint/update-data/blob/main/store/config.toml) to `dfint-data/config.toml` ### Launch -Run +Run (on Linux) ```shell ./dwarfort ``` +or (on Windows) +```shell +Dwarf Fortress.exe +``` +or just double click the executable file of the game (or run it from the steam client, for example). -By default config, the log is written to the file: ./dfint-data/dfint-log.log +By default, the log is written to the file: `dfint-data/dfint-log.log`