SuperVillain UI

SuperVillain UI

279k Downloads

Lua error with unit frames

dnormX opened this issue ยท 2 comments

commented

Getting a Lua error that seems to be preventing the unit frames from drawing.

UnitFrames [Load]: @(07/18/18 06:52:45) - ...e\AddOns\SVUI_UnitFrames\libs\oUF\elements\power.lua:110: Attempt to register unknown event "UNIT_POWER

Near the end of the install dialogue, the installer is blank, appears to be the same lua error?

(I'm not a programmer so this is probably wildly unhelpful but trying because I'm a fan.)

commented

Can be fixed by uncommenting (or deleting) line 110

self:RegisterEvent('UNIT_POWER_BAR_SHOW', Path)
self:RegisterEvent('UNIT_POWER_BAR_HIDE', Path)
self:RegisterEvent('UNIT_DISPLAYPOWER', Path)
self:RegisterEvent('UNIT_CONNECTION', Path)
self:RegisterEvent('UNIT_FACTION', Path)
self:RegisterEvent('UNIT_MAXPOWER', Path)
self:RegisterEvent('UNIT_POWER', Path)
self:RegisterUnitEvent("UNIT_POWER", unit);
self:RegisterUnitEvent("UNIT_MAXPOWER", unit);

Checking with oUF8.0 it seems that the Event UNIT_POWER was split into UNIT_POWER_FREQUENT and UNIT_POWER_UPDATE

So I tried this:

        if(power.frequentUpdates and (unit == 'player' or unit == 'pet')) then
        	self:RegisterEvent('UNIT_POWER_FREQUENT', Path)
       		self:RegisterUnitEvent("UNIT_POWER_FREQUENT", unit)
        else
       		self:RegisterEvent('UNIT_POWER_UPDATE', Path)
        	self:RegisterUnitEvent("UNIT_POWER_UPDATE", unit)
        end

EDIT: Got that wrong, UNIT_POWER is now UNIT_POWER_UPDATE. UNIT_POWER_FREQUENT existed already.

commented

Can also be fixed by changing any instance of UNIT_POWER to UNIT_POWER_UPDATE. Patch changed the name of this value.