Stanzilla / WoWUIBugs

World of Warcraft UI Bug Tracker
166 stars 7 forks source link

Direct use of C_Ping.GetTargetWorldPing can break the ping wheel #455

Closed Meorawr closed 1 year ago

Meorawr commented 1 year ago

Calls to C_Ping.GetTargetWorldPing without the Ping UI addon being loaded can break the ability to open the radial wheel when dragging on the game world.

Test case

  1. Log in and run the following command: /run C_Ping.GetTargetWorldPing(0, 0)
  2. Hold the ping hotkey and drag on the world frame to open the ping wheel.

On step 2, the ping wheel won't open - you'll just get a red UI error message saying "Can't ping this.".

Explanation

Direct calls to C_Ping.GetTargetWorldPing trigger the ping radial frame to be created and the corresponding PING_RADIAL_WHEEL_FRAME_CREATED event to fire.

This event isn't handled by UIParent, so if the Blizzard_PingUI addon hasn't been loaded when this event fires then that addon will never receive it, and the radialParent field is never initialized to a non-nil value. This leads to the "Can't ping this" message (PING_ERROR) being displayed when attempting to open the wheel.

Solution

Either handle the PING_RADIAL_WHEEL_FRAME_CREATED event in UIParent and make it load the ping UI (and forward the event on), or make C_Ping.CreateFrame return the created frame and assign the result to self.radialParent inside the OnLoad handler of PingFrame.

Meorawr commented 1 year ago

"Fixed" in 10.1.7.51059 by locking down the whole ping system.