Skip to content

Commit c68a310

Browse files
authored
Update position.lua - Use guidm cursor fn
1 parent 11f749b commit c68a310

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

position.lua

+2-13
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
--@ module = true
33

44
local argparse = require('argparse')
5+
local guidm = require('gui.dwarfmode')
56

67
local function parse_args(args)
78
local opts = {}
@@ -17,18 +18,6 @@ local function parse_args(args)
1718
return opts
1819
end
1920

20-
function get_active_cursor() --Return active fort/adv cursor or nil
21-
if dfhack.world.isAdventureMode() then
22-
local look = df.global.game.main_interface.adventure.look
23-
if look.open and look.cursor:isValid() then
24-
return look.cursor --Note: This is a df.coord
25-
end
26-
elseif df.global.cursor.x >= 0 then
27-
return df.global.cursor
28-
end
29-
return nil --Not active
30-
end
31-
3221
local months =
3322
{
3423
'Granite, in early Spring.',
@@ -129,7 +118,7 @@ if dfhack_flags.module then
129118
end
130119

131120
function main(opts)
132-
local cursor = get_active_cursor()
121+
local cursor = guidm.getCursorPos()
133122

134123
if opts.copy then --Copy keyboard cursor to clipboard
135124
if not cursor then

0 commit comments

Comments
 (0)