View Single Post
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,892
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