Skip to content

Commit

Permalink
Honour banked items checkbox in deconstructor pane, remove banked ite…
Browse files Browse the repository at this point in the history
…ms setting from MD menu
  • Loading branch information
MaraRinn committed Apr 5, 2022
1 parent cd4d655 commit a873746
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
18 changes: 15 additions & 3 deletions MassDeconstructor.lua
Expand Up @@ -13,7 +13,6 @@ MD.defaults = {
DeconstructSetPiece = false,
DeconstructCrafted = false,
Debug = false,
BankMode = false,
Verbose = false,
Clothing = {
maxQuality = 4,
Expand Down Expand Up @@ -62,6 +61,18 @@ local function VerboseDebugMessage(message)
end
end

local function IncludeBankedItems()
-- include banked items?
if MD.isAssistant then
includeBankedItemsButton = UNIVERSAL_DECONSTRUCTION.deconstructionPanel.includeBankedItemsCheckbox
else
includeBankedItemsButton = SMITHING.deconstructionPanel.includeBankedItemsCheckbox
end
includeThem = ZO_CheckButton_IsChecked(includeBankedItemsButton)
DebugMessage('Include banked items:' .. (includeThem and "Yes" or "no"))
return includeThem
end

local function IsItemProtected(bagId, slotId)
--Item Saver support
if ItemSaver_IsItemSaved and ItemSaver_IsItemSaved(bagId, slotId) then
Expand Down Expand Up @@ -358,7 +369,7 @@ local function BuildDeconstructionQueue()
MD.deconstructQueue = {}

AddItemsToDeconstructionQueue(BAG_BACKPACK)
if MD.settings.BankMode then
if MD.IncludeBankedItems() then
-- subscribers get extra bank space
if IsESOPlusSubscriber() then AddItemsToDeconstructionQueue(BAG_SUBSCRIBER_BANK) end
-- regular bank
Expand Down Expand Up @@ -492,7 +503,7 @@ local function BuildRefiningQueue()
DebugMessage("This account doesn't have a crafting bag")
end
AddItemsToRefineQueue(BAG_BACKPACK)
if MD.settings.BankMode then
if MD.IncludeBankedItems() then
-- subscribers get extra bank space
if IsESOPlusSubscriber() then AddItemsToRefineQueue(BAG_SUBSCRIBER_BANK) end
-- regular bank
Expand Down Expand Up @@ -676,6 +687,7 @@ function MD.OnCraftEnd()
if MD.settings.Debug then
d("MD station leave")
end

KEYBIND_STRIP:RemoveKeybindButtonGroup(MD.KeybindStripDescriptor)
EVENT_MANAGER:UnregisterForEvent(MD.name, EVENT_CRAFT_COMPLETED)
end
Expand Down
6 changes: 0 additions & 6 deletions MassDeconstructorMenu.lua
Expand Up @@ -20,12 +20,6 @@ function MD.MakeMenu()

-- this addons entries in the addon menu
local options = {
{
type = "checkbox",
name = "Deconstruct items in bank",
getFunc = function() return set.BankMode end,
setFunc = function(value) set.BankMode = value end,
},
{
type = "checkbox",
name = "Deconstruct bound items",
Expand Down

0 comments on commit a873746

Please sign in to comment.