WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   oUF (Otravi Unit Frames) (https://www.wowinterface.com/forums/forumdisplay.php?f=87)
-   -   oUF: How to enable right click menus on units? (https://www.wowinterface.com/forums/showthread.php?t=57954)

Lybrial 04-21-20 02:19 AM

oUF: How to enable right click menus on units?
 
When I spawn units like player or target I would like to have the default right click menu enabled.
Everything works perfect (like showing health, castbar, etc.) but there are no right click menus.

The left click to select units works.

How can I make right click menu work?

Lua Code:
  1. OUF:RegisterStyle(ADDON_NAME, function(frame, unit)
  2.     LybrialUnitFrames:Style(frame, unit);
  3. end);
  4. OUF:SetActiveStyle(ADDON_NAME);
  5.  
  6. OUF:Spawn("player", Player.MODULE_NAME);
  7. OUF:Spawn("target", Target.MODULE_NAME)
  8.  
  9. function LybrialUnitFrames:Style(frame, unit)
  10.     if (unit == "player") then
  11.         self:Player_Create(frame); -- adds health, castbar, name and level
  12.     elseif (unit == "target") then
  13.         self:Target_Create(frame); -- adds health, castbar, name and level
  14.     end
  15. end

Lybrial 04-21-20 05:17 AM

When I add the addon "Clique" to my addons, the right click menu works.
I did not know clique has this functionality though.
Is there a way to enable the right click menu without using the addon clique?

haste 04-21-20 01:51 PM

Are you registering the frame for clicks?

Code:

frame:RegisterForClicks("AnyUp")

Lybrial 04-22-20 11:33 AM

Quote:

Originally Posted by haste (Post 335729)
Are you registering the frame for clicks?

Code:

frame:RegisterForClicks("AnyUp")

Thx, that solved it.


All times are GMT -6. The time now is 09:55 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI