FarmHud

FarmHud

3M Downloads

[BUG]: FarmHud enables mouse input/events on child frames when hooking scripts

ls- opened this issue ยท 2 comments

commented

WoW client

WoW Retail

What happened?

And why is it a problem? If there's a frame from another addon that houses an overlay for the minimap or whatever, it'll prevent users from pinging, seeing minimap tooltips, and clicking on the minimap.

The issue originates in this block. but because I'm not particularly familiar with the addon's code/functionality, I chose not to PR it and instead create a ticket.

But overall there's two solutions, either reset the mouse state after you hooked everything

local objMT = getmetatable(obj).__index;
+local mouse = objMT .IsMouseEnabled(obj);
objMT .HookScript(obj,"OnEnter",objHookStart);
objMT .HookScript(obj,"OnDragStart",objHookStart);
objMT .HookScript(obj,"OnLeave",objHookStop);
objMT .HookScript(obj,"OnDragStop",objHookStop);
+objMT .EnableMouse(obj, mouse);

or only hook things if mouse input is enabled in the first place

local objMT = getmetatable(obj).__index;
+if objMT .IsMouseEnabled(obj) then
	objMT .HookScript(obj,"OnEnter",objHookStart);
	objMT .HookScript(obj,"OnDragStart",objHookStart);
	objMT .HookScript(obj,"OnLeave",objHookStop);
	objMT .HookScript(obj,"OnDragStop",objHookStop);
+end

I tried to follow your style ๐Ÿ˜

Lua Error Message?

No response

Other addons?

No response

commented

This does seem to resolve #2 as well.

commented

Btw, I believe this is also the cause of #2.