Skip to content

triatomic/darktide-mod-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Darktide Mod Settings Editor

A small, fast desktop editor for the mod-settings block inside Fatshark's Darktide user_settings.config file (the same SJSON format used by other Bitsquid / Stingray games).

It parses the mods_settings = { ... } block, lets you browse every installed mod, edit its settings inline with type awareness, and save — while preserving every other byte of the file exactly as it was.

Written in Rust with a Slint GUI. This is a port of an earlier Python/PyQt5 prototype; the SJSON engine and file-splicing logic are a faithful reimplementation.

screenshot

Features

  • Mod browser — filter by name, sort A–Z, with a live count of shown mods.
  • Type-aware inline editing — booleans get a dropdown; ints, floats, and strings get a text field. Edits keep the original value's type.
  • Nested settings — expand/collapse objects and arrays to any depth.
  • Per-mod raw SJSON editor — edit one mod's block as text and re-apply it.
  • Whole-file external editing — open the full .config in your OS's default editor, then reload.
  • Settings filter — search within a mod; matches show with their ancestors.
  • Go-to-line — click a setting to see its 1-based line number in the file.
  • Delete a mod — remove an entire mod's { } block (with confirmation).
  • Safe saves:
    • Only the mods_settings block is ever re-serialized; all other settings (your built-in game options, etc.) are kept byte-for-byte.
    • A one-time pristine backup <file>.original is written on first save.
    • A timestamped backup <file>-HHMMSS.bak is written on every save.
    • Writes are atomic (temp file + rename), so a crash mid-save can't corrupt the config.
    • Windows (CRLF) vs. Unix (LF) line endings are detected and preserved.
  • Unsaved-changes guard — prompts before Open / Reload / window close when there are pending edits.

Where is the config file?

By default the editor opens:

%APPDATA%\Fatshark\Darktide\user_settings.config

You can point it at any file via the Open… button or a command-line argument (see below).

⚠️ Close Darktide before saving — the game may rewrite the file on exit and clobber your edits. The editor's backups (.original, *.bak) let you recover, but it's simplest to edit while the game is closed.

Download & run (no build required)

Grab the latest DarktideModEditor.exe from the Releases page and double-click it. It's a single self-contained executable — the MSVC C runtime is statically linked, so no Visual C++ Redistributable is required on any 64-bit Windows.

Building from source

Prerequisites

  • Rust (stable, 1.80 or newer — LazyLock is used). Install via rustup, or on Windows with winget:

    winget install Rustlang.Rustup

    Then open a new terminal so cargo is on your PATH.

  • Windows: the MSVC toolchain (the default x86_64-pc-windows-msvc target). Install the "Desktop development with C++" workload from the Visual Studio Build Tools if rustup prompts for a linker.

  • Linux: Slint's default (FemtoVG/winit) backend needs system libraries. On Debian/Ubuntu:

    sudo apt install build-essential libfontconfig-dev libxcb1-dev \
        libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev \
        libxkbcommon-dev

    (The file-splicing logic and backups are written with Windows in mind but the app builds and runs cross-platform; the default config path just won't exist.)

Build

# clone, then from the repository root:
cargo build --release

The optimized, symbol-stripped binary lands at:

target/release/darktide-mod-editor.exe    # (no .exe on Linux/macOS)

Run

cargo run                          # launch the GUI on the default config
cargo run -- "C:\path\to\file.config"   # launch the GUI on a specific file
cargo run -- --selftest            # headless round-trip safety check
cargo run -- --list                # print the mod list and exit

Release builds run as a Windows GUI app (no console window). Debug builds keep the console so --selftest / --list output is visible.

Test

cargo test          # unit tests for the SJSON parser/serializer
cargo run -- --selftest   # end-to-end round-trip check against your real config

--selftest loads your config, round-trips it through the parser and serializer, re-splices it into the full file, and asserts that the mods data and every non-mod byte come back identical.

How it works

File Responsibility
src/sjson.rs SJSON (Bitsquid/Stingray) parser + serializer, and unit tests. Parses over Vec<char> to mirror the reference implementation's per-character indexing.
src/config.rs ConfigFile model — locates the mods_settings = marker, extracts the block, and splices edits back in while preserving the prefix/suffix verbatim. Handles backups, atomic writes, and CRLF/LF.
src/main.rs CLI entry points and the Slint GUI: app state, all UI callbacks, tree flattening, filtering, and go-to-line.
ui/app.slint Declarative UI: toolbar, mod list, settings tree, and raw editor.
build.rs Compiles ui/app.slint into Rust at build time with the fluent-dark style.
.cargo/config.toml Statically links the MSVC C runtime (+crt-static) so the .exe needs no redistributable.

SJSON, briefly

SJSON is a relaxed JSON dialect: object keys need no quotes (enabled = true), = or : both work as the key/value separator, commas are optional, and both // and /* */ comments are allowed. The serializer emits tab-indented output with barewords for simple keys and quoted strings elsewhere, and always keeps a decimal point on floats so a 1.0 never silently round-trips to an integer.

License

MIT.

This is an unofficial, fan-made tool. Darktide and Fatshark are trademarks of their respective owners; this project is not affiliated with or endorsed by Fatshark.

About

Fast Rust/Slint desktop editor for the mods_settings block in Fatshark Darktide's user_settings.config (SJSON). Type-aware inline editing, safe splicing, backups.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors