Quantcast
hooksecurefunc framepools ... is it possible? - WoWInterface
Thread Tools Display Modes
08-06-20, 04:50 PM   #1
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,493
hooksecurefunc framepools ... is it possible?

Another nUI one here, but it's not exactly a Beta issue as the functionality I need to access was set up in 8.3.

You know the alter window that pops up on your micro buttons ? Well, nUI has these buttons at the top of the screen meaning that this pop up is off the screen..

Now, before I managed to hook into a function and tell it to rearrange if the buttons are at the top of the screen.

Lua Code:
  1. hooksecurefunc(
  2.     "MainMenuMicroButton_PositionAlert",
  3.     function(alert)
  4.         if ( alert.MicroButton:GetRight() + (alert:GetWidth() / 2) > UIParent:GetRight() ) then
  5.             alert:ClearAllPoints();
  6.             alert:SetPoint("TOPRIGHT", alert.MicroButton, "BOTTOMRIGHT", 16, -20);
  7.             alert.Arrow:ClearAllPoints();
  8.             alert.Arrow:SetPoint("BOTTOMRIGHT", alert, "TOPRIGHT", -4, -4);
  9.         else
  10.             alert:ClearAllPoints();
  11.             alert:SetPoint("TOP", alert.MicroButton, "BOTTOM", 0, -20);
  12.             alert.Arrow:ClearAllPoints();
  13.             alert.Arrow:SetPoint("BOTTOM", alert, "TOP", 0, -4);
  14.         end    
  15.     end
  16. )

Now the new system appears to make it somewhat easier ..
https://www.townlong-yak.com/framexml/beta/HelpTip.lua
https://www.townlong-yak.com/framexm...croButtons.lua

Which means, all I need to do is somehow hook into the help tip info to rearrange the arrow like this :

Lua Code:
  1. hooksecurefunc(HelpTip,"Show",
  2.     function(parent,info,button)        
  3.         info.targetPoint = HelpTip.Point.BottomEdgeCenter
  4.     end
  5. )

Unfortunately HelpTip is now a framepool and I can't seem to figure out how to get access to the frame just acquired and shown so that I can rearrange the arrow.

I've tried googling and searching the forums but no one seems to have asked the question before. Any help is appreciated ..
__________________
  Reply With Quote
08-06-20, 09:10 PM   #2
siweia
A Flamescale Wyrmkin
 
siweia's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2011
Posts: 122
Lua Code:
  1. hooksecurefunc(HelpTip, "Show", function(self)
  2.     for frame in self.framePool:EnumerateActive() do
  3.         -- do what you need to do
  4.     end
  5. end)
  Reply With Quote
08-07-20, 09:16 AM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,493
I'll give that a go .. it looked like Show had more options.

Will let you know how it pans out.

Thanks .. it worked perfectly.

Success:

For those with similar issues ...
This worked for me .. during the helptips onupdate routine it checks to see if any of the info values have changed and updates accordingly. From what I understand anyway.

Lua Code:
  1. hooksecurefunc(HelpTip,"Show",
  2.     function(self)
  3.         for frame in self.framePool:EnumerateActive() do
  4.             if frame.info.system == "MicroButtons" then
  5.                 frame.info.targetPoint = HelpTip.Point.BottomEdgeCenter
  6.             end
  7.         end
  8.     end
  9. )
__________________

Last edited by Xrystal : 08-07-20 at 09:27 AM.
  Reply With Quote

WoWInterface » PTR » PTR API and Graphics Changes » hooksecurefunc framepools ... is it possible?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off