FailcoderAddons / supervillain-ui

Custom World of Warcraft User Interface
32 stars 23 forks source link

Lua error with unit frames #199

Closed dnormX closed 6 years ago

dnormX commented 6 years ago

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.)

blueberryiswar commented 6 years ago

Can be fixed by uncommenting (or deleting) line 110

https://github.com/FailcoderAddons/supervillain-ui/blob/8788404b4cf710290a5606828c7a21bd476828ff/SVUI_UnitFrames/libs/oUF/elements/power.lua#L103-L111

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.

stygiansabyss commented 6 years ago

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