Thread Tools Display Modes
01-31-21, 04:14 AM   #1
Platine
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 72
NPE_PointerFrame

Hello, how to detect the opening of a NPE_PointerFrame window?
Normally, the object NPE_PointerFrame or NPE_PointerFrame_1 is not available (nil).

NPE_PointerFrame:HookScript("OnShow", MyFunction) not work (nil)


Last edited by Platine : 01-31-21 at 04:17 AM.
  Reply With Quote
01-31-21, 04:19 AM   #2
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
Perhaps you can listen to ADDON_LOADED for Blizzard_NewPlayerExperience? Not sure if it is loaded as an addon
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
01-31-21, 06:08 AM   #3
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
Is it possible that it is a part of the MicroMenu Help System and not just the New Player Experience. That frame appears when you get a new item added to your collection ...

Anyway, in nUI I needed to flip the arrow from the bottom pointing down to the top pointing up as nUI has the micromenu at the top of the screen. This is the code I used to do that.

Whether it will help you or not I don't know. But thought I would suggest it in case it does.

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

This was identified via the following Blizzard codeblock in ( https://www.townlong-yak.com/framexm...croButtons.lua )
Lua Code:
  1. function MainMenuMicroButton_ShowAlert(microButton, text, tutorialIndex, cvarBitfield)
  2.     if not MainMenuMicroButton_AreAlertsEnabled() then
  3.         return false;
  4.     end
  5.     if g_acknowledgedMicroButtonAlerts[microButton] then
  6.         return false;
  7.     end
  8.     cvarBitfield = cvarBitfield or "closedInfoFrames";
  9.     if tutorialIndex and GetCVarBitfield(cvarBitfield, tutorialIndex) then
  10.         return false;
  11.     end
  12.     if g_activeMicroButtonAlert then
  13.         local visiblePriority = MainMenuMicroButton_GetAlertPriority(g_activeMicroButtonAlert);
  14.         local thisPriority = MainMenuMicroButton_GetAlertPriority(microButton);
  15.         if visiblePriority < thisPriority then
  16.             -- Higher priority is shown
  17.             return false;
  18.         else
  19.             -- Lower priority alert is visible, kill it
  20.             g_processAlertCloseCallback = false;
  21.             HelpTip:HideAllSystem("MicroButtons");
  22.             g_processAlertCloseCallback = true;
  23.         end
  24.     end
  25.     local helpTipInfo = {
  26.         text = text,
  27.         buttonStyle = HelpTip.ButtonStyle.Close,
  28.         targetPoint = HelpTip.Point.TopEdgeCenter,
  29.         system = "MicroButtons",
  30.         onHideCallback = MainMenuMicroButton_OnAlertClose,
  31.         callbackArg = microButton,
  32.         autoHorizontalSlide = true,
  33.     };
  34.     if tutorialIndex then
  35.         helpTipInfo.cvarBitfield = cvarBitfield;
  36.         helpTipInfo.bitfieldFlag = tutorialIndex;
  37.     end
  38.     if HelpTip:Show(UIParent, helpTipInfo, microButton) then
  39.         g_activeMicroButtonAlert = microButton;
  40.     end
  41.     return true;
  42. end
__________________
  Reply With Quote
02-05-21, 07:55 AM   #4
Platine
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Dec 2010
Posts: 72
This object is not pinned only to MicroButtons.



  Reply With Quote
02-05-21, 08:03 AM   #5
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
What are you trying to do. What is your goal?
  Reply With Quote
02-05-21, 08:28 AM   #6
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,892
Originally Posted by Platine View Post
This object is not pinned only to MicroButtons.



Next thought ..

https://www.townlong-yak.com/framexm...interFrame.xml

The layout of the PointerFrame appears to be the same as what you are showing and is part of the New Player Experience.

Looking at the lua code for it .. it works in a similar way to the Help System and you need to access it via the frame pool system my code demonstrated..
https://www.townlong-yak.com/framexm...interFrame.lua
Lua Code:
  1. function NPE_TutorialPointerFrame:_GetFrame(parentFrame)
  2.     local frame;
  3.     if (#self.FramePool > 0) then
  4.         frame = table.remove(self.FramePool);
  5.     else
  6.         self.FrameCount = self.FrameCount + 1;
  7.         frame = CreateFrame("frame", "NPE_PointerFrame_" .. self.FrameCount, UIParent, "TutorialPointerFrame");
  8.     end
  9.     if (not parentFrame.hasHookedScriptsForNPE) then
  10.         parentFrame:HookScript("OnShow", function (self)
  11.             if (self.currentNPEPointer) then
  12.                 self.currentNPEPointer:Show();
  13.             end
  14.         end);
  15.         parentFrame:HookScript("OnHide", function (self)
  16.             if (self.currentNPEPointer) then
  17.                 self.currentNPEPointer:Hide();
  18.             end
  19.         end);
  20.         parentFrame.hasHookedScriptsForNPE = true;
  21.     end
  22.     parentFrame.currentNPEPointer = frame;
  23.     frame.currentTarget = parentFrame;
  24.     return frame;
  25. end


Instead of HelpTip in my example try NPE_TutorialPointerFrame and put a message in the for loop instead of my code to see if it displays.
__________________
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » NPE_PointerFrame

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