Compare commits

...

10 Commits

Author SHA1 Message Date
d69da1a7d5 Fix lockboxes in 10.0.2
I failed to understand that GetContainerItemInfo isn't a 1:1 mapping to the new native version, so this adds a shim to make it work.
2022-11-16 20:33:58 -06:00
55c73b3505 More 10.0.2 changes 2022-11-16 11:26:54 -06:00
fcd5d6d1f9 Update changelog 2022-11-15 00:30:34 -06:00
c39996022e Increase TOC for 10.0.2 2022-11-15 00:27:19 -06:00
6c3f3e93e6 I'm gonna get this right one day 2022-11-12 08:55:37 -06:00
e84b834139 Fix error on 10.0.0 2022-11-11 16:48:03 -06:00
a6d396e88d Fix ignore 2022-11-11 10:27:27 -06:00
89dd251093 Update changelog 2022-11-11 10:21:32 -06:00
1d6883b1f5 Add support for 10.0.2/Dragonflight 2022-11-11 10:20:45 -06:00
cb0cd8749d Add reset button
In case a user has misplaced their Breakable window, this allows it to be reset.

It also groups the settings together so that Reset can't be pressed accidentally.
2022-10-30 11:48:42 -05:00
3 changed files with 285 additions and 210 deletions

View File

@ -5,12 +5,39 @@ local LBF = LibStub("Masque", true)
local lbfGroup
local IsArtifactRelicItem = IsArtifactRelicItem
local IsArtifactRelicItem, GetBagName, GetContainerNumSlots, GetContainerItemInfo, GetContainerItemLink =
IsArtifactRelicItem, GetBagName, GetContainerNumSlots, GetContainerItemInfo, GetContainerItemLink
if not IsArtifactRelicItem then
IsArtifactRelicItem = function()
return false
end
end
if C_Container then
if C_Container.GetBagName then
GetBagName = C_Container.GetBagName
end
if C_Container.GetContainerNumSlots then
GetContainerNumSlots = C_Container.GetContainerNumSlots
end
if C_Container.GetContainerItemInfo then
GetContainerItemInfo = function(bagId, slotId)
local info = C_Container.GetContainerItemInfo(bagId, slotId)
if not info then
return nil
end
return info.iconFileID, info.stackCount
end
end
if C_Container.GetContainerItemLink then
GetContainerItemLink = C_Container.GetContainerItemLink
end
end
local EQUIPPED_LAST = EQUIPPED_LAST
if not EQUIPPED_LAST then
EQUIPPED_LAST = INVSLOT_LAST_EQUIPPED
end
local WowVer = select(4, GetBuildInfo())
local IsClassic = false
@ -609,214 +636,239 @@ function Breakables:GetOptions()
name = L["Welcome"],
order = 0,
},
hideAlways = {
type = "toggle",
name = L["Hide bar"],
desc = L["This will completely hide the breakables bar whether you have anything to break down or not. Note that you can toggle this in a macro using the /breakables command as well."],
get = function(info)
return self.settings.hide
end,
set = function(info, v)
self.settings.hide = v
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78maxBreakables|r to " .. tostring(self.settings.hide))
end
self:ToggleButtonFrameVisibility(not v)
if not v then
self:FindBreakables()
end
end,
order = 1
mainSettings = {
name = L["Settings"],
type = "group",
order = 1,
args = {
hideAlways = {
type = "toggle",
name = L["Hide bar"],
desc = L["This will completely hide the breakables bar whether you have anything to break down or not. Note that you can toggle this in a macro using the /breakables command as well."],
get = function(info)
return self.settings.hide
end,
set = function(info, v)
self.settings.hide = v
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78maxBreakables|r to " .. tostring(self.settings.hide))
end
self:ToggleButtonFrameVisibility(not v)
if not v then
self:FindBreakables()
end
end,
order = 1
},
hideNoBreakables = {
type = "toggle",
name = L["Hide if no breakables"],
desc = L["Whether or not to hide the action bar if no breakables are present in your bags"],
get = function(info)
return self.settings.hideIfNoBreakables
end,
set = function(info, v)
self.settings.hideIfNoBreakables = v
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78hideIfNoBreakables|r to " .. tostring(self.settings.hideIfNoBreakables))
end
self:FindBreakables()
end,
order = 2,
},
hideInCombat = {
type = "toggle",
name = L["Hide during combat"],
desc = L["Whether or not to hide the breakables bar when you enter combat and show it again when leaving combat."],
get = function(info)
return self.settings.hideInCombat
end,
set = function(info, v)
self.settings.hideInCombat = v
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78hideInCombat|r to " .. tostring(self.settings.hideInCombat))
end
end,
order = 3,
},
maxBreakables = {
type = 'range',
name = L["Max number to display"],
desc = L["How many breakable buttons to display next to the profession button at maximum"],
min = 1,
max = 50,
step = 1,
get = function(info)
return self.settings.maxBreakablesToShow
end,
set = function(info, v)
self.settings.maxBreakablesToShow = v
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78maxBreakables|r to " .. tostring(self.settings.maxBreakablesToShow))
end
self:FindBreakables()
end,
order = 4,
},
buttonScale = {
type = 'range',
name = L["Button scale"],
desc = L["This will scale the size of each button up or down."],
min = 0.1,
max = 2,
step = 0.01,
get = function(info)
return self.settings.buttonScale
end,
set = function(info, v)
self.settings.buttonScale = v
Breakables:ApplyScale()
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78buttonScale|r to " .. tostring(self.settings.buttonScale))
end
end,
order = 5,
},
fontSize = {
type = 'range',
name = L["Font size"],
desc = L["This sets the size of the text that shows how many items you have to break."],
min = 4,
max = 90,
step = 1,
get = function(info)
return self.settings.fontSize
end,
set = function(info, v)
self.settings.fontSize = v
Breakables:ApplyScale()
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78fontSize|r to " .. tostring(self.settings.fontSize))
end
end,
order = 6,
},
growDirection = {
type = 'select',
name = L["Button grow direction"],
desc = L["This controls which direction the breakable buttons grow toward."],
values = validGrowDirections,
get = function()
return self.settings.growDirection
end,
set = function(info, v)
self.settings.growDirection = v
self:FindBreakables()
end,
order = 7,
},
showTooltipForBreakables = {
type = "toggle",
name = L["Show tooltip on breakables"],
desc = L["Whether or not to show an item tooltip when hovering over a breakable item button."],
get = function(info)
return self.settings.showTooltipForBreakables
end,
set = function(info, v)
self.settings.showTooltipForBreakables = v
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78showTooltipForBreakables|r to " .. tostring(self.settings.showTooltipForBreakables))
end
end,
order = 8,
},
showTooltipForProfession = {
type = "toggle",
name = L["Show tooltip on profession"],
desc = L["Whether or not to show an item tooltip when hovering over a profession button on the Breakables bar."],
get = function(info)
return self.settings.showTooltipForProfession
end,
set = function(info, v)
self.settings.showTooltipForProfession = v
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78showTooltipForProfession|r to " .. tostring(self.settings.showTooltipForProfession))
end
end,
order = 9,
},
ignoreList = {
type = 'multiselect',
name = L["Ignore list"],
desc = L["Items that have been right-clicked to exclude from the breakable list. Un-check the box to remove the item from the ignore list."],
get = function(info, key)
return true
end,
set = function(info, key)
Breakables.settings.ignoreList[key] = nil
Breakables:FindBreakables()
end,
confirm = function()
return L["Are you sure you want to remove this item from the ignore list?"]
end,
values = GetIgnoreListOptions,
hidden = function() return not IsIgnoringAnything() end,
order = 30,
},
clearIgnoreList = {
type = 'execute',
func = function()
for k,v in pairs(Breakables.settings.ignoreList) do
Breakables.settings.ignoreList[k] = nil
end
Breakables:FindBreakables()
end,
name = L["Clear ignore list"],
confirm = function()
return L["Are you sure you want to clear the ignore list?"]
end,
hidden = function() return not IsIgnoringAnything() end,
order = 31,
},
showSoulbound = {
type = "toggle",
name = L["Show soulbound items"],
desc = L["Whether or not to display soulbound items as breakables."],
get = function(info)
return self.settings.showSoulbound
end,
set = function(info, v)
self.settings.showSoulbound = v
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78showSoulbound|r to " .. tostring(self.settings.showSoulbound))
end
self:FindBreakables()
end,
hidden = function()
return not CanDisenchant
end,
order = 20,
},
},
},
hideNoBreakables = {
type = "toggle",
name = L["Hide if no breakables"],
desc = L["Whether or not to hide the action bar if no breakables are present in your bags"],
get = function(info)
return self.settings.hideIfNoBreakables
end,
set = function(info, v)
self.settings.hideIfNoBreakables = v
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78hideIfNoBreakables|r to " .. tostring(self.settings.hideIfNoBreakables))
end
self:FindBreakables()
end,
reset = {
name = L["Reset"],
type = "group",
order = 2,
},
hideInCombat = {
type = "toggle",
name = L["Hide during combat"],
desc = L["Whether or not to hide the breakables bar when you enter combat and show it again when leaving combat."],
get = function(info)
return self.settings.hideInCombat
end,
set = function(info, v)
self.settings.hideInCombat = v
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78hideInCombat|r to " .. tostring(self.settings.hideInCombat))
end
end,
order = 3,
},
maxBreakables = {
type = 'range',
name = L["Max number to display"],
desc = L["How many breakable buttons to display next to the profession button at maximum"],
min = 1,
max = 50,
step = 1,
get = function(info)
return self.settings.maxBreakablesToShow
end,
set = function(info, v)
self.settings.maxBreakablesToShow = v
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78maxBreakables|r to " .. tostring(self.settings.maxBreakablesToShow))
end
self:FindBreakables()
end,
order = 4,
},
buttonScale = {
type = 'range',
name = L["Button scale"],
desc = L["This will scale the size of each button up or down."],
min = 0.1,
max = 2,
step = 0.01,
get = function(info)
return self.settings.buttonScale
end,
set = function(info, v)
self.settings.buttonScale = v
Breakables:ApplyScale()
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78buttonScale|r to " .. tostring(self.settings.buttonScale))
end
end,
order = 5,
},
fontSize = {
type = 'range',
name = L["Font size"],
desc = L["This sets the size of the text that shows how many items you have to break."],
min = 4,
max = 90,
step = 1,
get = function(info)
return self.settings.fontSize
end,
set = function(info, v)
self.settings.fontSize = v
Breakables:ApplyScale()
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78fontSize|r to " .. tostring(self.settings.fontSize))
end
end,
order = 6,
},
growDirection = {
type = 'select',
name = L["Button grow direction"],
desc = L["This controls which direction the breakable buttons grow toward."],
values = validGrowDirections,
get = function()
return self.settings.growDirection
end,
set = function(info, v)
self.settings.growDirection = v
self:FindBreakables()
end,
order = 7,
},
showTooltipForBreakables = {
type = "toggle",
name = L["Show tooltip on breakables"],
desc = L["Whether or not to show an item tooltip when hovering over a breakable item button."],
get = function(info)
return self.settings.showTooltipForBreakables
end,
set = function(info, v)
self.settings.showTooltipForBreakables = v
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78showTooltipForBreakables|r to " .. tostring(self.settings.showTooltipForBreakables))
end
end,
order = 8,
},
showTooltipForProfession = {
type = "toggle",
name = L["Show tooltip on profession"],
desc = L["Whether or not to show an item tooltip when hovering over a profession button on the Breakables bar."],
get = function(info)
return self.settings.showTooltipForProfession
end,
set = function(info, v)
self.settings.showTooltipForProfession = v
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78showTooltipForProfession|r to " .. tostring(self.settings.showTooltipForProfession))
end
end,
order = 9,
},
ignoreList = {
type = 'multiselect',
name = L["Ignore list"],
desc = L["Items that have been right-clicked to exclude from the breakable list. Un-check the box to remove the item from the ignore list."],
get = function(info, key)
return true
end,
set = function(info, key)
Breakables.settings.ignoreList[key] = nil
Breakables:FindBreakables()
end,
confirm = function()
return L["Are you sure you want to remove this item from the ignore list?"]
end,
values = GetIgnoreListOptions,
hidden = function() return not IsIgnoringAnything() end,
order = 30,
},
clearIgnoreList = {
type = 'execute',
func = function()
for k,v in pairs(Breakables.settings.ignoreList) do
Breakables.settings.ignoreList[k] = nil
end
Breakables:FindBreakables()
end,
name = L["Clear ignore list"],
confirm = function()
return L["Are you sure you want to clear the ignore list?"]
end,
hidden = function() return not IsIgnoringAnything() end,
order = 31,
},
showSoulbound = {
type = "toggle",
name = L["Show soulbound items"],
desc = L["Whether or not to display soulbound items as breakables."],
get = function(info)
return self.settings.showSoulbound
end,
set = function(info, v)
self.settings.showSoulbound = v
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78showSoulbound|r to " .. tostring(self.settings.showSoulbound))
end
self:FindBreakables()
end,
hidden = function()
return not CanDisenchant
end,
order = 20,
args = {
resetPlacement = {
type = "execute",
name = L["Reset placement"],
desc = L["Resets where the buttons are placed on the screen to the default location."],
func = function()
self.settings.buttonFrameLeft = self.defaults.profile.buttonFrameLeft
self.settings.buttonFrameTop = self.defaults.profile.buttonFrameTop
self:CreateButtonFrame()
end,
order = 30,
},
},
},
},
}
if GetNumEquipmentSets or C_EquipmentSet then
opts.args.hideEqManagerItems = {
opts.args.mainSettings.args.hideEqManagerItems = {
type = "toggle",
name = L["Hide Eq. Mgr items"],
desc = L["Whether or not to hide items that are part of an equipment set in the game's equipment manager."],
@ -838,7 +890,7 @@ function Breakables:GetOptions()
end
if ShouldShowTabardControls then
opts.args.hideTabards = {
opts.args.mainSettings.args.hideTabards = {
type = "toggle",
name = L["Hide Tabards"],
desc = L["Whether or not to hide tabards from the disenchantable items list."],
@ -857,7 +909,7 @@ function Breakables:GetOptions()
end
if not IgnoreEnchantingSkillLevelForDisenchant then
opts.args.ignoreEnchantingSkillLevel = {
opts.args.mainSettings.args.ignoreEnchantingSkillLevel = {
type = "toggle",
name = L["Ignore Enchanting skill level"],
desc = L["Whether or not items should be shown when Breakables thinks you don't have the appropriate skill level to disenchant it."],
@ -876,7 +928,7 @@ function Breakables:GetOptions()
end
if UnitCanPetBattle then
opts.args.hideInPetBattle = {
opts.args.mainSettings.args.hideInPetBattle = {
type = "toggle",
name = L["Hide during pet battles"],
desc = L["Whether or not to hide the breakables bar when you enter a pet battle."],
@ -1027,8 +1079,8 @@ function Breakables:OnMouseUp(frame)
self.settings.buttonFrameTop[frameNum] = frame:GetTop()
end
local function IgnoreFunc(self, button)
if button == "RightButton" and not InCombatLockdown() then
local function IgnoreFunc(self, button, isDown)
if button == "RightButton" and isDown and not InCombatLockdown() then
Breakables.settings.ignoreList[self.itemId] = true
Breakables:FindBreakables()
LibStub("AceConfigRegistry-3.0"):NotifyChange("Breakables")
@ -1304,7 +1356,7 @@ function Breakables:FindBreakablesInSlot(bagId, slotId)
self.myTooltip:SetOwner(WorldFrame, "ANCHOR_NONE")
end
local texture, itemCount, locked, quality, readable = GetContainerItemInfo(bagId, slotId)
local texture, itemCount = GetContainerItemInfo(bagId, slotId)
if texture then
local itemLink = GetContainerItemLink(bagId, slotId)
local itemId = self:GetItemIdFromLink(itemLink)

View File

@ -1,5 +1,5 @@
## Interface: 100000
## Interface-Retail: 100000
## Interface: 100002
## Interface-Retail: 100002
## Interface-Classic: 11403
## Interface-BCC: 20504
## Interface-Wrath: 30400

View File

@ -1,3 +1,26 @@
v1.9.6:
- Fix lockboxes in 10.0.2
v1.9.5:
- Fix another error from 10.0.2
v1.9.4:
- Update TOC for 10.0.2
v1.9.3:
- Fix error on 10.0.0
v1.9.2:
- Dragonflight/10.0.2 compatibility
- Add ability to reset placement of the bar in case it gets lost somehow.
- Shuffled settings into their own categories to make accidental resets unlikely.
- Fix items being added to the ignore list both on press and release. This would frequently mean that two items would get ignored instead of just the one you wanted to click on.
v1.9.1:
- Fix right-click ignore functionality after the upgrade to 10.0.