Skip to content

Commit

Permalink
Fixing an issue with Lockpicking. (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
cont1nuity committed Oct 11, 2024
1 parent 033e0ed commit 3ffc43d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions nop-button.lua
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ function NOP:ButtonShow() -- display button
bt:SetAttribute("spell", bt.mspell)
bt:SetAttribute("item", bt.mtarget) -- ("bag slot")
bt:SetAttribute("target-item", bt.mtargetitem) -- ("bag slot")
if bt.mspell then
bt:SetAttribute("target-bag", bt.bagID)
bt:SetAttribute("target-slot", bt.slotID)
end
self:Verbose("ButtonShow:",self:CompressText(bt.mtype),bt.mspell and self:CompressText(bt.mspell),bt.mtarget and self:CompressText("item: " .. bt.mtarget),bt.mtargetitem and self:CompressText("target-item: " .. bt.mtargetitem))
else
--bt:SetAttribute("macrotext1", nil)
Expand Down
2 changes: 1 addition & 1 deletion nop-core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ local GetMinimapZoneText = _G.GetMinimapZoneText; assert(GetMinimapZoneText ~= n
local GetNumArchaeologyRaces = _G.GetNumArchaeologyRaces; assert(GetNumArchaeologyRaces ~= nil,'GetNumArchaeologyRaces')
local GetNumFactions = _G.GetNumFactions or _G.C_Reputation.GetNumFactions; assert(GetNumFactions ~= nil,'GetNumFactions')
local GetSpellCooldown = _G.GetSpellCooldown or _G.C_Spell.GetSpellCooldown; assert(GetSpellCooldown ~= nil,'GetSpellCooldown')
local GetSpellInfo = _G.GetSpellInfo or _G.C_Spell.GetSpellInfo; assert(GetSpellInfo ~= nil,'GetSpellInfo')
local GetSpellInfo = _G.GetSpellInfo or _G.C_Spell.GetSpellName; assert(GetSpellInfo ~= nil,'GetSpellInfo') -- intentionally use GetSpellName here, as that is what we use later
local GetTime = _G.GetTime; assert(GetTime ~= nil,'GetTime')
local gsub = _G.gsub; assert(gsub ~= nil,'gsub')
local InCombatLockdown = _G.InCombatLockdown; assert(InCombatLockdown ~= nil,'InCombatLockdown')
Expand Down
7 changes: 5 additions & 2 deletions nop-item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ function NOP:ItemShow(itemID,prio) -- add item to button
local mtarget = format("item:%d", itemID)
--local mtarget = format("%d %d", bagID, slotID)
local mtargetitem = nil
local mtargetbag = nil
local mtartgetslot = nil
local mtype = "item"
local mspell = nil
if T_PICK[itemID] then -- item has picklock in tooltip
Expand All @@ -398,7 +400,8 @@ function NOP:ItemShow(itemID,prio) -- add item to button
mtype = "spell"
mspell = self.pickLockSpell
mtarget = nil
mtargetitem = format("item:%d", itemID) --format("%d %d" ,bagID,slotID) -- this one needs unlock
--mtargetitem = format("item:%d", itemID) --format("%d %d" ,bagID,slotID) -- this one needs unlock
mtargetitem = nil
else
T_PICK[itemID] = nil -- it not require lockpick anymore
end
Expand All @@ -410,7 +413,7 @@ function NOP:ItemShow(itemID,prio) -- add item to button
mtarget = nil
mtargetitem = format("item:%d", itemID) --format("%d %d" ,bagID,slotID) -- disenchant this
end
if (bt.itemCount ~= itemCount) or (bt.itemID ~= itemID) or (bt.isGlow ~= isGlow) or (bt.mtext ~= mtext) or (bt.mtype ~= mtype) or (bt.mspell ~= mspell) or (bt.mtarget ~= mtarget) or (bt.mtargetitem ~= mtargetitem) then
if (bt.itemCount ~= itemCount) or (bt.itemID ~= itemID) or (bt.isGlow ~= isGlow) or (bt.mtext ~= mtext) or (bt.mtype ~= mtype) or (bt.mspell ~= mspell) or (bt.mtarget ~= mtarget) or (bt.mtargetitem ~= mtargetitem) or (bt.bagID ~= bagID) or (bt.slotID ~= slotID) then
bt.prio = prio
bt.showID = itemID
bt.itemID = itemID
Expand Down
2 changes: 1 addition & 1 deletion nop-slash.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ local GetContainerItemID = _G.GetContainerItemID or C_Container.GetContainerItem
local GetContainerItemLink = _G.GetContainerItemLink or C_Container.GetContainerItemLink; assert(GetContainerItemLink ~= nil,'GetContainerItemLink')
local GetContainerNumSlots = _G.GetContainerNumSlots or C_Container.GetContainerNumSlots; assert(GetContainerNumSlots ~= nil,'GetContainerNumSlots')
local GetItemInfo = _G.GetItemInfo or _G.C_Item.GetItemInfo; assert(GetItemInfo ~= nil,'GetItemInfo')
local GetSpellInfo = _G.GetSpellInfo or _G.C_Spell.GetSpellInfo; assert(GetSpellInfo ~= nil,'GetSpellInfo')
local GetSpellInfo = _G.GetSpellInfo or _G.C_Spell.GetSpellName; assert(GetSpellInfo ~= nil,'GetSpellInfo') -- intentionally use GetSpellName here, as that is what we use later
local GetTime = _G.GetTime; assert(GetTime ~= nil,'GetTime')
local issecurevariable = _G.issecurevariable; assert(issecurevariable ~= nil,'issecurevariable')
local math = _G.math; assert(math ~= nil,'math')
Expand Down

0 comments on commit 3ffc43d

Please sign in to comment.