mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
test
This commit is contained in:
@@ -20,7 +20,6 @@ local DeleteCursorItem = DeleteCursorItem
|
||||
local GetContainerItemCooldown = GetContainerItemCooldown
|
||||
local GetContainerItemInfo = GetContainerItemInfo
|
||||
local GetContainerItemLink = GetContainerItemLink
|
||||
local GetContainerNumFreeSlots = GetContainerNumFreeSlots
|
||||
local GetContainerNumSlots = GetContainerNumSlots
|
||||
local GetItemInfo = GetItemInfo
|
||||
local GetItemQualityColor = GetItemQualityColor
|
||||
@@ -49,13 +48,11 @@ local SEARCH = SEARCH
|
||||
local SEARCH_STRING = ""
|
||||
|
||||
B.ProfessionColors = {
|
||||
["0x0008"] = {224/255, 187/255, 74/255}, -- Leatherworking
|
||||
["0x0010"] = {74/255, 77/255, 224/255}, -- Inscription
|
||||
["0x0020"] = {18/255, 181/255, 32/255}, -- Herbs
|
||||
["0x0040"] = {160/255, 3/255, 168/255}, -- Enchanting
|
||||
["0x0080"] = {232/255, 118/255, 46/255}, -- Engineering
|
||||
["0x0400"] = {105/255, 79/255, 7/255}, -- Mining
|
||||
["0x010000"] = {222/255, 13/255, 65/255} -- Cooking
|
||||
["8"] = {224/255, 187/255, 74/255}, -- Leatherworking
|
||||
["16"] = {18/255, 181/255, 32/255}, -- Herbs
|
||||
["32"] = {160/255, 3/255, 168/255}, -- Enchanting
|
||||
["64"] = {232/255, 118/255, 46/255}, -- Engineering
|
||||
["128"] = {105/255, 79/255, 7/255}, -- Mining
|
||||
}
|
||||
|
||||
function B:GetContainerFrame(arg)
|
||||
@@ -234,7 +231,7 @@ function B:UpdateSlot(bagID, slotID)
|
||||
if (self.Bags[bagID] and self.Bags[bagID].numSlots ~= GetContainerNumSlots(bagID)) or not self.Bags[bagID] or not self.Bags[bagID][slotID] then return end
|
||||
|
||||
local slot = self.Bags[bagID][slotID]
|
||||
local bagType = self.Bags[bagID].type
|
||||
local bagType = tostring(self.Bags[bagID].type)
|
||||
local texture, count, locked = GetContainerItemInfo(bagID, slotID)
|
||||
local clink = GetContainerItemLink(bagID, slotID)
|
||||
|
||||
@@ -452,11 +449,10 @@ function B:Layout(isBank)
|
||||
end
|
||||
|
||||
f.Bags[bagID].numSlots = numSlots
|
||||
|
||||
local link = GetInventoryItemLink("player", ContainerIDToInventoryID(bagID))
|
||||
if link then
|
||||
local _, _, id = strfind(link, "item:(%d+)")
|
||||
f.Bags[bagID].type = select(6, GetItemInfo(id))
|
||||
f.Bags[bagID].type = GetItemFamily(id)
|
||||
end
|
||||
|
||||
--Hide unused slots
|
||||
|
||||
@@ -362,31 +362,6 @@ function B:ScanBags()
|
||||
end
|
||||
end
|
||||
|
||||
local bagTypes = {
|
||||
["Bag"] = 0,
|
||||
["Quiver"] = 1,
|
||||
["Ammo Pouch"] = 2,
|
||||
["Soul Bag"] = 4,
|
||||
["Leatherworking Bag"] = 8,
|
||||
["Herb Bag"] = 16,
|
||||
["Enchanting Bag"] = 32,
|
||||
["Engineering Bag"] = 64,
|
||||
["Mining Bag"] = 128
|
||||
}
|
||||
|
||||
local function GetItemFamily(bag)
|
||||
local bagID = match(bag, "item:(%d+)")
|
||||
local itemType
|
||||
if bagID then
|
||||
itemType = select(6, GetItemInfo(bagID))
|
||||
if itemType then
|
||||
return tonumber(bagTypes[itemType])
|
||||
end
|
||||
end
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
function B:IsSpecialtyBag(bagID)
|
||||
if safe[bagID] then return false end
|
||||
|
||||
@@ -396,7 +371,7 @@ function B:IsSpecialtyBag(bagID)
|
||||
local bag = GetInventoryItemLink("player", inventorySlot)
|
||||
if not bag then return false end
|
||||
|
||||
local family = GetItemFamily(bag)
|
||||
local family = GetItemFamily(match(bag, "item:(%d+)"))
|
||||
if family == 0 or family == nil then return false end
|
||||
|
||||
return family
|
||||
@@ -404,14 +379,14 @@ end
|
||||
|
||||
function B:CanItemGoInBag(bag, slot, targetBag)
|
||||
local item = bagIDs[B:Encode_BagSlot(bag, slot)]
|
||||
local itemFamily = GetItemFamily(item)
|
||||
local itemFamily = GetItemFamily(match(item, "item:(%d+)"))
|
||||
if itemFamily then
|
||||
local equipSlot = select(8, GetItemInfo(item))
|
||||
if equipSlot == "INVTYPE_BAG" then
|
||||
itemFamily = 1
|
||||
end
|
||||
end
|
||||
local bagFamily = GetItemFamily(targetBag)
|
||||
local bagFamily = GetItemFamily(match(targetBag, "item:(%d+)"))
|
||||
if itemFamily then
|
||||
return (bagFamily == 0) or band(itemFamily, bagFamily) > 0
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user