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

Update position.lua #1386

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

Update position.lua #1386

wants to merge 4 commits into from

Conversation

Bumber64
Copy link
Contributor

@Bumber64 Bumber64 commented Jan 30, 2025

Make the script a module and clean up the code. Support adv mode cursor. Adv pos is now given in addition to site pos, since they can differ in larger sites. Give a breakdown of the keyboard cursor's x%16 offset for use in messing with block data.

* Make it a module
* Use argparse
* Adventure mode cursor support
* Give mod16 offset for cursor
* Improve code
Comment on lines +20 to 30
function get_active_cursor() --Return active fort/adv cursor or nil
if dfhack.world.isAdventureMode() then
local look = df.global.game.main_interface.adventure.look
if look.open and look.cursor:isValid() then
return look.cursor --Note: This is a df.coord
end
elseif df.global.cursor.x >= 0 then
return df.global.cursor
end
return nil --Not active
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can be replaced with guidm.getCursorPos() after DFHack/dfhack#5230 merges.

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