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,968
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 ..
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  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: 126
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,968
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. )
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818

Last edited by Xrystal : 08-07-20 at 09:27 AM.
  Reply With Quote
02-23-24, 01:03 AM   #4
AmmaMut
A Kobold Labourer
Join Date: Feb 2024
Posts: 1
How can I successfully hook into the HelpTip framepool and access the acquired frame to rearrange the arrow as shown in the provided Lua code?
__________________
  Reply With Quote
02-23-24, 04:27 AM   #5
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,968
That I haven't been able to do since Dragonflight came out. Their code keeps resetting it to what they want. The code I posted worked for me in Shadowlands but not Dragonflight. Which is awkward as nUI usually has the micro buttons at the top of the screen.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
04-19-24, 06:47 PM   #6
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,968
Just in case you didn't figure it out already
appears they changed the parameters
This now works with nUI's top of the screen micromenu with the HelpTip showing below pointing up.
As you can see in my case I test for the system to work with the ones I need to change.
You might have to debug your way through to identify what system you are interested in.

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


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
04-19-24, 09:16 PM   #7
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,336
Something I noticed is HelpTip:Show() calls HelpTipTemplateMixin:Init() on the acquired frame.

Lua Code:
  1. hooksecurefunc(HelpTipTemplateMixin,"Init",function(self,parent,info,relregion)
  2.     if info.system=="MicroButtons" then
  3.         info.targetPoint=HelpTip.Point.BottomEdgeCenter;
  4.         self:AnchorAndRotate();
  5.     end
  6. end);

This hooks into the initialization of the acquired frame. HelpTipTemplateMixin:AnchorAndRotate() is called again as it's in charge of applying the setting. This is called from HelpTipTemplateMixin:OnUpdate(), but that's only registered to run in specific circumstances.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  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