Thread Tools Display Modes
07-24-14, 11:40 AM   #1
Drool
A Deviate Faerie Dragon
Join Date: Jan 2011
Posts: 10
taint from moving unit frames

hey mates,

im using a simple script to move the default unit frames
Lua Code:
  1. PlayerFrame:ClearAllPoints()
  2. PlayerFrame:SetPoint("CENTER", UIParent, -294, -150)
  3.     PlayerFrame.SetPoint = function()
  4. end
  5.  
  6. TargetFrame:ClearAllPoints()
  7. TargetFrame:SetPoint("CENTER", UIParent, 294, -150)
  8.     TargetFrame.SetPoint = function()
  9. end
  10.  
  11. FocusFrame:ClearAllPoints()
  12. FocusFrame:SetPoint("CENTER", UIParent, 294, 400)
  13.     FocusFrame.SetPoint = function()
  14. end

however i always get the message: interface-action failed because of an addon
and because of said error my target of target frames is hiding
taint.log:

Code:
7/24 19:15:04.630  An action was blocked in combat because of taint from mUI - TargetFrameToT:Show()
7/24 19:15:04.630      Interface\FrameXML\TargetFrame.lua:924 TargetofTarget_Update()
7/24 19:15:04.630      Interface\FrameXML\TargetFrame.lua:415 TargetFrame_OnUpdate()
7/24 19:15:04.630      TargetFrame:OnUpdate()
how do i fix this? is there a better way to move the unitframes in a fixed position than moving it by hand on every character? :/

regards,
Drool
  Reply With Quote
07-24-14, 11:57 AM   #2
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Those frames are secure. You are changing the SetPoint function on a secureframe. That function gets called infight and you catch a taint.

First question. Why don't you rightclick your unit frame and just unlock it. Move it to whereever you like it to be. That way the position handling will be set to userplaced and save its position to the layout-local.txt.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
07-24-14, 12:02 PM   #3
Drool
A Deviate Faerie Dragon
Join Date: Jan 2011
Posts: 10
Originally Posted by zork View Post
Those frames are secure. You are changing the SetPoint function on a secureframe. That function gets called infight and you catch a taint.

First question. Why don't you rightclick your unit frame and just unlock it. Move it to whereever you like it to be. That way the position handling will be set to userplaced and save its position to the layout-local.txt.
because i have to do it on every character, that beeing said, its not a problem! but im kind of a perfectionist and want it pixel-exactly on all my characters, (if possible)
  Reply With Quote
07-24-14, 12:37 PM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
Do it once, copy/paste layout-local.txt

Edit: Exit the game before copy/paste.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 07-24-14 at 03:19 PM.
  Reply With Quote
07-24-14, 02:57 PM   #5
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
This. And if you like pixel perfect so much. Just edit the values inside the layout-local.txt. Problem solved.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
07-24-14, 03:12 PM   #6
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
Can i hijack this thread to ask if it's possible to move the boss unit frames without causing taint - since they don't have the right-click + move option?

Lua Code:
  1. local a = {Boss1TargetFrame:GetPoint()}
  2.     Boss1TargetFrame:ClearAllPoints()
  3.     Boss1TargetFrame:SetPoint(a[1],a[2],a[3],a[4]-22, a[5]-70)
  4.     Boss1TargetFrame.SetPoint = function() end

Lua Code:
  1. hooksecurefunc("TargetFrame_OnEvent", function(self, event)
  2.         if (event=="INSTANCE_ENCOUNTER_ENGAGE_UNIT") then
  3.             for i = 1, MAX_BOSS_FRAMES do
  4.                 if ( _G["Boss"..i.."TargetFrame"]:IsShown()) then
  5.                     numBossFrames = i;
  6.                 end
  7.             end
  8.             if (numBossFrames > 0) then
  9.                 local frame = CreateFrame("Frame")
  10.                 frame:SetPoint("TOP", MinimapCluster, "BOTTOM", 0, -40)
  11.                 Boss1TargetFrame:SetParent(frame)
  12.                 Boss1TargetFrame:ClearAllPoints()
  13.                 Boss1TargetFrame:SetPoint("TOP", frame, "TOP", 0, 0)
  14.             end
  15.         end
  16.     end)

Lua Code:
  1. local bossParent = CreateFrame("Frame")
  2.     bossParent:SetPoint("TOP", MinimapCluster, "BOTTOM", 10, -80)
  3.  
  4.     local HandleFrame = function(baseName)
  5.         local frame
  6.         if(type(baseName) == 'string') then
  7.             frame = _G[baseName]
  8.         else
  9.             frame = baseName
  10.         end
  11.  
  12.         if (frame) then
  13.             -- move frame without causing taint (?)
  14.             frame:ClearAllPoints()
  15.             frame:SetParent(bossParent)
  16.             frame:SetPoint("TOP", bossParent, "TOP", 0, 0)
  17.         end
  18.     end
  19.    
  20.     function MoveTheFuckinBoss(unit)
  21.         if(not unit) then return end
  22.  
  23.         if(unit:match'(boss)%d?$' == 'boss') then
  24.             local id = unit:match'boss(%d)'
  25.             if(id) then
  26.                 HandleFrame('Boss'..id..'TargetFrame')
  27.             else
  28.                 for i=1, 4 do
  29.                     HandleFrame(('Boss%dTargetFrame'):format(i))
  30.                 end
  31.             end
  32.         end
  33.     end
  34.    
  35.     hooksecurefunc("UIParent_ManageFramePositions", MoveTheFuckinBoss)

