WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   NPE_PointerFrame (https://www.wowinterface.com/forums/showthread.php?t=58572)

Platine 01-31-21 04:14 AM

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)


Rilgamon 01-31-21 04:19 AM

Perhaps you can listen to ADDON_LOADED for Blizzard_NewPlayerExperience? Not sure if it is loaded as an addon ;)

Xrystal 01-31-21 06:08 AM

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

Platine 02-05-21 07:55 AM

This object is not pinned only to MicroButtons.




Ketho 02-05-21 08:03 AM

What are you trying to do. What is your goal?

Xrystal 02-05-21 08:28 AM

Quote:

Originally Posted by Platine (Post 338430)
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.


All times are GMT -6. The time now is 11:40 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI