Skip to content

Commit

Permalink
Merge pull request #971 from myk002/myk_autobutcher
Browse files Browse the repository at this point in the history
[gui/autobutcher] ask for confirmation before zeroing out all targets
  • Loading branch information
myk002 authored Feb 9, 2024
2 parents 4e88751 + 0594710 commit c85cf57
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Template for new versions:

## Misc Improvements
- `exportlegends`: increase precision of progress bar and stabilize formatting of the text
- `gui/autobutcher`: ask for confirmation before zeroing out targets for all races

## Removed

Expand Down
21 changes: 15 additions & 6 deletions gui/autobutcher.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local dlg = require 'gui.dialogs'
local gui = require 'gui'
local plugin = require 'plugins.autobutcher'
local widgets = require 'gui.widgets'
local dlg = require('gui.dialogs')
local gui = require('gui')
local plugin = require('plugins.autobutcher')
local widgets = require('gui.widgets')

local CH_UP = string.char(30)
local CH_DN = string.char(31)
Expand Down Expand Up @@ -644,13 +644,22 @@ function WatchList:zeroOut()

local count = 0
if choice.race == 1 then
plugin.autobutcher_setDefaultTargetAll(count, count, count, count)
dlg.showYesNoPrompt(
'Are you sure?',
'Really set all targets for all races to 0?',
COLOR_YELLOW,
function()
plugin.autobutcher_setDefaultTargetAll(count, count, count, count)
self:refresh()
end
)
elseif choice.race == 2 then
plugin.autobutcher_setDefaultTargetNew(count, count, count, count)
self:refresh()
else
plugin.autobutcher_setWatchListRace(data.id, count, count, count, count, data.watched)
self:refresh()
end
self:refresh()
end

function WatchList:onToggleWatching()
Expand Down

0 comments on commit c85cf57

Please sign in to comment.