Trying things like this has either failed to produce results, caused an ADDON_ACTION_BLOCKED error, or both.
  Reply With Quote
07-24-14, 03:29 PM   #7
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by ObbleYeah View Post
Can i hijack this thread to ask if it's possible to move the boss unit frames without causing taint - since they don't have the right-click + move option?
Could try this:

Lua Code:
  1. local a = {Boss1TargetFrame:GetPoint()}
  2. Boss1TargetFrame:ClearAllPoints()
  3. Boss1TargetFrame:SetPoint(a[1],a[2],a[3],a[4]-22, a[5]-70)
  4. Boss1TargetFrame:SetMovable(true)
  5. Boss1TargetFrame:SetUserPlaced(true)
  6. Boss1TargetFrame:SetMovable(false)

I think this would work with the TargetFrame or pretty much any protected frames too.

At least i'm using this in:

http://www.wowinterface.com/forums/s...ad.php?t=49385

However i'm not finished with the "in combat" testing yet.

Last edited by Resike : 07-24-14 at 05:26 PM.
  Reply With Quote
07-24-14, 03:41 PM   #8
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
interesting, will report back.
  Reply With Quote
07-24-14, 10:23 PM   #9
Drool
A Deviate Faerie Dragon
Join Date: Jan 2011
Posts: 10
Originally Posted by Resike View Post
Could try this:

Lua Code:
  1. local a = {Boss1TargetFrame:GetPoint()}
  2. Boss1TargetFrame:ClearAllPoints()
  3. Boss1TargetFrame:SetPoint(a[1],a[2],a[3],a[4]-22, a[5]-70)
  4. Boss1TargetFrame:SetMovable(true)
  5. Boss1TargetFrame:SetUserPlaced(true)
  6. Boss1TargetFrame:SetMovable(false)

I think this would work with the TargetFrame or pretty much any protected frames too.

At least i'm using this in:

http://www.wowinterface.com/forums/s...ad.php?t=49385

However i'm not finished with the "in combat" testing yet.
this does the job!! thanks !

it seems like it works already by just adding SetMovable(true), SetUserPlaced(true), SetMovable(false)

like this:

Lua Code:
  1. PlayerFrame:SetMovable(true)
  2. PlayerFrame:ClearAllPoints()
  3. PlayerFrame:SetPoint("CENTER", UIParent, -294, -150)
  4. PlayerFrame:SetUserPlaced(true)
  5. PlayerFrame:SetMovable(false)
  6.  
  7. TargetFrame:SetMovable(true)
  8. TargetFrame:ClearAllPoints()
  9. TargetFrame:SetPoint("CENTER", UIParent, 294, -150)
  10. TargetFrame:SetUserPlaced(true)
  11. TargetFrame:SetMovable(false)
  12.  
  13. FocusFrame:SetMovable(true)
  14. FocusFrame:ClearAllPoints()
  15. FocusFrame:SetPoint("CENTER", UIParent, 294, 400)
  16. FocusFrame:SetUserPlaced(true)
  17. FocusFrame:SetMovable(false)

so it'll work both ways without a taint, thanks mate!!
  Reply With Quote
07-25-14, 01:10 AM   #10
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
Yes that is actually the same as unlocking the frame in game and moving it. Technically you enable movable, enable userplaced and when finished lock it again.
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote
07-25-14, 05:18 AM   #11
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
Originally Posted by Resike View Post
Could try this:

Lua Code:
  1. local a = {Boss1TargetFrame:GetPoint()}
  2. Boss1TargetFrame:ClearAllPoints()
  3. Boss1TargetFrame:SetPoint(a[1],a[2],a[3],a[4]-22, a[5]-70)
  4. Boss1TargetFrame:SetMovable(true)
  5. Boss1TargetFrame:SetUserPlaced(true)
  6. Boss1TargetFrame:SetMovable(false)

I think this would work with the TargetFrame or pretty much any protected frames too.

At least i'm using this in:

http://www.wowinterface.com/forums/s...ad.php?t=49385

However i'm not finished with the "in combat" testing yet.
This doesn't work - doesn't produce any visible results or errors when I used as is but when I tried it like this:

Lua Code:
  1. hooksecurefunc(Boss1TargetFrame, "SetPoint", function(self, _, parent)
  2.         Boss1TargetFrame:SetMovable(true)
  3.         Boss1TargetFrame:ClearAllPoints()
  4.         Boss1TargetFrame:SetPoint("TOP", Minimap, "BOTTOM", 0, -70)
  5.         Boss1TargetFrame:SetUserPlaced(true)
  6.         Boss1TargetFrame:SetMovable(false)
  7.     end)

I get this:

Code:
\Map.lua:342: Frame Boss1TargetFrame is not movable or resizable
So i assume SetMoveable() is not accessible in this instance.
  Reply With Quote
07-25-14, 05:23 AM   #12
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
I'm fairly sure that any successful way to moving it, if possible, is via the UIParent.lua

https://github.com/tekkub/wow-ui-sou...L/UIParent.lua

specifically from line 2310 onwards. But yeah, I dunno how to actually go about it. And it still might be something much simpler.
  Reply With Quote
07-25-14, 06:56 AM   #13
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Is there any fast quests or scenarios where i can test this frames?
  Reply With Quote
07-25-14, 08:07 AM   #14
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
I've just been nipping in and out of LFR to test, but I just found this with a quick cursory search for anything to do with boss frames:

...To test the boss frame, just head into Blackrock Caverns on normal and aggro Rom'ogg (before making a beeline for the entrance).
  Reply With Quote
07-25-14, 08:41 AM   #15
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by ObbleYeah View Post
I've just been nipping in and out of LFR to test, but I just found this with a quick cursory search for anything to do with boss frames:
Thats a tought one, seems like we can't move that frame since pretty much everytime it appers you are already in combat. Not sure why they had to protect thoose frames tho.
  Reply With Quote
07-25-14, 08:43 AM   #16
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
Yeah - it's annoying. I guess as a last resort I can always just use the DBM hp bars, but I'd prefer not to.
  Reply With Quote
07-25-14, 08:49 AM   #17
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
Also, I can't remember if I imagined this - but I think I vaguely remember SexyMap advertising that it could successfully move the frames at one point. Not sure if that's still the case though.
  Reply With Quote
07-25-14, 03:32 PM   #18
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Think you need to/can move the boss frame container, whatever that is, rather than the individual unit frames. I seem to recall that being suggested in some other thread.
__________________
Grab your sword and fight the Horde!
  Reply With Quote
07-26-14, 02:22 AM   #19
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
There is no "boss frame container".

https://github.com/tekkub/wow-ui-sou...ua#L2310-L2323

Code:
	-- Boss frames - need to move below buffs/debuffs if both right action bars are showing
	local numBossFrames = 0;
	for i = 1, MAX_BOSS_FRAMES do
		if ( _G["Boss"..i.."TargetFrame"]:IsShown() ) then
			numBossFrames = i;
		end
	end
	if ( numBossFrames > 0 ) then
		if ( rightActionBars > 1 ) then
			anchorY = min(anchorY, buffsAnchorY);
		end
		Boss1TargetFrame:SetPoint("TOPRIGHT", "MinimapCluster", "BOTTOMRIGHT", -(CONTAINER_OFFSET_X * 1.3) + 60, anchorY * 1.333);	-- by 1.333 because it's 0.75 scale
		anchorY = anchorY - (numBossFrames * (68 + BOSS_FRAME_CASTBAR_HEIGHT) + BOSS_FRAME_CASTBAR_HEIGHT);
	end
That said, as long as you're not trying to move it in combat, I don't see why a simple hook shouldn't work:

Code:
local moving
hooksecurefunc(Boss1TargetFrame, "SetPoint", function(self) -- don't care about args
	if moving or InCombatLockdown() then -- avoid infinite loops and blocked actions
		return print("Boss1TargetFrame:SetPoint", moving and "already moving" or "in combat")
	end
	moving = true
	print("Boss1TargetFrame:SetPoint moving...")

	self:ClearAllPoints()
	self:SetPoint("TOP", Minimap, "BOTTOM", 0, -70)

	print("Boss1TargetFrame:SetPoint done!")
	moving = nil
end)
If you still get the "not movable or resizable" error it would help to specify what exactly is on line 342 in your file...
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.

Last edited by Phanx : 07-26-14 at 02:44 AM.
  Reply With Quote
07-26-14, 02:34 AM   #20
ObbleYeah
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Sep 2008
Posts: 210
Originally Posted by Phanx View Post
That said, as long as you're not trying to move it in combat, I don't see why a simple hook shouldn't work:

Code:
local moving
hooksecurefunc(Boss1TargetFrame, "SetPoint", function(self) -- don't care about args
	if moving or InCombatLockdown() then -- avoid infinite loops and blocked actions
		return print("Boss1TargetFrame:SetPoint", moving and "already moving" or "in combat")
	end
	moving = true
	print("Boss1TargetFrame:SetPoint moving...")

	self:SetMovable(true)
	self:ClearAllPoints()
	self:SetPoint("TOP", Minimap, "BOTTOM", 0, -70)
	self:SetUserPlaced(true)
	self:SetMovable(false)

	print("Boss1TargetFrame:SetPoint done!")
	moving = nil
end)
If you still get the "not movable or resizable" error it would help to specify what exactly is on line 342 in your file...
line 342 was self:SetMovable(true). I'll try this - though I've already tried variations on the theme.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » taint from moving unit frames

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