diff --git a/data/items.lua b/data/items.lua index b4246dc7..f733a067 100644 --- a/data/items.lua +++ b/data/items.lua @@ -19,6 +19,7 @@ local database = addon:GetModule('Database') local debug = addon:GetModule('Debug') ---@class (exact) ItemData +---@field basic boolean ---@field itemInfo ExpandedItemInfo ---@field containerInfo ContainerItemInfo ---@field questInfo ItemQuestInfo @@ -191,6 +192,7 @@ function items:AttachItemInfo(data) local itemLocation = itemMixin:GetItemLocation() --[[@as ItemLocationMixin]] local bagid, slotid = data.bagid, data.slotid local itemID = C_Container.GetContainerItemID(bagid, slotid) + data.basic = false if itemID == nil then data.isItemEmpty = true data.itemInfo = {} --[[@as table]] @@ -257,6 +259,7 @@ function items:AttachBasicItemInfo(itemID, data) isActive = false, isQuestItem = false, } + data.basic = true data.itemInfo = { itemID = itemID, itemGUID = "", diff --git a/frames/item.lua b/frames/item.lua index 4244aa68..40dbe8a7 100644 --- a/frames/item.lua +++ b/frames/item.lua @@ -150,7 +150,7 @@ function itemFrame.itemProto:UpdateCooldown() end function itemFrame.itemProto:ToggleLock() - if self.data.isItemEmpty then return end + if self.data.isItemEmpty or self.data.basic then return end local itemLocation = ItemLocation:CreateFromBagAndSlot(self.data.bagid, self.data.slotid) if C_Item.IsLocked(itemLocation) then self:Unlock() @@ -160,7 +160,7 @@ function itemFrame.itemProto:ToggleLock() end function itemFrame.itemProto:SetLock(lock) - if self.data.isItemEmpty then return end + if self.data.isItemEmpty or self.data.basic then return end if lock then self:Lock() else @@ -169,7 +169,7 @@ function itemFrame.itemProto:SetLock(lock) end function itemFrame.itemProto:Lock() - if self.data.isItemEmpty then return end + if self.data.isItemEmpty or self.data.basic then return end local itemLocation = ItemLocation:CreateFromBagAndSlot(self.data.bagid, self.data.slotid) C_Item.LockItem(itemLocation) self.data.itemInfo.isLocked = true @@ -180,7 +180,7 @@ function itemFrame.itemProto:Lock() end function itemFrame.itemProto:Unlock() - if self.data.isItemEmpty then return end + if self.data.isItemEmpty or self.data.basic then return end local itemLocation = ItemLocation:CreateFromBagAndSlot(self.data.bagid, self.data.slotid) C_Item.UnlockItem(itemLocation) self.data.itemInfo.isLocked = false