Skip to content

Commit

Permalink
Added --quiet / -q flag to fix/dry-buckets
Browse files Browse the repository at this point in the history
  • Loading branch information
kdonnelly007 committed Aug 30, 2024
1 parent d845ac9 commit ed203d0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions fix/dry-buckets.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
local argparse = require("argparse")

local quiet = false

local emptied = 0
local in_building = 0
local water_type = dfhack.matinfo.find('WATER').type

argparse.processArgsGetopt({...}, {
{'q', 'quiet', handler=function() quiet = true end},
})

for _,item in ipairs(df.global.world.items.other.IN_PLAY) do
local container = dfhack.items.getContainer(item)
if container
Expand All @@ -19,7 +27,9 @@ for _,item in ipairs(df.global.world.items.other.IN_PLAY) do
end
end

print('Emptied '..emptied..' buckets.')
if emptied > 0 then
print(('Unclogged %d wells.'):format(in_building))
if not quiet then
print('Emptied '..emptied..' buckets.')
if emptied > 0 then
print(('Unclogged %d wells.'):format(in_building))
end
end
2 changes: 1 addition & 1 deletion internal/control-panel/registry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ COMMANDS_BY_IDX = {
params={'--time', '7', '--timeUnits', 'days', '--command', '[', 'fix/dead-units', '--burrow', '-q', ']'}},
{command='fix/dry-buckets', group='bugfix', mode='repeat', default=true,
desc='Allow discarded water buckets to be used again.',
params={'--time', '7', '--timeUnits', 'days', '--command', '[', 'fix/dry-buckets', ']'}},
params={'--time', '7', '--timeUnits', 'days', '--command', '[', 'fix/dry-buckets', '-q', ']'}},
{command='fix/empty-wheelbarrows', group='bugfix', mode='repeat', default=true,
desc='Make abandoned full wheelbarrows usable again.',
params={'--time', '1', '--timeUnits', 'days', '--command', '[', 'fix/empty-wheelbarrows', '-q', ']'}},
Expand Down

0 comments on commit ed203d0

Please sign in to comment.