Thread Tools Display Modes
02-23-12, 08:50 AM   #1
gr0by
A Deviate Faerie Dragon
Join Date: Oct 2008
Posts: 18
Blizz Raidfram rightclick

Is it possible to disable rightclick kontexmenu on BlizzardsRaidFrame and add a macro with an script?

[ rightclick RaidMember8 /dispellmagic ]

sorry for my bad english
  Reply With Quote
02-23-12, 08:54 AM   #2
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
I'd use Clique for this.
http://www.wowinterface.com/download...08-Clique.html
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
02-23-12, 09:11 AM   #3
gr0by
A Deviate Faerie Dragon
Join Date: Oct 2008
Posts: 18
thanks, but iam searching for leightwight version on default blizzraidframes
like an script or lua code snipped
  Reply With Quote
02-23-12, 10:06 AM   #4
Consistency
A Murloc Raider
AddOn Compiler - Click to view compilations
Join Date: Jan 2012
Posts: 4
Originally Posted by gr0by View Post
thanks, but iam searching for leightwight version on default blizzraidframes
like an script or lua code snipped
Clique works with any Unit Frames AddOn, even with the default blizzard frames and honestly it uses close to zero memory.
  Reply With Quote
02-23-12, 10:51 AM   #5
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 822
Changing unitframe stuff involves secure template handling.
There are not that many addon-authors doing it right
Cladhaire is one of the few authors who put a lot of care and energy in creating a secure and always working environment.

Thats why I recommend clique.

If you're interested in the way it works

http://www.wowpedia.org/SecureActionButtonTemplate

is a good read and gives an idea how you can have this without clique.
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
02-24-12, 01:06 PM   #6
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Blizzard_CompactRaidFrames is LoD, so you need to check if it's running already, if not, hook when it loads.

lua Code:
  1. --  We need everything in the hook function
  2. local function Hook()
  3.     local func=CompactRaidFrameContainer_GetUnitFrame;--    This remains unhooked (avoids stack overflow when called)
  4.     hooksecurefunc("CompactRaidFrameContainer_GetUnitFrame",function(...)
  5.         local frame=func(...);--    Call the original function again to get our frame
  6.         if frame:GetAttribute("*type2") then
  7. --          Unset the right-click menu if we haven't already
  8.             frame:SetAttribute("*type2",nil);
  9.         end
  10.     end);
  11. end
  12.  
  13. if IsAddOnLoaded("Blizzard_CompactRaidFrames") then
  14. --  If Blizzard_CompactRaidFrames is loaded, run the hook now
  15.     Hook();
  16. else
  17. --  Not loaded, Create a frame to watch for when it does load and hook it then
  18.     local eframe=CreateFrame("Frame");
  19.     eframe:RegisterEvent("ADDON_LOADED");
  20.     eframe:SetScript("OnEvent",function(self,event,arg)
  21.         if arg=="Blizzard_CompactRaidFrames" then
  22.             self:UnregisterEvent(event);
  23.             Hook();
  24.         end
  25.     end);
  26. end



If you want it to run a macro like you said, just replace lines 6-9 with the following.
Code:
frame:SetAttribute("*type2","macro");
frame:SetAttribute("macrotext",[[
#Macro Text Goes Here
]]);
Note: The hash symbol (#) is the comment marker for the macro system. It's also important when using [[ and ]] to define strings for a macro, there isn't any whitespace before the commands on each line, otherwise it'll send the line out in chat.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 02-26-12 at 03:45 AM.
  Reply With Quote
02-24-12, 01:50 PM   #7
gr0by
A Deviate Faerie Dragon
Join Date: Oct 2008
Posts: 18
Thumbs up

thanks that is it!

i will try this
  Reply With Quote
02-25-12, 08:00 PM   #8
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
@SDPhantom:

I think you meant "SetAttribute" instead of "GetAttribute" the second time.

Another option for avoiding a stack overflow is to use a flag:

Lua Code:
  1. local function Hook()
  2.     local inHook
  3.     hooksecurefunc("CompactRaidFrameContainer_GetUnitFrame", function(...)
  4.         if inHook then
  5.             return
  6.         end
  7.         inHook = true
  8.  
  9.         local frame = CompactRaidFrameContainer_GetUnitFrame(...)
  10.         if frame:GetAttribute("*type2") then
  11.             -- Unset the right-click menu if we haven't already
  12.             frame:SetAttribute("*type2", nil)
  13.         end
  14.  
  15.         inHook = nil
  16.     end)
  17. end

There's no particular advantage in this scenario, so which method you use is simply a matter of personal preference.
  Reply With Quote
02-26-12, 03:48 AM   #9
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by Phanx View Post
I think you meant "SetAttribute" instead of "GetAttribute" the second time.
Fixed in the post above.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
02-26-12, 07:32 AM   #10
gr0by
A Deviate Faerie Dragon
Join Date: Oct 2008
Posts: 18
it downt work for me:/

Code:
local function Hook()
local func=CompactRaidFrameContainer_GetUnitFrame;
hooksecurefunc("CompactRaidFrameContainer_GetUnitFrame",function(...)
local frame=func(...);
frame:SetAttribute("*type2","macro");
frame:SetAttribute("macrotext",[[/cast Battle Shout]]);
end);
end
if IsAddOnLoaded("Blizzard_CompactRaidFrames") then
Hook();
else
local eframe=CreateFrame("Frame");
eframe:RegisterEvent("ADDON_LOADED");
eframe:SetScript("OnEvent",function(self,event,arg)
if arg=="Blizzard_CompactRaidFrames" then
self:UnregisterEvent(event);
Hook();
end
end);
end
sorry but iam not a lua coder.
i rightclick on a raidtarget but i dont become a error msg or a Battle Shout
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Blizz Raidfram rightclick


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