Disabling Player Unit Frame's Autofading
When leaving combat, the player unit frame quickly fades to about 0.5 alpha and then completely fades out a few seconds later. It's then unlinked from the player and can be used for other units' name plates.
I've been trying to figure out a way to prevent it from fading at all. At first I thought I could hijack the NAME_PLATE_UNIT_REMOVED event to avoid a call to OnNamePlateRemoved() in Blizzard_NamePlates.lua but that didn't have the effect I wanted. I also tried messing with UIFadeIn() and UIFadeOut() but it seems to be fading using some other method. I also thought it was being added to the AddToAutoHide() list, so I set the UnitFrameXNamePlate.disableMouse=false but the Frame faded even while my cursor was hovering over it. Any thoughts on how to keep the unit frame visible? I'd prefer to use the built-in frame rather than remake my own. |
If you are talking about the new Player Resource Bar (mini HUD) you would be better getting something like IceHud.
|
I've been trying to find out how the personal resource display works.
But I just can't find anything to do with the alpha, or on what events it starts fading out :confused: Lua Code:
|
Yes, same problem here. I'm able to change it to show all character buffs, move the buffs, I can change its position, and increase scale of the various bars/combo points. But the fading is a mystery.
Much of the fading seems triggered by PLAYER_REGEN_ENABLE and PLAYER_REGEN_DISABLE but it also fades in if the character is out of combat and completes a heal on itself. What event is that? At any rate I've scoured the codebase for uses of those two REGEN events but none seem to be our culprit. EDIT: at one point I thought the out-of-combat heal event was even triggered by certain COMBAT_TEXT_UPDATE events but that would just be silly. |
Find the frame, hook it's SetAlpha and override it.
|
I'll give that a try when I'm back home. I had tried to do that originally but thinking back it's likely I was only hooking the SetAlpha of a child frame.
Somewhat related, has anyone found where namePlateUnitTokens are assigned/removed from UnitIDs? For instance what changes to make UnitIsUnit("player",UnitToken) return true? |
Quote:
For instance, let's say you have the player name plate. Code:
local namePlate=C_NamePlate.GetNamePlateForUnit("player") A few notes on this: destroying its SetAlpha method with namePlate["SetAlpha"]=function()end doesn't prevent the namePlate from fading out or fading back in. I thought maybe just its children were fading but all its children's alphas are at 1.0 the whole time. So something else is driving its fading. The only other way to make it fade is by running WorldFrame:SetAlpha. But again, destroying WorldFrame["SetAlpha"]=function()end doesn't prevent it from fading. Could there be some hidden frame used to fade it? There's nothing obvious showing up in fstack. At any rate, here is the temporary solution for the problem: Code:
local tempFun=NamePlateDriverFrame:GetScript("OnEvent"); Code:
/run local f=NamePlateDriverFrame;gn=f:GetScript("OnEvent");function fn(s,e,...)if e=="NAME_PLATE_UNIT_REMOVED" and UnitIsPlayer(...)then else gn(s,e,...)end end f:SetScript("OnEvent",fn) Code:
/run NamePlate1:Show(); NamePlate1:SetAlpha(0.75); And as for the source of the alpha fading, who knows? |
Also pretty new to all this so if I'm doing something obviously wrong, please let me know.
|
Quote:
|
Yeah seriously! It's probably done in that same magical place that decides how nameplates move around.
The closest I got to preventing the autofading was being able to reshow my resource bar after it faded. But then the next time a new nameplate was needed, it stole my resource bar. What was funny is it would keep displaying my health/energy/combo points even though it would be floating over another unit. It's too bad all of that functionality is unavailable to us. |
I have also look into this, it looks like the animation and SetAlpha changes run directly in the game's C code, so we won't be able to override it. You bets bet would be to hide the frame and build a replica. It should't be that hard.
|
Quote:
I had the same issue for DuffedUI and after trying to override the alpha and position for the ressourcenameplate, I have decided to write a complete replica, like the old ressource-bars from the live-version. Another problem is the combatprotection for the default ressource-nameplate. |
there is these two cvars which can be set to artificially lock the position:
SetCVar ("nameplateSelfTopInset", .69999) SetCVar ("nameplateSelfBottomInset, .3) |
All times are GMT -6. The time now is 08:40 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI