WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   PTR API and Graphics Changes (https://www.wowinterface.com/forums/forumdisplay.php?f=175)
-   -   hooksecurefunc framepools ... is it possible? (https://www.wowinterface.com/forums/showthread.php?t=58137)

Xrystal 08-06-20 04:50 PM

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 ..

siweia 08-06-20 09:10 PM

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)

Xrystal 08-07-20 09:16 AM

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. )


All times are GMT -6. The time now is 07:35 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI