mirror of
https://github.com/parnic/breakables.git
synced 2025-06-17 01:41:51 -05:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
016cc6f226
|
|||
f71b527f71
|
|||
a65674510e
|
|||
41592a7c76
|
|||
62c8db483e
|
|||
abf769bf9d
|
|||
9bd5541f81
|
|||
80e495f707
|
|||
3257ce5645
|
5
.github/workflows/release.yml
vendored
5
.github/workflows/release.yml
vendored
@ -48,3 +48,8 @@ jobs:
|
||||
uses: BigWigsMods/packager@master
|
||||
with:
|
||||
args: -g bcc -w 0
|
||||
|
||||
- name: Package and release for Wrath
|
||||
uses: BigWigsMods/packager@master
|
||||
with:
|
||||
args: -g wrath -w 0
|
||||
|
107
Breakables.lua
107
Breakables.lua
@ -13,8 +13,32 @@ if not IsArtifactRelicItem then
|
||||
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"]
|
||||
@ -219,6 +243,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
|
||||
@ -237,6 +262,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 = {
|
||||
@ -388,12 +417,12 @@ function Breakables:RegisterEvents()
|
||||
|
||||
self:RegisterEvent("MODIFIER_STATE_CHANGED", "FindBreakables")
|
||||
|
||||
if CanDisenchant and WowVer < 80000 then
|
||||
if CanDisenchant and ShouldHookTradeskillUpdate then
|
||||
self:RegisterEvent("TRADE_SKILL_UPDATE", "OnTradeSkillUpdate")
|
||||
end
|
||||
|
||||
if CanPickLock then
|
||||
self:RegisterEvent("CHAT_MSG_OPENING", "OnBagItemLockPicked")
|
||||
self:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED", "OnSpellCastSucceeded")
|
||||
end
|
||||
|
||||
if UnitCanPetBattle then
|
||||
@ -464,8 +493,16 @@ function Breakables:OnTradeSkillUpdate()
|
||||
self:FindBreakables()
|
||||
end
|
||||
|
||||
function Breakables:OnBagItemLockPicked()
|
||||
function Breakables:OnSpellCastSucceeded(evt, unit, guid, spell)
|
||||
if spell ~= PickLockId then
|
||||
return
|
||||
end
|
||||
|
||||
self.justPickedBag = self.justClickedBag
|
||||
self.justPickedSlot = self.justClickedSlot
|
||||
|
||||
self:FindBreakables()
|
||||
nextCheck[0] = GetTime() + PickLockFinishedDelay
|
||||
end
|
||||
|
||||
function Breakables:PetBattleStarted()
|
||||
@ -498,6 +535,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
|
||||
|
||||
@ -761,7 +806,7 @@ function Breakables:GetOptions()
|
||||
order = 21,
|
||||
}
|
||||
end
|
||||
if WowVer >= 80000 then
|
||||
if ShouldShowTabardControls then
|
||||
opts.args.hideTabards = {
|
||||
type = "toggle",
|
||||
name = L["Hide Tabards"],
|
||||
@ -779,6 +824,25 @@ function Breakables:GetOptions()
|
||||
order = 22,
|
||||
}
|
||||
end
|
||||
|
||||
if not IgnoreEnchantingSkillLevelForDisenchant then
|
||||
opts.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,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
if UnitCanPetBattle then
|
||||
@ -1161,6 +1225,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
|
||||
@ -1174,12 +1241,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
|
||||
@ -1355,7 +1427,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)
|
||||
@ -1420,8 +1492,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
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
## Interface: 90205
|
||||
## Interface-Retail: 90205
|
||||
## Interface: 90207
|
||||
## Interface-Retail: 90207
|
||||
## Interface-Classic: 11403
|
||||
## Interface-BCC: 20504
|
||||
## Interface-Wrath: 30400
|
||||
## Author: Parnic
|
||||
## Name: Breakables
|
||||
## Title: Breakables |cff7fff7f-Ace3-|r
|
||||
|
@ -1,3 +1,17 @@
|
||||
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
|
||||
|
Reference in New Issue
Block a user