This will be fixed when you setup the globals correctly.
This will be your initialization
HolySonar= LibStub("AceAddon-3.0"):NewAddon("Holy Sonar")
Then you can define functions like function HolySonar:setupOptionsGUI(), b/c if you make it a local function, it has be be physically earlier in the code for it to be called correcly.
To fix what I posted earlier, just make this
Code:
local Radar = newRadar()
local HolyNovaIcon = newHNIcon()
Radar:SetScript("OnUpdate", onUpdate)
to this
Code:
Radar = newRadar()
HolyNovaIcon = newHNIcon()
Radar:SetScript("OnUpdate", onUpdate)
b/c the locals are already being defined at the top of the file. And then just make setupOptionsGUI global until AceAddon can be setup correctly.
Oh, one more thing. GetPlayerFacing() returns radians increasing in a CCW direction, this is why I apply a negative. And the trigonometric functions take radians, not degrees.
The radar seems to be working fine for me. It doesn't work out in the world b/c you cant get player positions there.