Commit Graph

1140 Commits (474dae21c678a91e43c27f2e142b713952024105)

Author SHA1 Message Date
lethosor f021dd0e0a
Gui::getAnyItem(): add support for viewscreen_treasurelistst 2022-07-12 11:25:16 -04:00
lethosor 4cdb0ff138
Merge branch 'rm-old-modules' into develop 2022-07-12 11:23:10 -04:00
Myk 28e15162a5
reorganize init scripts into dfhack-config (#2232)
* reorganize init scripts into dfhack-config

allows player init scripts to build on defaults instead of replace them
this also moves the init scripts out of the main df directory

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* escape asterisks in docs

* remove unneeded dfhack.init file creation for test

* write the test init script to the new init dir

* create the init dir before trying to write a file

* rename default init files for clarity

* Update changelog

* Update docs/changelog.txt

Co-authored-by: Alan <lethosor@users.noreply.github.com>

* Try to get buildmaster to work with old branches

* Update changelog

* get keybindings from all init scripts

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix spacing in changelog

* split default loading into its own file

* update docs with new changes

* update help text wording in default init files

* Apply suggestions from code review

Co-authored-by: Alan <lethosor@users.noreply.github.com>

* Alphabetize changelog

* Update onMapLoad.default.init

* Update onMapLoad.init

* Update Core.rst

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alan <lethosor@users.noreply.github.com>
2022-07-10 08:54:55 -07:00
Myk 9f44fd3f72
[manipulator] add the professions library (#2234)
* move professions out of the examples folder

* install professions into professions/library

* guard unguarded header from multiple inclusion

* load and display library professions

* update changelog

* move example professions docs from examples guide

* update dreamfort documentation

* note that professions folder has changed

* Fix bad merge
2022-07-06 07:21:26 -07:00
Myk e0d37a31ae
Make the manager orders library available by default (#2233)
* move orders out of examples directory

* install orders into library dir

* read orders from new library dir

* update documentation

* update dreamfort references to orders import

* update changelog

* ignore json files in pre-commit
2022-07-06 07:03:29 -07:00
Myk 091068c710
[prospect] give player control over which information is output (#2231)
* give player control over prospect output

* suspend the core *before* we call to Lua
2022-07-06 06:57:13 -07:00
lethosor 739871bc0f
Remove Hooks-egg.cpp and related code and configuration options 2022-06-29 23:35:14 -04:00
lethosor 1147add520
Constructions module: remove some old/unused functions/types 2022-06-29 23:35:14 -04:00
lethosor 4c7caa2658
Remove unneeded dependencies on modules/Graphic.h 2022-06-29 23:35:13 -04:00
lethosor 8bb047fcc6
Remove Notes module
Only used in a devel plugin that prints notes, and can be easily replaced
with `ui.waypoints.points`
2022-06-29 23:35:13 -04:00
Timur Kelman 9788a8a22a
Add default selection handler to `materials.ItemTraitsDialog` (#2211)
* add forward compatibility for future `job_item_flags`

* add default selection handler to `materials.ItemTraitsDialog`

* add a call to `error()` in 'unknown'-branch inside `setTrait`

* add `ItemTraitsDialog` improvement description to changelog.txt
2022-06-28 16:27:18 -07:00
Myk ba629b8e0a
manually handle DestroyBuilding jobs (#2209)
* don't delete general refs from jobs that we cancel

though we still disconnect the refs if we can

* get job remove working in all cases

we apparently need to manually handle DestroyBuilding jobs
everything else we should let cancel_job handle

* update changelog
2022-06-21 16:38:04 -07:00
quarque2 f33c9bc881
Update tile-material.lua (#2218)
* Update tile-material.lua

* Update changelog.txt

* Update changelog.txt

* Update changelog.txt

* Update tile-material.lua
2022-06-20 12:38:37 -07:00
myk002 88ae50b9ae
update version and changelog to 0.47.05-r6 2022-06-17 15:42:23 -07:00
Myk b361a66a52
ensure our docs build cleanly with sphinx-5 (#2193)
* ensure our docs build cleanly with sphinx-5

* adapt to the API change in sphinx 5

while keeping compatibility with <5

* get rid of the extra colons in field lists
2022-06-17 09:35:31 -07:00
Josh Cooper d38ab1d152
Fix UNIT_NEW_ACTIVE events (#2197)
* Updates eventful.lua to use UNIT_NEW_ACTIVE

* Fixes bug #2189

* Revises activeUnits declaration/initialization

* Fixes build error

* Update changelog.txt

* reword changelog entry

* add changelog entry for event name change

Co-authored-by: Myk <myk002@yahoo.com>
2022-06-17 09:34:41 -07:00
Rafał ae5b00523e
Add myself to Authors.rst (#2208)
As suggested in: https://github.com/DFHack/scripts/pull/404#issuecomment-1152780958
2022-06-14 00:35:59 -04:00
Warmist fc384fd1a2
Update eventful.lua (#2203)
* Update eventful.lua

Had wrong function. Fixes https://github.com/DFHack/dfhack/issues/2202

* Update Lua API.rst

Update docs to add onReactionCompleting and remove outdated info

* Update Lua API.rst

Some more minor doc fixes

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add changelog entry

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-06-12 07:12:49 -07:00
Timur Kelman 1a629a26bf
add `ItemTraitsDialog` to materials.lua (#2199)
* add `ItemTraitDialog` to materials.lua

* rename `ItemTraitDialog` to `ItemTraitsDialog` (plural)

* Update changelog.txt
2022-06-12 07:03:04 -07:00
Myk 85d7489b3c
ensure refs are cleaned up when we remove a job (#2184)
* ensure job items are disassociated from the job

when the job is removed. the new df-provided ``cancel_job()`` doesn't do
this for us whereas the old custom implementation did.
ref: #2028

* remove trailing whitespace

* Clean up general refs before removing job

Because the game method doesn't do it itself

* Fix typo in var name

* clean up code

* update changelog
2022-06-11 07:38:22 -07:00
Myk 4152be13c7
Simplify bug extlink 2022-06-08 19:02:58 -07:00
myk002 ff373bb9e2 use extlinks where appropriate in docs 2022-06-08 16:53:46 -07:00
lethosor 5e0a947d51
Fix changelog entry and release for #2028 2022-06-06 01:49:23 -04:00
myk002 3928bb67d7 promote gui/quickfort in the library guide
also add a link to the TheQuickFortress online spreadsheets
2022-06-04 20:05:11 -07:00
Myk ed2ba69713
Improvements to dreamfort, quickfort keystroke aliases, and example orders (#2162)
* add alt-f as a hotkey for quickfort

to mimic the existing windows hotkey for the old quickfort
hopefully this will ease the transition from the old quickfort to the
new

* add and document new quickfort aliases

* reduce quantity requirement for dyeing

15 is just too high. the counter counts bags, not units

* dreamfort blueprint improvements

most of these suggested by ldog on the forums. Thanks!
- significantly extend the list of hostile creatures that get stashed in the prisoner quantum stockpile
- send adamantine thread to the metalworker stockpiles
- give from thread/cloth stockpiles to clothier, loom, and dyer to protect the adamantine thread
- automatically create tavern, library, and temple locations (restricted to residents only by default)
- automatically associate the rented rooms with the tavern
- place a stockpile under the dump zone so you can set up stockpile links for dumped items
- doc improvements. in particular, point people to the new assign-minecarts tool for assigning minecarts to quantum stockpile dumps

* update changelog

* fix typo in cloth stockpile settings

* fix typo in guildhall location setup

* don't restrict stockpiles for clothiers and dyers

* deprecate jugs alias and add stone|woodentools

* remove dye thread, make jugs wooden

remove dye thread to protect adamantine
make jugs wooden to differentiate them from scroll rollers. that gives
us a chance to actually have a usable jugs-only stockpile

* dreamfort improvements

- move trap corridor gates and levers before the walls and traps so they get
  constructed first
- give useful names to the craftsdwarf's workshops
- redesign the services level to:
  - fit better in a 1x1 embark
  - add doors to the hospital recovery rooms to protect from
    werebeasts-to-be
  - add an interrogation room (sheriff's office) next to the jail

* shape hospital zone to exactly the hospital area

* don't clutter the hospital with statues

* update changelog
2022-06-02 15:51:45 -07:00
Myk 27bf4c758b
Allow player to pause the confirmation dialog without disabling (#2164)
* basic pause functionality for confirm

* update changelog

* wrap the pause message and output in white

* unpause on viewscreen transition when we can

but still use esc detection when we won't get a viewscreen transition
(like when we're intercepting input on viewscreen_dwarfmodest

* add more code docs about unpause detection
2022-06-02 06:24:13 -07:00
Myk 89d3d45e87
Allow EditField widgets to manage their own activation and keyboard focus (#2147)
* use new focus subsystem in widgets.EditField

* always eat the enter key if we have an on_submit

* add modal attribute

* give EditFields a default height of 1

so they can be autoarranged
2022-06-01 21:48:21 -07:00
Myk ad2d9cad03
[lua] implement keyboard focus subsystem (#2160)
* implement keyboard focus subsystem

* Fix error in focus group combining

* documentation for the inputToSubviews decision

* modify unit tests to catch that last bug
2022-06-01 17:42:13 -07:00
Ryan Williams bc0def4342
MiscUtils word_wrap: Add option to trim only leading whitespace after wrapping (#2169)
* Update changelog.txt
2022-05-30 22:58:46 -04:00
Myk 77d045488b
Confirmation dialog for removing manager orders (#2163) 2022-05-23 21:17:52 -07:00
Myk 8b1070b553
tombstone deteriorate*rb scripts (#2157)
* tombstone deteriorate*rb scripts

* update to scripts head so we can build docs

* fix anchors
2022-05-19 15:27:08 -07:00
myk002 18628ff5b8 make key_sep more configurable
and add more configuration to HotkeyLabel and EditField to take
advantage of it
2022-05-18 16:46:33 -07:00
myk002 53609db1f9 let CycleHotkeyLabels take numeric initial_options
even if all of the option values are non-numeric
2022-05-18 15:39:52 -07:00
myk002 d6df928d69 update changelog 2022-05-13 14:36:49 -07:00
myk002 7439678214 tombstone devel/unforbidall script 2022-05-10 15:37:37 -07:00
lethosor 1203274e9f
Update Authors.rst
This time with missing scripts and df-structures authors since 0.47.04-r1

Just one: DFHack/scripts#339
2022-05-10 00:51:16 -04:00
myk002 585888c2d3
update version, changelog, modules for 0.47.05-r5 2022-05-04 17:21:31 -07:00
Myk 0389637ac8 clean up changelog.txt 2022-05-02 21:54:41 -07:00
lethosor cc20d9fbb7
Update Authors.rst
Checked as far back as 0.47.04-r1.
Oldest missing was chrismdp from before 0.47.05-r3.
2022-05-01 13:35:30 -04:00
Pierre Lulé 876d9132b1
Add a link to the rust library for interacting with the remote API (#2121)
* Add link to the rust api client library

Add a link to https://docs.rs/dfhack-remote/latest/dfhack_remote/index.html a library interacting with DFHack remote API for the Rust programming language

* Use the docs.rs link

* Fix duplicate link label, included the change in the changelog

Co-authored-by: pierre <pierre>
2022-05-01 06:31:59 -07:00
Josh Cooper fe29bff845
Adds cxxrandom unit test and fixes interface problems (#2099)
* Adds cxxrandom unit test and fixes interface problems

* Tightens braces

* Adds detection code for Shuffle's seqID/engID

* Adds usage examples for cxxrandom

* Gives cxxrandom objects id ranges, sort of

* Updates changelog

* Updates changelog.txt

* Increases id space for cxxrandom

* Fixes bool distribution error message and improves check

* Adds comment explaining the seeded RNG tests for cxxrandom

* Fixes type problem for 32bit builds

* Reduces loop count a few magnitudes

* Fixes a mistake in test.cxxrandom_seed
2022-04-30 21:46:47 -07:00
Myk e2fb15a3a5
add dwarfmode.MenuOverlay:renderMapOverlay() (#2119)
* add dwarfmode.MenuOverlay:renderMapOverlay()

* ensure we move with the viewport when bounds_rect is nil
2022-04-29 20:32:22 -07:00
Myk 24dd4d8ac0
Update init files (#2117)
* update example init files

replace onLoad.init-example with documentation on how to create scripts that run on world/map load
it was confusing to show it being loaded with sc-script since it gets autorun anyway if it is just named properly

* update changelog

* add quickfort keybinding

* move standard tweaks from dreamfort init to main
2022-04-29 20:24:09 -07:00
Tachytaenius b9c36c1e63
Added custom-raw-tokens utility (#2038)
* Added (chain) for [CHAIN_METAL_TEXT] armours in gui/materials.lua used by gui/create-item-- again (oops)

* Added customRawData utility

* Oops, whitespace

* Revised rawStringsFieldNames

* Dialed down on lua trickery and fixed wrongly formatted changelog entry

* Fixed changelog in wrong place and made customRawData a proper module

* Fixed not caching not-present tags, revised examples and fixed error

* Fixed whitespace. Changing settings in editor!

* customRawData docs

* Added getCreatureTag for respecting caste tags, "fixed" bizarre caching error (quotes because I don't even know what was causing it) and updated docs

* Added line limiting for docs, I guess

* Added missing string convert argument

* docs indent fix, code block fix, and revision

* Major revision

* gdi, docs error

* Another? But... huh.

* ...

* Made requested changes

* Whoops

* Rearrange docs lines

* Followed example, should fix linter issues

* fix typo. linted offline this time......

* Make it so that last instance of tag is what is read from

* Added requested change

* eventful key change

* i to lenArgs

* change eventful key

* add test for broken caste selection

* Major redesign

* tags --> tokens

* Added plant growth behaviour and did some requested changes

* More error handling

* fix docs

* Added basic error suppression

* Docs clarification.

* Docs registering example and fix error

* Strip errors on frame after onWorldLoad, not on map load

* Revert "Strip errors on frame after onWorldLoad, not on map load"

This reverts commit e20a0ef8d3743f79d961077f46910b77b16f36b9.

* Revert "Docs registering example and fix error"

This reverts commit 9c848c54c3f84e0ecc1dc421137c8a8b4a52280d.

* Revert "Docs clarification."

This reverts commit 6b4b6a1aa40c50398504f37ecf1ff0f93d6459b1.

* Revert "Added basic error suppression"

This reverts commit d11cb1438cf1e56ff700469e944f0b9af64651d7.

* Use more eventful key more consistent with other files

* use onStateChange instead of eventful and remove redundant utils require

* Code review stuff

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update docs/Lua API.rst

committing a suggestion

Co-authored-by: Alan <lethosor@users.noreply.github.com>

* Prepend examples with DFHACK_

* Remove unused parameters

* Use new ensure_key global

* Named a couple of unnamed arguments (untested)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alan <lethosor@users.noreply.github.com>
2022-04-29 08:39:59 -07:00
Timur Kelman f08a268e8a
add scroll icons to Label widget (#2101)
* WIP: add scroll icons to Label widget

It's an opt-out. The icons are rendered in the right-most column of the 1st and last row. They are only rendered when text can actually be scrolled in the corresponding direction.

WIP: Currently, the icons might overlay text characters, there is no mechanism preventing it

* gui.lua: expose the `parse_inset()` function

* refactor Label's scroll icon code

* since `render_scroll_icons` only works with a label, it's now a class function
* `update_scroll_inset` ensures `frame_inset.r` or `.l` is at least 1, according to `show_scroll_icons`
* `show_scroll_icons` has 4 possible values: `false` for no icons, `left` for icons on the first column on the left (also ensuring `frame_inset.l >= 1`), `right` - last column on the right, `DEFAULT_NIL` - same as `right` if text height greater than `frame_body.height`, else same as `false`.

* make `render_scroll_icons` always draw icons

The check now happens in `onRenderFrame`

* draw frame's background

calling `Label.super.onRenderFrame(self, dc, rect)` makes frame's background invisible for some reason

* remove trailing spaces

* fix scroll icons placed far above/below text

 With `Label.frame_inset = 1` the text could be vertically centered with plenty of space below and above,
but not all rendered. Before this change, the scroll icons would be at the very top and bottom of the frame
instead of near the first and last rendered text line.

* always `update_scroll_inset` to react to resized window

* draw scroll icons next to text

* update `Lua API.rst` with new `Label` parameters

* move comment separator up

This way every scroll related parameter is in one group

* list default values for new parameters in docs

* add missing description of `Label.scroll_keys`
2022-04-29 06:55:08 -07:00
myk002 dcadde38d7 add new global function: ensure_key 2022-04-27 17:35:49 -07:00
myk002 6ad362d698
return a reference to the created dialogs 2022-04-27 11:51:46 -07:00
Quietust dc2a14c0c2 Add "partial-items" tweak.
When active, the displayed names of partially-consumed items (e.g.
hospital cloth) will display a percentage indicator at the end.

Also re-sort a few Tweaks so they're in alphabetical order again.
2022-04-27 11:27:11 -07:00
Nik Nyby fe0b33d9c4 fix typo: equiptment 2022-04-26 17:11:21 -07:00
myk002 ed5523152c
factor text wrapping out of TooltipLabel into WrappedLabel 2022-04-22 09:53:10 -07:00