Skip to content

Conversation

@Bumber64
Copy link
Contributor

@Bumber64 Bumber64 commented Feb 12, 2025

Make use of gui.dwarfmode cursor fns in a number of scripts. Also same_xyz where possible.

Added a pos arg for gui/create-item to define output position. Made modtools/create-item respect "opts.pos" being passed into hackWish.

Fixed up tiletypes in hfs-pit. Outdated numbers were being used instead of enums, causing weird behavior.

toggle-kbd-cursor now ignores adv mode. It would just reposition the look cursor if left as-is, and we can't easily toggle adv look mode. (Simulated input required.)

Added adventure tag to extinguish and firestarter since guidm changes made them function. (Other scripts like colonies will function, but aren't particularly useful due to lack of persistence.) toggle-kbd-cursor gets fort tag since it only functions in fort/arena.

Reinstated launch and putontable. I added the adventure tag to putontable, even though the adventurer can place things manually, since there might be some use for the "all" option.

I didn't fix up modtools/create-unit.lua, which is still using the global cursor. It's got old unk fields for structures (nemesis), and the whole thing just probably needs to be rewritten.

* colonies.lua - guidm cursor
* devel/light.lua (unavailable) - guidm cursor
* devel/query.lua - guidm cursor; same_xyz
* devel/tree-info.lua - guidm cursor
* gui/advfort.lua (unavailable) - guidm cursor; same_xyz
* gui/blueprint.lua - guidm cursor
* gui/companion-order.lua (unavailable) - guidm cursor; same_xyz
* gui/create-item.lua - add pos arg
* gui/tiletypes.lua - guidm cursor
* modtools/create-item.lua - respect opts.pos, handle inside hackWish
* hfs-pit.lua - guidm cursor; fix up tiletypes
* launch.lua - guidm cursor; fix projectile flag
* putontable.lua - guidm cursor; same_xyz
* source.lua - guidm cursor
* stripcaged.lua - guidm cursor
* teleport.lua - guidm cursor
* toggle-kbd-cursor.lua - use clearCursorPos; exclude adv mode

* docs/extinguish.rst - adv tag
* docs/firestarter.rst - adv tag
* docs/launch.rst - reinstated
* docs/putontable.rst - reinstated
* docs/toggle-kbd-cursor.rst - fort tag
* docs/gui/create-item.rst - add pos arg
* docs/modtools/create-item.rst - suggest "here" for pos
* Update changelog.txt
@Bumber64
Copy link
Contributor Author

pre-commit.ci autofix

@myk002
Copy link
Member

myk002 commented Feb 13, 2025

toggle-kbd-cursor now ignores adv mode. It would just reposition the look cursor if left as-is, and we can't easily toggle adv look mode. (Simulated input required.)

What would the required input be? Can we simulate it with gui.simulateInput?

@Bumber64
Copy link
Contributor Author

Bumber64 commented Feb 13, 2025

What would the required input be? Can we simulate it with gui.simulateInput?

Looks like A_LOOK works.

LEAVESCREEN seems to prioritize Look over the unit pane, but I'm not sure if there's other simultaneous views that can take priority. Probably leave it to the caller to make sure they're in the right state rather than check in the script that Look has focus.

* Update toggle-kbd-cursor.lua
* Update toggle-kbd-cursor.rst
* Update changelog.txt
@myk002 myk002 moved this from Todo to Review In Progress in 51.06-r2 Mar 7, 2025
Comment on lines +45 to +48
``-p``, ``--pos <x>,<y>,<z>``
If specified, items will be spawned at the given coordinates instead of at
the creator unit's feet. ``here`` can be used in place of ``<x>,<y>,<z>``
to use the active keyboard cursor.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should really be a dialog in the UI flow, but we can change that later. it's better to have this as a commandline option than not at all.

@myk002 myk002 merged commit e9987ef into DFHack:master Mar 8, 2025
7 of 8 checks passed
@github-project-automation github-project-automation bot moved this from Review In Progress to Done in 51.06-r2 Mar 8, 2025
@Bumber64 Bumber64 deleted the guidm_scripts branch March 8, 2025 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants