shagu / pfUI

A User Interface Replacement for World of Warcraft: Vanilla & TBC
https://shagu.org/pfUI
MIT License
339 stars 117 forks source link

Don't rangecheck when player has combo points to avoid losing them #1257

Closed gwetchen closed 5 months ago

shagu commented 5 months ago

Hi, thanks for your contribution,

I think it could be done easier like that:

local combo = CreateFrame("Frame", "pfComboPointsDetect")
combo:RegisterEvent("PLAYER_COMBO_POINTS")
combo:SetScript("OnEvent", function()
  PlayerFrame.combopoints = GetComboPoints() > 0
end)

Also I'm not sure if .combopoints on a PlayerFrame might be to generic, I could imagine this turning into a conflict with other addons. I'd prefer to play safe and just use a local variable to save the value to.

PS: there's a typo in the comment :rabbit:

gwetchen commented 5 months ago

Thank you for the feedback, I really appreciate it. I hope this is better.

I've removed the 🐰:)

shagu commented 5 months ago

Thanks, merged :)