oUF-wow / oUF

WoW AddOn - Unit frame framework.
MIT License
222 stars 58 forks source link

Fix ComboFramePlayer error on druid login #622

Closed trincasidra closed 1 year ago

trincasidra commented 2 years ago

Fix the following error:

Message: Interface/FrameXML/ComboFramePlayer.lua:17: Usage: local power = UnitPower(unitToken [, powerType, unmodified])
Time: Sat Nov 12 14:09:39 2022
Count: 1
Stack: Interface/FrameXML/ComboFramePlayer.lua:17: Usage: local power = UnitPower(unitToken [, powerType, unmodified])
[string "=[C]"]: ?
[string "=[C]"]: in function `UnitPower'
[string "@Interface/FrameXML/ComboFramePlayer.lua"]:17: in function `UpdatePower'
[string "@Interface/FrameXML/ClassPowerBar.lua"]:58: in function `OnEvent'
[string "@Interface/FrameXML/ClassResourceBarTemplate.lua"]:58: in function <Interface/FrameXML/ClassResourceBarTemplate.lua:38>

Locals: 

Which seems to be related to druids having a new/different blizzard combo frame.

I also tried tinkered with handleFrame(ComboPointPlayerFrame), but that doesn't seem to add any benefit. Rogues work okay even without that on my implementation at least.

trincasidra commented 2 years ago

Looks like I was too quick - the error still pops up after changing between druid specs (although it does not pop up on login).

ls- commented 2 years ago

I think I know what's broken and where because it's me who broke it, probably... 😒🔫

-- edit

Or not? I'll look into it later today...

ls- commented 2 years ago

Hmm, I couldn't reproduce it on my end, and I tried all kinds of player/target frame combinations. What I thought I broke some time ago isn't actually broken. Are you sure you aren't doing something weird on your end? Can I see how you use it?

trincasidra commented 1 year ago

Thanks @ls-! You can see how I'm using oUF in my repo for trincaui.

When debugging I found out this error only popped when calling oUF:Spawn for the player frame (core/functions.lua:36 on my repo). When replacing that with a simple CreateFrame I didn't get the error, but of course many things didn't work either, so I went from there to check into the oUF code.

trincasidra commented 1 year ago

Great! Error is gone :)