Skip to content

Commit

Permalink
Readme improvements (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
insolor authored Jan 31, 2024
1 parent 0d48f17 commit 622d4b0
Showing 1 changed file with 26 additions and 44 deletions.
70 changes: 26 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`

0 comments on commit 622d4b0

Please sign in to comment.