Providing mouseover highlighting
So, thought I'd ask people's thoughts on good ways to provide mouseover highlighting for various frames.
To start with, initially I was using the HIGHLIGHT layer of the unitframe itself. The problem with this was that any frames created on top of the unitframe (like, say, a health bar) would cover it, and I couldn't figure out a way to push the highlight texture higher up without SetFrameLevel. This seemed pretty hackish though and I noticed that if I tried to SetFrameLevel the unitframe itself I was getting taint issues. I guess maybe that function is protected to stop people stacking frames in the same visual space and using the frame level to determine which one is clicked? I'm no expert on this or anything, so I don't really know. Presumably just using SetFrameLevel on the health bars would be okay, but it's still pretty ugly. So moving on to attempting a more "manual" solution, I'm currently just manually creating a new frame to hold the highlight texture. Code is as follows: Code:
---- Highlight I don't know if it even makes sense to try hooking the original functions instead, in order to keep it untainted, but even if it did make sense I don't know how to do that considering hooksecurefunc takes a string argument and all I know how to get is a reference. But even more generally, I was wondering if anybody had experience doing this themselves and what techniques etc. they used. Thoughts/opinions/etc. welcome. |
You can use frame:HookScript("scripttype", function) to securely hook an already existing script:
Code:
self:HookScript("OnEnter", function(self, ...) self.Highlight:Show() end) |
Quote:
|
I do it a bit simpler in my raid layout.
http://github.com/p3lim/ouf_mini/blo...8/oUF_Mini.lua You can add the show/hide directly into a function, because you set the scripts yourself anyways. |
All times are GMT -6. The time now is 12:08 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI