Skip to content

Commit 3da94f5

Browse files
authored
Merge pull request #1281 from kdonnelly007/kdonnelly007/dfhack-4860
Issue 4860: Adding fix/dry-buckets to control panel, adding --quiet / -q flag
2 parents fe19564 + ffd05f3 commit 3da94f5

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

fix/dry-buckets.lua

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1+
local argparse = require("argparse")
2+
3+
local quiet = false
4+
15
local emptied = 0
26
local in_building = 0
37
local water_type = dfhack.matinfo.find('WATER').type
48

9+
argparse.processArgsGetopt({...}, {
10+
{'q', 'quiet', handler=function() quiet = true end},
11+
})
12+
513
for _,item in ipairs(df.global.world.items.other.IN_PLAY) do
614
local container = dfhack.items.getContainer(item)
715
if container
@@ -19,7 +27,9 @@ for _,item in ipairs(df.global.world.items.other.IN_PLAY) do
1927
end
2028
end
2129

22-
print('Emptied '..emptied..' buckets.')
23-
if emptied > 0 then
24-
print(('Unclogged %d wells.'):format(in_building))
30+
if not quiet then
31+
print('Emptied '..emptied..' buckets.')
32+
if emptied > 0 then
33+
print(('Unclogged %d wells.'):format(in_building))
34+
end
2535
end

internal/control-panel/registry.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ COMMANDS_BY_IDX = {
7171
{command='fix/dead-units', group='bugfix', mode='repeat', default=true,
7272
desc='Fix units still being assigned to burrows after death.',
7373
params={'--time', '7', '--timeUnits', 'days', '--command', '[', 'fix/dead-units', '--burrow', '-q', ']'}},
74+
{command='fix/dry-buckets', group='bugfix', mode='repeat', default=true,
75+
desc='Allow discarded water buckets and clogged wells to be used again.',
76+
params={'--time', '7', '--timeUnits', 'days', '--command', '[', 'fix/dry-buckets', '-q', ']'}},
7477
{command='fix/empty-wheelbarrows', group='bugfix', mode='repeat', default=true,
7578
desc='Make abandoned full wheelbarrows usable again.',
7679
params={'--time', '1', '--timeUnits', 'days', '--command', '[', 'fix/empty-wheelbarrows', '-q', ']'}},

0 commit comments

Comments
 (0)