View Single Post
12-15-23, 11:11 PM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,892
Maybe this as a starting point to print the item hyperlink if the bank is open and left shift key is down (doesn't discrimiate the container the clicked item is in but you should be able to determine that using self:GetParent():GetID() as that should be the parent bag/bank slot id.):
Lua Code:
  1. local isBankOpen = false
  2. local function ItemHook(self, button)
  3.     if isBankOpen and IsLeftShiftKeyDown() then
  4.         print(C_Container.GetContainerItemInfo(self:GetParent():GetID(), self:GetID()).hyperlink)
  5.     end
  6. end
  7. local frame = CreateFrame("Frame")
  8. frame:RegisterEvent("BANKFRAME_OPENED")
  9. frame:RegisterEvent("BANKFRAME_CLOSED")
  10. frame:SetScript("OnEvent", function(self, event)
  11.     if event == "BANKFRAME_OPENED" then
  12.         isBankOpen = true
  13.     else
  14.         isBankOpen = false
  15.     end
  16. end)
  17.  
  18. hooksecurefunc("ContainerFrameItemButton_OnClick", ItemHook)
  19. hooksecurefunc("ContainerFrameItemButton_OnModifiedClick", ItemHook)

This primarily hooks the functions called by the Blizzard item slots depending on modified state (so maybe you only need one?)
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 12-15-23 at 11:17 PM.
  Reply With Quote