Skip to content

Commit 43ef4ee

Browse files
authored
Update SelectLockLabors.lua
Added hotkey to run the program with r
1 parent 3cb6c8f commit 43ef4ee

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

SelectLockLabors.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
--@module=true
2+
23
local gui = require('gui')
34
local widgets = require('gui.widgets')
45
local overlay = require('plugins.overlay')
@@ -22,6 +23,7 @@ end
2223

2324
local function simulate_actions(self, count)
2425
count = sanitize_entry_count(count, 1)
26+
2527
gui.simulateInput(dfhack.gui.getCurViewscreen(), 'STANDARDSCROLL_RIGHT')
2628

2729
local function step(i)
@@ -36,12 +38,14 @@ local function simulate_actions(self, count)
3638
end
3739

3840
local viewscreen = dfhack.gui.getCurViewscreen()
41+
3942
if self.action_mode ~= 'lock' then
4043
gui.simulateInput(viewscreen, 'SELECT')
4144
end
4245
if self.action_mode ~= 'select' then
4346
gui.simulateInput(viewscreen, 'UNITLIST_SPECIALIZE')
4447
end
48+
4549
gui.simulateInput(viewscreen, 'STANDARDSCROLL_DOWN')
4650
gui.simulateInput(viewscreen, 'CONTEXT_SCROLL_DOWN')
4751

@@ -89,6 +93,7 @@ function SelectLockOverlay:init()
8993
view_id = 'run_button',
9094
frame = {l = 1, t = 3},
9195
label = 'RUN',
96+
key = 'CUSTOM_R', -- press 'r' to run
9297
on_activate = function()
9398
if self.is_running then return end
9499
self.is_running = true

0 commit comments

Comments
 (0)