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,879
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

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


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