mirror of
https://github.com/parnic/breakables.git
synced 2025-06-17 01:41:51 -05:00
Set default value for ignoreList array
This commit is contained in:
@ -181,6 +181,7 @@ function Breakables:OnInitialize()
|
|||||||
buttonScale = 1,
|
buttonScale = 1,
|
||||||
fontSize = 11,
|
fontSize = 11,
|
||||||
growDirection = 2,
|
growDirection = 2,
|
||||||
|
ignoreList = {},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.db = LibStub("AceDB-3.0"):New("BreakablesDB", self.defaults, true)
|
self.db = LibStub("AceDB-3.0"):New("BreakablesDB", self.defaults, true)
|
||||||
@ -412,21 +413,15 @@ end
|
|||||||
local function GetIgnoreListOptions()
|
local function GetIgnoreListOptions()
|
||||||
local ret = {}
|
local ret = {}
|
||||||
|
|
||||||
if Breakables.settings.ignoreList ~= nil then
|
for k,v in pairs(Breakables.settings.ignoreList) do
|
||||||
for k,v in pairs(Breakables.settings.ignoreList) do
|
local name, _, _, _, _, _, _, _, _, texture = GetItemInfo(k)
|
||||||
local name, _, _, _, _, _, _, _, _, texture = GetItemInfo(k)
|
ret[k] = ("|T%s:0|t %s"):format(texture, name)
|
||||||
ret[k] = ("|T%s:0|t %s"):format(texture, name)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
local function IsIgnoringAnything()
|
local function IsIgnoringAnything()
|
||||||
if Breakables.settings.ignoreList == nil then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
for k,v in pairs(Breakables.settings.ignoreList) do
|
for k,v in pairs(Breakables.settings.ignoreList) do
|
||||||
if v ~= nil then
|
if v ~= nil then
|
||||||
return true
|
return true
|
||||||
@ -790,10 +785,6 @@ end
|
|||||||
|
|
||||||
local function IgnoreFunc(self, button)
|
local function IgnoreFunc(self, button)
|
||||||
if button == "RightButton" and not InCombatLockdown() then
|
if button == "RightButton" and not InCombatLockdown() then
|
||||||
if Breakables.settings.ignoreList == nil then
|
|
||||||
Breakables.settings.ignoreList = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
Breakables.settings.ignoreList[self.itemId] = true
|
Breakables.settings.ignoreList[self.itemId] = true
|
||||||
Breakables:FindBreakables()
|
Breakables:FindBreakables()
|
||||||
LibStub("AceConfigRegistry-3.0"):NotifyChange("Breakables")
|
LibStub("AceConfigRegistry-3.0"):NotifyChange("Breakables")
|
||||||
@ -1056,7 +1047,7 @@ function Breakables:FindBreakablesInSlot(bagId, slotId)
|
|||||||
local texture, itemCount, locked, quality, readable = GetContainerItemInfo(bagId, slotId)
|
local texture, itemCount, locked, quality, readable = GetContainerItemInfo(bagId, slotId)
|
||||||
if texture then
|
if texture then
|
||||||
local itemLink = GetContainerItemLink(bagId, slotId)
|
local itemLink = GetContainerItemLink(bagId, slotId)
|
||||||
if self.settings.ignoreList and self.settings.ignoreList[self:GetItemIdFromLink(itemLink)] then
|
if self.settings.ignoreList[self:GetItemIdFromLink(itemLink)] then
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user