View Single Post
12-15-23, 10:23 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,894
Somethng to start with.

Place a button that looks like the keyring button in the TOPLEFT of the screen:
Lua Code:
  1. -- Create the frame
  2. local frame = CreateFrame("Button", nil, UIParent)
  3. frame.Texture = frame:CreateTexture()
  4. frame.Texture:SetAllPoints()
  5. frame.Texture:SetTexture("Interface\\Buttons\\UI-Button-KeyRing")
  6. frame:SetSize(40, 40)
  7. frame:SetPoint("TOPLEFT", 5, -5)
  8. frame:RegisterForClicks("RightButtonDown")
  9. frame:SetScript("OnClick", function(self, button, down)
  10.     print(format("Shift Key is: %s!", IsLeftShiftKeyDown() and "DOWN" or "UP"))
  11.     if IsLeftShiftKeyDown() then
  12.         print(format("Bank is: %s!", self.isBankOpen and "OPEN" or "CLOSED"))
  13.     end
  14. end)
  15. frame:RegisterEvent("BANKFRAME_OPENED")
  16. frame:RegisterEvent("BANKFRAME_CLOSED")
  17. frame:SetScript("OnEvent", function(self, event)
  18.     if event == "BANKFRAME_OPENED" then
  19.         self.isBankOpen = true
  20.     else
  21.         self.isBankOpen = false
  22.     end
  23. end)

This won't do anything with information about bank items as they are their own separate buttons and it depends on what information you want and what you want to do with it as the buttons are already placing the items on the cursor or opening the stack count selector.
__________________
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 10:34 PM.
  Reply With Quote