obble / modui_classic

modui: for wow classic
45 stars 20 forks source link

Mouse Anchor and Smart Anchor tooltip behavior #52

Closed Xaero252 closed 4 years ago

Xaero252 commented 4 years ago

This tooltip addition allows the tooltip to follow the mouse cursor on WorldFrame. If the cursor enters a frame, and SmartAnchor is enabled - the tooltip will anchor 10 pixels above the frame, creating a nice stable reading position. Currently the SmartAnchor feature is dependent on MouseAnchor being enabled. The two features could be made separate, or maybe it's redundant to separate them at all, and it should all just be referred to as "Smart Anchor"

Xaero252 commented 4 years ago

I just noticed an error on my part immediately after submitting this - the OnUpdate hook isn't working properly for mouse anchor causing it to "lag" behind the actual cursor position. I originally had this as a separate addon I was using alongside your UI but adopted it into your UI; I'll fix this quickly.

Xaero252 commented 4 years ago

This now behaves as intended.

obble commented 4 years ago

Cool, thanks for adding this - looks good, i'll test and merge tonight.

Looks like the AddStatusbar function is being missed out of the loop where SmartAnchor is implemented but that's easily re-added

obble commented 4 years ago

I've decided to modify this code slightly to closer match the old modui tooltip-on-mouse behaviour rather than pull this branch directly. it's closely tied to your logic though, thanks!