Add bag glow (that doesn't work)

This commit is contained in:
M. David
2022-08-23 18:30:07 +02:00
parent b0efa87221
commit b23ed6cd31
5 changed files with 63 additions and 1 deletions

View File

@@ -0,0 +1,4 @@
-- BAG_UPDATE
function(e)
aura_env.update()
end

View File

@@ -0,0 +1,30 @@
local function getItemLink(container, slot)
return select(7, GetContainerItemInfo(container, slot)) or ""
end
local function getBindType(container, slot)
return select(14, GetItemInfo(getItemLink(container, slot))) or 0
end
local function isBoe(container, slot)
return getBindType(container, slot) == 1
end
local showGlow = function(container, slot)
ActionButton_ShowOverlayGlow(_G["ElvUI_ContainerFrameBag" .. container .. "Slot" .. slot])
end
local hideGlow = function(container, slot)
ActionButton_HideOverlayGlow(_G["ElvUI_ContainerFrameBag" .. container .. "Slot" .. slot])
end
aura_env.update = function()
for container = 0, 4 do
for slot = 1, GetContainerNumSlots(container) do
print(C_Item.IsBound(ItemLocation:CreateFromBagAndSlot(container, slot)))
if isBoe(container, slot) then
showGlow(container, slot)
else
hideGlow(container, slot)
end
end
end
end

View File

@@ -0,0 +1,18 @@
Haven't found a way of determining whether an item is soulbound or not without tooltip scanning which I don't want to do
local cTip = CreateFrame("GameTooltip","PrivTooltip",nil,"GameTooltipTemplate")
local function IsSoulbound(bag, slot)
cTip:SetOwner(UIParent, "ANCHOR_NONE")
cTip:SetBagItem(bag, slot)
cTip:Show()
for i = 1,cTip:NumLines() do
if(_G[name.."TooltipTextLeft"..i]:GetText()==ITEM_SOULBOUND) then
cTip:Hide()
return true
end
end
cTip:Hide()
return false
end
Some guy says this is good

File diff suppressed because one or more lines are too long

View File

@@ -18,6 +18,13 @@ PlayerController = {
end,
getPlayers = function(self)
end,
process = function(guid)
if (self.nearbyPlayers[guid] == nil) then
self.addPlayer(guid)
else
end
end
}
@@ -77,5 +84,7 @@ function PlayerInfo:New(guid)
return o
end
aura_env.processEvent = function(allstates, caster, target)
aura_env.processEvent = function(caster, target)
PlayerController:process(caster)
PlayerController:process(target)
end