Skip to content

stockpiles export include option#5746

Open
Halavus wants to merge 16 commits intoDFHack:developfrom
Halavus:stockpiles-include-option
Open

stockpiles export include option#5746
Halavus wants to merge 16 commits intoDFHack:developfrom
Halavus:stockpiles-include-option

Conversation

@Halavus
Copy link
Contributor

@Halavus Halavus commented Mar 13, 2026

New Feature:
Upon exporting a stockpile settings, a new popup window one step before "Please enter a filename" has been added.
It allows handling the quite neat stockpiles export --include option that is in the code since I remember it, but absent from the current UI.

Default view:
Capture d'écran 2026-03-13 084847

Full toggled view:
image

Comments/issues:

  • TODO?: a toggle to enable/disable the feature entirely
  • TODO?: Save user settings locally (in /dfhack-config/stockpiles?)
  • Code now contains a larger mix of gui.dialogs and gui.widgets
  • Code is getting a bit cranked with all the UI elements:
    There is an unavailable gui/stockpiles piece of code that approximately tried to do what the new UI does.
    I'm wondering if the UI elements of this script shouldn't be moved to and replace the old gui/stockpiles. Or implement a new structure?

Background note:
In my latest playthroughs I have observed issues where imported stockpile settings - with for example 64 max bins set on a 3x3 stockpile - would prevent the dwarves from ever starting to haul stuff to the stockpile. Only stockpiles import is able to set more containers than there are available tiles in a given stockpile. The game prevents it.
This is why I thought of this feature.
The real fix though could be added after the parsing of the .dfstock file, which could avoid setting more containers than there are available tiles in the selected stockpile.
It seems a pretty easy fix computing the value with the help of the vector stockpile.room.extents, but this is C++ and I have zero clue.

Disclaimer:
I'm not a professional programmer. Started learning basic coding 12 years ago in the hope of becoming a DFHack contributor someday (true story). Got sidetracked by life.
This is my first bigger lua piece of code, go ahead and be critical.
Until 2 weeks ago I was only Skill: Adequate Python (rusty).
Eager to learn along the way.
Thank you for your attention.

@Halavus
Copy link
Contributor Author

Halavus commented Mar 13, 2026

pre-commit.ci autofix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant