Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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).
  • Export / import mod settings — share mods between installs. Export (toolbar button) writes the selected mod to a standalone mods_settings = { ... } snippet; Import… merges mods from such a snippet back into your config at the mod-entry level — an existing mod is overwritten in place, a new one is appended — while leaving every other mod and all non-mod settings intact. Also available as --export / --import CLI modes. See Export / import below. Based on Artmos/darktide-mod-settings-merger.
  • 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
cargo run -- --export              # export mods (see below)
cargo run -- --import              # import/merge mods (see below)

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.

Export / import mod settings

Share mod configurations between installs (or with friends) without touching your graphics, keybinds, or any other settings. This is the same idea as the web-based Artmos/darktide-mod-settings-merger, built into the editor and running against its SJSON model.

In the editor (buttons)

A second toolbar row ("Share:") holds four buttons — a selected-mod pair on the left and an all-mods pair on the right:

  • Export: — export the mod selected in the list. A Save dialog appears (pre-filled with <mod>.export.config); the written file is a standalone snippet containing just that mod:

    mods_settings = {
    	"A la Mode" = {
    		alm_open_setup = false
    	}
    }
    

    (Disabled until a mod is selected.)

  • Import… — pick an export snippet and merge it. A confirmation dialog lists exactly which mods will be overwritten (already present) and added (new). On confirm the merge is applied in memory and the mod list refreshes; press Save (or Ctrl+S) to write it, with the usual backups.

  • Export all — export every mod to one file (a full mods backup), pre-filled with all_mods.export.config.

  • Import allreplace your entire mods block with the mods from a file. The confirmation dialog warns which of your current mods are not in the file and will be removed. Non-mod settings are still left intact. Use this to restore or fully overwrite a mod set; use Import… to merge into it.

From the command line

The same thing headlessly, driven by native file dialogs:

# Export: all mods → Save dialog; or specific mods → specific file (no dialogs)
DarktideModEditor.exe --export
DarktideModEditor.exe --export --mods "A la Mode,Numeric UI"  "shared.config"

# Import: pick a file in the Open dialog, or merge a specific file/selection
DarktideModEditor.exe --import
DarktideModEditor.exe --import "C:\user_settings.config" "shared.config" --mods "A la Mode"

The first non-flag path is the config file (defaults to your user_settings.config); the second is the export file (a dialog opens if omitted). --mods "A,B,C" narrows the selection; omit it to act on all mods (export) or every mod in the file (import).

Merge semantics

Import… (merge) — mod-entry level, whether via button or CLI:

  • Each selected mod that already exists is replaced wholesale, keeping its original position in the file.
  • Each selected mod that is new is appended.
  • Mods you have that aren't in the file are kept.

Import all (replace) — the file becomes your mods block:

  • Mods in the file are used (in the file's order); mods you have that aren't in the file are removed.

Both leave every non-mod setting byte-for-byte intact, and saves write the usual backups (<file>.original, <file>-HHMMSS.bak) atomically.

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, CRLF/LF, and the export/merge logic (export_mods, merge_from_text, parse_export).
src/main.rs CLI entry points (incl. --export / --import) 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

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages