Compare commits

...

31 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
a98b02e7cb Fix right-click ignores 2022-10-27 20:17:27 -05:00
d299ed3d3f Add sponsor file 2022-10-27 09:11:10 -05:00
4a1d004502 Prepare for release 2022-10-25 21:27:01 -05:00
a775f7af33 Fix buttons not working on 10.0 2022-09-23 11:07:37 -05:00
3a9db4082a Fix hiding when you unlearn the last profession 2022-09-22 21:37:16 -05:00
59b1cafee3 Respond to gaining/losing a Breakable skill
The mod now reacts by adding or removing the Breakable button row when the player gains or loses an appropriate skill or profession. So if you train Enchanting, a disenchant bar will be added and if you unlearn it it will go away, for example.
2022-09-22 21:18:06 -05:00
a27b2a7301 Update to latest packager example 2022-09-22 11:01:34 -05:00
8abe349758 Add Wago packaging support 2022-09-22 10:54:28 -05:00
4cb1d01204 Add license 2022-09-22 10:54:13 -05:00
016cc6f226 Improve picked lockbox ui update reliability 2022-09-14 23:16:20 -05:00
f71b527f71 Update changelog, tweak option description 2022-09-12 13:17:49 -05:00
a65674510e Add option to always show Enchanting breakables
If the user really wants to bypass the level check (or the mod is misbehaving), this allows them to show everything.
2022-09-12 13:14:24 -05:00
41592a7c76 Make WowVer checks into local named vars 2022-09-12 12:59:48 -05:00
62c8db483e Remove debug print 2022-09-12 12:59:22 -05:00
abf769bf9d Show disenchants if skill level can't be determined 2022-09-11 11:31:57 -05:00
9bd5541f81 Update changelog 2022-09-11 00:13:16 -05:00
80e495f707 Attempt to fix enchant level detection on Wrath
This only works if the player hasn't collapsed the Professions section of their skill UI, and if LibBabble-Inventory's translation is correct for this in all cases, but it's the only method I've found so far that works for Wrath. The other option is to show everything as disenchantable, but I don't like that.
2022-09-11 00:12:30 -05:00
3257ce5645 Package for Wrath, update TOCs 2022-09-04 14:01:25 -05:00
93739030f4 Update TOCs 2022-06-01 08:34:15 -05:00
70fa098fc3 Update TOCs and changelog 2022-03-23 20:54:07 -05:00
154da46002 Add some 9.1/9.2 breakables 2022-03-23 20:53:31 -05:00
7 changed files with 524 additions and 260 deletions

View File

@ -23,6 +23,7 @@ jobs:
env:
CF_API_KEY: ${{ secrets.CF_API_KEY }}
WOWI_API_TOKEN: ${{ secrets.WOWI_API_TOKEN }}
WAGO_API_TOKEN: ${{ secrets.WAGO_API_TOKEN }}
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }} # "GITHUB_TOKEN" is a secret always provided to the workflow
# for your own token, the name cannot start with "GITHUB_"
@ -31,20 +32,27 @@ jobs:
# we first have to clone the AddOn project, this is a required step
- name: Clone project
uses: actions/checkout@v1
uses: actions/checkout@v3
with:
fetch-depth: 0 # gets git history for changelogs
# once cloned, we just run the GitHub Action for the packager project
- name: Package and release
uses: BigWigsMods/packager@master
uses: BigWigsMods/packager@v2
# another example where we supply additional arguments, this example is specifically to release
# for the Classic version of the game
- name: Package and release for Classic
uses: BigWigsMods/packager@master
uses: BigWigsMods/packager@v2
with:
args: -g classic -w 0
- name: Package and release for TBC
uses: BigWigsMods/packager@master
uses: BigWigsMods/packager@v2
with:
args: -g bcc -w 0
- name: Package and release for Wrath
uses: BigWigsMods/packager@v2
with:
args: -g wrath -w 0

View File

@ -37,6 +37,7 @@ externals:
ignore:
- readme.md
- FUNDING.yml
manual-changelog: changelog.txt

View File

@ -5,16 +5,67 @@ 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 = WOW_PROJECT_ID and WOW_PROJECT_ID == WOW_PROJECT_CLASSIC
local IsClassicBC = WOW_PROJECT_ID and WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC
local IsClassic = false
local IsClassicBC = false
local IsClassicWrath = false
if GetClassicExpansionLevel then
IsClassic = GetClassicExpansionLevel() == 0
IsClassicBC = GetClassicExpansionLevel() == 1
IsClassicWrath = GetClassicExpansionLevel() == 2
else
IsClassic = WOW_PROJECT_ID and WOW_PROJECT_ID == WOW_PROJECT_CLASSIC
IsClassicBC = false
IsClassicWrath = false
if WOW_PROJECT_ID and WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC then
if not LE_EXPANSION_LEVEL_CURRENT or LE_EXPANSION_LEVEL_CURRENT == LE_EXPANSION_BURNING_CRUSADE then
IsClassicBC = true
elseif LE_EXPANSION_LEVEL_CURRENT == LE_EXPANSION_WRATH_OF_THE_LICH_KING then
IsClassicWrath = true
end
elseif WOW_PROJECT_WRATH_CLASSIC and WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC then
IsClassicWrath = true
end
end
local ShouldHookTradeskillUpdate = WowVer < 80000
local ShouldShowTabardControls = WowVer >= 80000
local UseNonNativeEqManagerChecks = WowVer < 80000
local IgnoreEnchantingSkillLevelForDisenchant = WowVer >= 80000
local MillingId = 51005
local MillingItemSubType = babbleInv["Herb"]
@ -54,6 +105,7 @@ local AdditionalMillableItems = {
168583, -- widowbloom
169701, -- death blossom
171315, -- nightshade
187699, -- first flower, 9.2.0
}
local AdditionalProspectableItems = {
@ -73,6 +125,7 @@ local AdditionalProspectableItems = {
171830, -- oxxein
171831, -- phaedrum
171832, -- sinvyr
187700, -- progenium ore, 9.2.0
}
local MassMilling = {
@ -99,6 +152,7 @@ local MassMilling = {
[168583] = 311415,
[169701] = 311413,
[171315] = 311418,
[187699] = 359490,
}
local HerbCombineItems = {
@ -186,6 +240,7 @@ local PickableItems = {
180532, -- maldraxxi
180533, -- kyrian
180522, -- night fae
186161, -- stygian lockbox, 9.1.0
}
local CanPickLock = false
@ -215,6 +270,7 @@ local BREAKABLE_PICK = 4
local BREAKABLE_COMBINE = 5
local BagUpdateCheckDelay = 0.1
local PickLockFinishedDelay = 1
local nextCheck = {}
for i=0,NUM_BAG_SLOTS do
nextCheck[i] = -1
@ -233,6 +289,10 @@ local showingTooltip = nil
Breakables.optionsFrame = {}
Breakables.justClicked = false
Breakables.justClickedBag = -1
Breakables.justClickedSlot = -1
Breakables.justPickedBag = -1
Breakables.justPickedSlot = -1
function Breakables:OnInitialize()
self.defaults = {
@ -306,12 +366,28 @@ function Breakables:InitLDB()
end
end
function Breakables:OnEnable()
function Breakables:SetCapabilities()
CanMill = IsUsableSpell(GetSpellInfo(MillingId))
CanProspect = IsUsableSpell(GetSpellInfo(ProspectingId))
CanDisenchant = IsUsableSpell(GetSpellInfo(DisenchantId))
CanPickLock = IsUsableSpell(GetSpellInfo(PickLockId))
end
function Breakables:OnSpellsChanged()
local couldMill = CanMill
local couldProspect = CanProspect
local couldDisenchant = CanDisenchant
local couldPick = CanPickLock
self:SetCapabilities()
if couldMill ~= CanMill or couldProspect ~= CanProspect or couldDisenchant ~= CanDisenchant or couldPick ~= CanPickLock then
self:SetupButtons()
end
end
function Breakables:OnEnable()
self:SetCapabilities()
self.EnchantingLevel = 0
LibStub("AceConfig-3.0"):RegisterOptionsTable("Breakables", self:GetOptions(), "breakables")
@ -328,7 +404,16 @@ function Breakables:OnEnable()
self:RegisterEvents()
if CanMill or CanProspect or CanDisenchant or CanPickLock then
self:SetupButtons()
end
local canBreakSomething = function()
return CanMill or CanProspect or CanDisenchant or CanPickLock
end
function Breakables:SetupButtons()
numEligibleProfessions = 0
if canBreakSomething() then
if CanMill then
numEligibleProfessions = numEligibleProfessions + 1
end
@ -354,7 +439,7 @@ function Breakables:OnEnable()
end
self.frame:SetScript("OnUpdate", self.frame.OnUpdateFunc)
else
self:UnregisterAllEvents()
self:CreateButtonFrame()
end
end
@ -383,14 +468,13 @@ function Breakables:RegisterEvents()
self:RegisterEvent("PLAYER_REGEN_ENABLED", "OnLeaveCombat")
self:RegisterEvent("MODIFIER_STATE_CHANGED", "FindBreakables")
self:RegisterEvent("SPELLS_CHANGED", "OnSpellsChanged")
if CanDisenchant and WowVer < 80000 then
if ShouldHookTradeskillUpdate then
self:RegisterEvent("TRADE_SKILL_UPDATE", "OnTradeSkillUpdate")
end
if CanPickLock then
self:RegisterEvent("CHAT_MSG_OPENING", "OnBagItemLockPicked")
end
self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED", "OnSpellCastSucceeded")
if UnitCanPetBattle then
self:RegisterEvent("PET_BATTLE_OPENING_START", "PetBattleStarted")
@ -456,12 +540,24 @@ function Breakables:OnLeaveCombat()
end
function Breakables:OnTradeSkillUpdate()
if not CanDisenchant then
return
end
self:GetEnchantingLevel()
self:FindBreakables()
end
function Breakables:OnBagItemLockPicked()
function Breakables:OnSpellCastSucceeded(evt, unit, guid, spell)
if spell ~= PickLockId or not CanPickLock then
return
end
self.justPickedBag = self.justClickedBag
self.justPickedSlot = self.justClickedSlot
self:FindBreakables()
nextCheck[0] = GetTime() + PickLockFinishedDelay
end
function Breakables:PetBattleStarted()
@ -494,6 +590,14 @@ function Breakables:GetEnchantingLevel()
self.EnchantingLevel = rank
end
end
elseif GetSkillLineInfo then
for i=1,100 do
local skillName, header, isExpanded, skillRank, numTempPoints, skillModifier, skillMaxRank, isAbandonable, stepCost, rankCost, minLevel, skillCostType = GetSkillLineInfo(i)
if skillName == babbleInv["Enchanting"] then
self.EnchantingLevel = skillRank
break
end
end
end
end
@ -532,253 +636,299 @@ 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,
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 CanDisenchant then
opts.args.showSoulbound = {
if GetNumEquipmentSets or C_EquipmentSet then
opts.args.mainSettings.args.hideEqManagerItems = {
type = "toggle",
name = L["Show soulbound items"],
desc = L["Whether or not to display soulbound items as breakables."],
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."],
get = function(info)
return self.settings.showSoulbound
return self.settings.hideEqManagerItems
end,
set = function(info, v)
self.settings.showSoulbound = v
self.settings.hideEqManagerItems = v
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78showSoulbound|r to " .. tostring(self.settings.showSoulbound))
print("|cff33ff99Breakables|r: set |cffffff78hideEqManagerItems|r to " .. tostring(self.settings.hideEqManagerItems))
end
self:FindBreakables()
end,
order = 20,
hidden = function()
return not CanDisenchant and not self.settings.showSoulbound
end,
order = 21,
}
end
if ShouldShowTabardControls then
opts.args.mainSettings.args.hideTabards = {
type = "toggle",
name = L["Hide Tabards"],
desc = L["Whether or not to hide tabards from the disenchantable items list."],
get = function(info)
return self.settings.hideTabards
end,
set = function(info, v)
self.settings.hideTabards = v
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78hideTabards|r to " .. tostring(self.settings.hideTabards))
end
self:FindBreakables()
end,
order = 22,
}
end
if not IgnoreEnchantingSkillLevelForDisenchant then
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."],
get = function(info)
return self.settings.ignoreEnchantingSkillLevel
end,
set = function(info, v)
self.settings.ignoreEnchantingSkillLevel = v
self:FindBreakables()
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78ignoreEnchantingSkillLevel|r to " .. tostring(self.settings.ignoreEnchantingSkillLevel))
end
end,
order = 10,
}
if GetNumEquipmentSets or C_EquipmentSet then
opts.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."],
get = function(info)
return self.settings.hideEqManagerItems
end,
set = function(info, v)
self.settings.hideEqManagerItems = v
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78hideEqManagerItems|r to " .. tostring(self.settings.hideEqManagerItems))
end
self:FindBreakables()
end,
hidden = function()
return not self.settings.showSoulbound
end,
order = 21,
}
end
if WowVer >= 80000 then
opts.args.hideTabards = {
type = "toggle",
name = L["Hide Tabards"],
desc = L["Whether or not to hide tabards from the disenchantable items list."],
get = function(info)
return self.settings.hideTabards
end,
set = function(info, v)
self.settings.hideTabards = v
if info.uiType == "cmd" then
print("|cff33ff99Breakables|r: set |cffffff78hideTabards|r to " .. tostring(self.settings.hideTabards))
end
self:FindBreakables()
end,
order = 22,
}
end
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."],
@ -807,6 +957,11 @@ function Breakables:CreateButtonFrame()
self.buttonFrame = {}
end
for i=numEligibleProfessions+1,#self.buttonFrame do
self.buttonFrame[i]:ClearAllPoints()
self.buttonFrame[i]:Hide()
end
for i=1,numEligibleProfessions do
if not self.buttonFrame[i] then
self.buttonFrame[i] = CreateFrame("Button", "BREAKABLES_BUTTON_FRAME"..i, self.frame, "SecureActionButtonTemplate")
@ -829,7 +984,7 @@ function Breakables:CreateButtonFrame()
frame:SetHeight(buttonSize)
frame:EnableMouse(true)
frame:RegisterForClicks("LeftButtonUp")
frame:RegisterForClicks("LeftButtonUp", "LeftButtonDown")
if not frame.OnMouseDownFunc then
frame.OnMouseDownFunc = function(frame) self:OnMouseDown(frame) end
@ -924,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")
@ -937,6 +1092,10 @@ function Breakables:FindBreakables(bag)
return
end
if not canBreakSomething() then
return
end
if self.bCombat then
self.bPendingUpdate = true
return
@ -999,7 +1158,7 @@ function Breakables:FindBreakables(bag)
btn:SetWidth(buttonSize)
btn:SetHeight(buttonSize)
btn:EnableMouse(true)
btn:RegisterForClicks("AnyUp")
btn:RegisterForClicks("AnyUp", "AnyDown")
btn:SetAttribute("type1", "spell")
@ -1157,6 +1316,9 @@ function Breakables:OnLeaveBreakableButton()
end
function Breakables:PostClickedBreakableButton(this)
self.justClickedBag = this.bag
self.justClickedSlot = this.slot
if this.type == BREAKABLE_HERB or this.type == BREAKABLE_ORE or this.type == BREAKABLE_DE or this.type == BREAKABLE_COMBINE then
self.justClicked = true
end
@ -1170,12 +1332,17 @@ function Breakables:FindBreakablesInBag(bagId)
for slotId=1,GetContainerNumSlots(bagId) do
local found = self:FindBreakablesInSlot(bagId, slotId)
if found then
local addedToExisting = self:MergeBreakables(found, foundBreakables)
if bagId ~= self.justPickedBag or slotId ~= self.justPickedSlot then
local addedToExisting = self:MergeBreakables(found, foundBreakables)
if not addedToExisting then
foundBreakables[i] = found
i = i + 1
if not addedToExisting then
foundBreakables[i] = found
i = i + 1
end
end
elseif bagId == self.justPickedBag and slotId == self.justPickedSlot then
self.justPickedBag = -1
self.justPickedSlot = -1
end
end
end
@ -1189,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)
@ -1351,7 +1518,7 @@ do
end
function Breakables:IsInEquipmentSet(itemId)
if WowVer < 80000 and GetNumEquipmentSets then
if UseNonNativeEqManagerChecks and GetNumEquipmentSets then
for setIdx=1, GetNumEquipmentSets() do
local set = GetEquipmentSetInfo(setIdx)
local itemArray = GetEquipmentSetItemIDs(set)
@ -1416,8 +1583,17 @@ end
function Breakables:BreakableIsDisenchantable(itemType, itemLevel, itemRarity, itemLink, itemId)
for i=1,#DisenchantTypes do
if DisenchantTypes[i] == itemType or IsArtifactRelicItem(itemLink) then
-- temp hack for bfa until disenchant item level scales are identified. and for classic until finding the profession level api
if WowVer >= 80000 or IsClassic or IsClassicBC then
-- bfa+ no longer has skill level requirements for disenchanting
if IgnoreEnchantingSkillLevelForDisenchant then
return true
end
if self.settings.ignoreEnchantingSkillLevel then
return true
end
-- if we couldn't figure out the player's enchanting skill level, err on the side of showing stuff
if self.EnchantingLevel == 0 then
return true
end

View File

@ -1,7 +1,8 @@
## Interface: 90105
## Interface-Retail: 90105
## Interface-Classic: 11401
## Interface-BCC: 20502
## Interface: 100002
## Interface-Retail: 100002
## Interface-Classic: 11403
## Interface-BCC: 20504
## Interface-Wrath: 30400
## Author: Parnic
## Name: Breakables
## Title: Breakables |cff7fff7f-Ace3-|r
@ -16,6 +17,7 @@
## OptionalDeps: Ace3, LibBabble-Inventory-3.0, Masque
## X-Curse-Project-ID: 16629
## X-WoWI-ID: 17929
## X-Wago-ID: rkGrlA6y
#@no-lib-strip@
embeds.xml

3
FUNDING.yml Normal file
View File

@ -0,0 +1,3 @@
github: parnic
ko_fi: parnic
custom: "https://www.paypal.me/parnic"

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 parnic
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,3 +1,56 @@
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.
v1.9.0:
- Handle gaining and losing a Breakable skill without requiring a UI reload
- Update TOC, fix button clicking bug for 10.0
v1.8.7:
- Improve reliability of UI updates after picking lockboxes. There's no good game event for "locked item opened", so this uses some best-guess heuristics to make it function as expected in most cases.
v1.8.6:
- Improve enchanting level detection for Wrath Classic
- Add option to ignore enchanting skill level for showing disenchantable items
v1.8.5:
- Wrath Classic compatibility
- Updated TOCs
v1.8.4:
- Updated TOCs
v1.8.3:
- Updated TOCs, added 9.1 and 9.2 herbs, ore, and lockboxes
v1.8.2:
- Updated TOCs for 9.1.5, Classic, and BCC