View Single Post
12-30-14, 11:49 AM   #5
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
This is what I use to black out everything I can't mail when I open the mailbox..
Lua Code:
  1. local tip = CreateFrame('GameTooltip', 'MailBagScantip', nil, 'GameTooltipTemplate')
  2. hooksecurefunc('ContainerFrame_Update', function(frame)
  3.     local name, bag = frame:GetName(), frame:GetID()
  4.     for j = 1, frame.size do
  5.         local itemButton = _G[name .. 'Item' .. j]
  6.         local slot = itemButton:GetID()
  7.         tip:SetOwner(UIParent,'ANCHOR_NONE')
  8.         tip:SetBagItem(bag, slot)
  9.        
  10.         if SendMailFrame:IsVisible() then      
  11.             for t = 1, tip:NumLines() do
  12.                 local str = _G['MailBagScantipTextLeft' .. t]
  13.                 if str and (str:GetText() == ITEM_SOULBOUND or str:GetText() == ITEM_BIND_QUEST) then
  14.                     itemButton.searchOverlay:Show()
  15.                     break
  16.                 end
  17.             end
  18.         --else
  19.         --  itemButton.searchOverlay:Hide() -- execute this somewhere else when the mailframe closes
  20.         end
  21.     end
  22. end)

This is for the default interface but you can probably adapt it for whatever.

Last edited by semlar : 12-30-14 at 11:52 AM.
  Reply With Quote