Reply
Thread Tools Display Modes
Unread 09-29-14, 09:49 AM   #1
expand
A Murloc Raider
Join Date: Jan 2010
Posts: 7
Request: Unitframes noninteractive

Can someone please make an addon that toggles PlayerFrame TargetFrame, TargetFrameToT, FocusFrame and their Aurass to noninteractive (click-through). Thank you in advance!
expand is offline   Reply With Quote
Unread 09-29-14, 12:37 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,054
You can disable mouse interaction by making the following API calls.
Code:
PlayerFrame:EnableMouse(false);
TargetFrame:EnableMouse(false);
TargetFrameToT:EnableMouse(false);
FocusFrame:EnableMouse(false);
You can either put this in a macro and add /run to the beginning of each line or put this into an addon of your own.

If you wish to make this into your own addon, this resource would let you paste the code into a form and generate the addon for you.
http://addon.bool.no/
__________________
"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 : 09-29-14 at 12:41 PM.
SDPhantom is offline   Reply With Quote
Unread 09-29-14, 01:44 PM   #3
expand
A Murloc Raider
Join Date: Jan 2010
Posts: 7
ty, how about making the auras of the target, focus, and tot noninteractive?
expand is offline   Reply With Quote
Unread 09-29-14, 03:45 PM   #4
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,054
Originally Posted by expand View Post
ty, how about making the auras of the target, focus, and tot noninteractive?
These took a little more time. The target and focus frames dynamicly create their buff and debuff frames. The ToT frame has a static number of 4 frames at all times.

lua Code:
  1. --  TargetFrame and FocusFrame
  2. hooksecurefunc("TargetFrame_UpdateAuras",function(self)
  3.     local name=self:GetName();
  4.  
  5.     for i=1,MAX_TARGET_BUFFS do
  6.         local frame=_G[name.."Buff"..i];
  7.         if frame then frame:EnableMouse(false); end
  8.     end
  9.  
  10.     for i=1,(self.maxDebuffs or MAX_TARGET_DEBUFFS) do
  11.         local frame=_G[name.."Debuff"..i];
  12.         if frame then frame:EnableMouse(false); end
  13.     end
  14. end);
  15.  
  16. --  Target of Target
  17. for i=1,4 do _G["TargetFrameToTDebuff"..i]:EnableMouse(false); end
__________________
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
SDPhantom is offline   Reply With Quote
Unread 09-30-14, 08:29 AM   #5
expand
A Murloc Raider
Join Date: Jan 2010
Posts: 7
Thank you very much!! I appreciate it. Can you also please help me make a toggle command to enable and disable the frames\auras EnableMouse
expand is offline   Reply With Quote
Unread 10-14-14, 02:04 PM   #6
expand
A Murloc Raider
Join Date: Jan 2010
Posts: 7
How do I get this to work on 6.0?
expand is offline   Reply With Quote
Unread 10-14-14, 04:39 PM   #7
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,054
Originally Posted by expand View Post
How do I get this to work on 6.0?
The Lua code should be fine as-is. You just need to open up the .TOC file in Notepad or a similar text editor and set the interface version to 60000. After you're done, the line should look like this.
Code:
## Interface: 60000
__________________
"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 : 10-14-14 at 04:44 PM.
SDPhantom is offline   Reply With Quote
Unread 10-14-14, 07:44 PM   #8
expand
A Murloc Raider
Join Date: Jan 2010
Posts: 7
Its not working =(
expand is offline   Reply With Quote
Unread 10-14-14, 10:09 PM   #9
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 9,683
*How* is it not working?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

Seerah is offline   Reply With Quote
Unread 10-15-14, 12:22 AM   #10
expand
A Murloc Raider
Join Date: Jan 2010
Posts: 7
im not a coder or anything but here is the code, used some sap addon codes for the commands, please let me know whats making it not work.

local a = CreateFrame("Frame")

SLASH_NOCLICK1 = '/noclick';

local f=CreateFrame("Frame")



local function SlashCmd(cmd,self)
if (cmd == 'on') then
enabled = 'true';
DEFAULT_CHAT_FRAME:AddMessage("Noclick Enabled",1,0,0);

-- This file is loaded from "Click Through.toc"

-- TargetFrame and FocusFrame
hooksecurefunc("TargetFrame_UpdateAuras",function(self)
local name=self:GetName();

for i=1,MAX_TARGET_BUFFS do
local frame=_G[name.."Buff"..i];
if frame then frame:EnableMouse(0); end
end

for i=1,(self.maxDebuffs or MAX_TARGET_DEBUFFS) do
local frame=_G[name.."Debuff"..i];
if frame then frame:EnableMouse(0); end
end
end);

-- Target of Target
for i=1,4 do _G["TargetFrameToTDebuff"..i]:EnableMouse(false); end


PlayerFrame:EnableMouse(0);
PlayerFrameHealthBar:EnableMouse(0);
PlayerFrameManaBar:EnableMouse(0);

TargetFrame:EnableMouse(0);
TargetFrameHealthBar:EnableMouse(0);
TargetFrameManaBar:EnableMouse(0);

PetFrame:EnableMouse(0);
PetFrameHealthBar:EnableMouse(0);
PetFrameManaBar:EnableMouse(0);

TargetFrameToT:EnableMouse(0);
TargetFrameToTHealthBar:EnableMouse(0);
TargetFrameToTManaBar:EnableMouse(0);

FocusFrame:EnableMouse(0);
FocusFrameHealthBar:EnableMouse(0)
FocusFrameManaBar:EnableMouse(0)
FocusFrameToT:EnableMouse(0);


elseif (cmd == 'off') then
enabled = 'false';
DEFAULT_CHAT_FRAME:AddMessage("Noclick Disabled",1,0,0);

-- This file is loaded from "Click Through.toc"

-- TargetFrame and FocusFrame
hooksecurefunc("TargetFrame_UpdateAuras",function(self)
local name=self:GetName();

for i=1,MAX_TARGET_BUFFS do
local frame=_G[name.."Buff"..i];
if frame then frame:EnableMouse(1); end
end

for i=1,(self.maxDebuffs or MAX_TARGET_DEBUFFS) do
local frame=_G[name.."Debuff"..i];
if frame then frame:EnableMouse(1); end
end
end);

-- Target of Target
for i=1,4 do _G["TargetFrameToTDebuff"..i]:EnableMouse(false); end

PlayerFrame:EnableMouse(1);
PlayerFrameHealthBar:EnableMouse(1);
PlayerFrameManaBar:EnableMouse(1);

TargetFrame:EnableMouse(1);
TargetFrameHealthBar:EnableMouse(1);
TargetFrameManaBar:EnableMouse(1);

PetFrame:EnableMouse(1);
PetFrameHealthBar:EnableMouse(1);
PetFrameManaBar:EnableMouse(1);

TargetFrameToT:EnableMouse(1);
TargetFrameToTHealthBar:EnableMouse(1);
TargetFrameToTManaBar:EnableMouse(1);

FocusFrame:EnableMouse(1);
FocusFrameHealthBar:EnableMouse(1)
FocusFrameManaBar:EnableMouse(1)
FocusFrameToT:EnableMouse(1);



else
DEFAULT_CHAT_FRAME:AddMessage("Unknown command. Enter either '/noclick on' to activate noclick, or '/noclick off' to deactivate it.",1,0,0);
end
end


SlashCmdList["NOCLICK"] = SlashCmd;

a:SetScript("OnEvent", function(self, event)

if event == "PLAYER_ENTERING_WORLD" then

-- This file is loaded from "Click Through.toc"

-- TargetFrame and FocusFrame
hooksecurefunc("TargetFrame_UpdateAuras",function(self)
local name=self:GetName();

for i=1,MAX_TARGET_BUFFS do
local frame=_G[name.."Buff"..i];
if frame then frame:EnableMouse(0); end
end

for i=1,(self.maxDebuffs or MAX_TARGET_DEBUFFS) do
local frame=_G[name.."Debuff"..i];
if frame then frame:EnableMouse(0); end
end
end);

-- Target of Target
for i=1,4 do _G["TargetFrameToTDebuff"..i]:EnableMouse(false); end


PlayerFrame:EnableMouse(0);
PlayerFrameHealthBar:EnableMouse(0);
PlayerFrameManaBar:EnableMouse(0);

TargetFrame:EnableMouse(0);
TargetFrameHealthBar:EnableMouse(0);
TargetFrameManaBar:EnableMouse(0);

PetFrame:EnableMouse(0);
PetFrameHealthBar:EnableMouse(0);
PetFrameManaBar:EnableMouse(0);

TargetFrameToT:EnableMouse(0);
TargetFrameToTHealthBar:EnableMouse(0);
TargetFrameToTManaBar:EnableMouse(0);

FocusFrame:EnableMouse(0);
FocusFrameHealthBar:EnableMouse(0)
FocusFrameManaBar:EnableMouse(0)
FocusFrameToT:EnableMouse(0);


f:RegisterEvent("UNIT_AURA")
f:RegisterEvent("PLAYER_TARGET_CHANGED")
f:SetScript("OnEvent", function()

end)

end


end)


a:RegisterEvent("PLAYER_ENTERING_WORLD")
expand is offline   Reply With Quote
Unread 10-15-14, 04:11 AM   #11
semlar
A Molten Giant
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 622
EnableMouse(0) should be EnableMouse(false), I'm not sure where you got the idea to use 0 since the only examples in this thread used false.

1 will probably technically work for true, but you should be using true and false, not 1 and 0.
semlar is offline   Reply With Quote
Unread 10-15-14, 01:14 PM   #12
expand
A Murloc Raider
Join Date: Jan 2010
Posts: 7
it worked before the patch, but yea using false fixed the problem. thank you
expand is offline   Reply With Quote
Unread 10-15-14, 01:18 PM   #13
p3lim
A Pyroguard Emberseer
 
p3lim's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 1,312
Originally Posted by expand View Post
it worked before the patch, but yea using false fixed the problem. thank you
6.0 removed support for integer flags and from most of the API, requiring you to use booleans (which is also best practice).
p3lim is offline   Reply With Quote
Reply

Go BackWoWInterface » AddOns, Compilations, Macros » AddOn Search/Requests » Request: Unitframes noninteractive

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