oUF

97.2k Downloads

Custom visibility state driver for player unit

zorker opened this issue ยท 1 comments

commented

I tried adding a custom visibility state driver for the player unit.
http://www.wowinterface.com/forums/showthread.php?t=55983

The state driver is working properly. The problem is that something calls the show method of the frame multiple times per second overriding the visibility state driver value. It literally spams the chat when put to screen.

local player = oUF:Spawn("player", A.."Player")
hooksecurefunc(player, 'Show', function(self)
  print("func call Show",self:GetName(),self:IsShown())
end)

I would like to add a custom visibility state to the player frame (like: "[combat][modifier][@target,exists] show; hide") but I cannot get it to work. Am I missing something?

I tried applying the state driver directly on the frame or by using a manager frame. The outcome is the same.

commented

haste posted the answer in the thread. We need to unregister the unit watch.

Here is a working solution:

local player = oUF:Spawn("player", A.."Player")
player:Disable()
RegisterStateDriver(player, "visibility", "[combat][target,exists][modifier] show; hide")