DurabilityFrame SetPoint Hook to reparent
So, previous in 4.3 I was using a simple hooksecurefunc to "SetPoint" for the DurabilityFrame to allow me to set a custom point for the frame.
For some reason unknown to me this method no longer works and there has been 0 changes to the durability frame. My Code: Lua Code:
Can anyone point me as to what is preventing me from updating the point correctly? Edit: Just to make this clear, the function UpdatePoint() is getting called and my global table insert is just to make sure it gets called again after my addon is loaded. |
If you add print() debugs. Does the function get called twice on loadup like you say?
Is the parent element still the MinimapCluster? If I do Lua Code:
If I had to do sth like this the first thing I do is to get the latest FrameXML files. I then use TotalCommander (Windows) and to a text-search (Alt+F7) in the FrameXML folder for the string "DurabilityFrame". The only occurence of DurabilityFrame:SetPoint is in UIParent.lua. |
Quote:
Edit: DurabilityFrame.lua also has a few lines of SetPoint without a parent frame labeled, also Minimap is the parent for the frame in the DurabilityFrame.xml which still seems strange that UIParent is being set. Edit 2: I have 010 Editor (total boss text / hex editor) |
In my FrameXML\DurabilityFrame.xml the parent is UIParent.
https://github.com/Ketho/wow-ui-sour...tyFrame.xml#L4 Have you tried: Lua Code:
In the XML at the bottom the frame position manager is called "OnShow". Setting the ignore value may help. Additionally enabling SetUserPlaced(true), SetMovable(true) can help sometimes too. |
Quote:
Still doesn't let me change its point. I'm really clueless at this point as to what is preventing it's placement from changing. Lua Code:
|
This works for me:
Lua Code:
|
Quote:
Interesting that you'd have to go that route to be able to place it in a different location. Is there some handling of the Minimap children I'm not aware of? |
No your problem is the condition inside the hook function. Just print all the ... variables and you will find out why. You don't need another surrounding frame. You just have to fix the condition. Make sure not to get into a loophole.
Lua Code:
|
Quote:
|
There seem to be an awful lot of threads popping up recently about moving the DurabilityFrame... why don't you guys just look at addons that already do it successfully (SmoothDurability, for one), instead of trying to reinvent the wheel? It took me about 90 seconds (at most) of looking at its code to figure out how to move the frame...
|
Quote:
|
Can you post your final code?
|
Quote:
Lua Code:
Edit: I had to wrap this into a frame and run the hook after "PLAYER_ENTERING_WORLD" to prevent some strange WoW client crash. |
All times are GMT -6. The time now is 05:26 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI