Thread Tools Display Modes
04-21-20, 02:19 AM   #1
Lybrial
A Flamescale Wyrmkin
AddOn Compiler - Click to view compilations
Join Date: Jan 2010
Posts: 120
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

Last edited by Lybrial : 04-21-20 at 02:23 AM.
  Reply With Quote
04-21-20, 05:17 AM   #2
Lybrial
A Flamescale Wyrmkin
AddOn Compiler - Click to view compilations
Join Date: Jan 2010
Posts: 120
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?
  Reply With Quote
04-21-20, 01:51 PM   #3
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
Are you registering the frame for clicks?

Code:
frame:RegisterForClicks("AnyUp")
__________________
「貴方は1人じゃないよ」
  Reply With Quote
04-22-20, 11:33 AM   #4
Lybrial
A Flamescale Wyrmkin
AddOn Compiler - Click to view compilations
Join Date: Jan 2010
Posts: 120
Originally Posted by haste View Post
Are you registering the frame for clicks?

Code:
frame:RegisterForClicks("AnyUp")
Thx, that solved it.
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » oUF: How to enable right click menus on units?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off