Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use guidm cursor fns #1402

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Use guidm cursor fns #1402

wants to merge 4 commits into from

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

2 participants