Thread Tools Display Modes
10-20-12, 07:43 AM   #1
Rufio
A Murloc Raider
 
Rufio's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 9
ToT default UI Errors

Hello can anyone help me with this bug?

Lua Code:
  1. 1666x [ADDON_ACTION_BLOCKED] AddOn "rufioSettings" tried to call the protected function "TargetFrameToT:Show()".
  2. !BugGrabber-r188\BugGrabber.lua:587: in function <!BugGrabber\BugGrabber.lua:587>
  3. <in C code>
  4. FrameXML\TargetFrame.lua:911: in function "TargetofTarget_Update"
  5. FrameXML\TargetFrame.lua:404: in function "TargetFrame_OnUpdate"
  6. <string>:"*:OnUpdate":1: in function <string>:"*:OnUpdate":1
  7.  
  8. Locals:
  9. nil

I use just a setpoint for the ToT but getting this error even if i don't move it...

Here's my Unitframe Code
Lua Code:
  1. --[[ SetPoints ]]
  2. PlayerFrame:ClearAllPoints() PlayerFrame:SetPoint("center", -165, -140) PlayerFrame.SetPoint = function() end
  3. TargetFrame:ClearAllPoints() TargetFrame:SetPoint("center", 165, -140) TargetFrame.SetPoint = function() end
  4. TargetFrameToT:ClearAllPoints() TargetFrameToT:SetPoint("LEFT",TargetFrame,"Top", -15, -1) TargetFrameToT.SetPoint = function() end
  5. TargetFrameToTTextureFrameName:ClearAllPoints() TargetFrameToTTextureFrameName:SetPoint("LEFT",TargetFrameToT,"Top", -1, -8) TargetFrameToTTextureFrameName.SetPoint = function() end
  6. FocusFrameToT:SetPoint("bottomright", -35, -13)
  7. PartyMemberFrame1:ClearAllPoints() PartyMemberFrame1:SetPoint("topleft", 255, -275)
  8. Boss1TargetFrame:ClearAllPoints() Boss1TargetFrame:SetPoint("TOPRIGHT",UIParent,"TOPRIGHT",-140,-230) Boss1TargetFrame.SetPoint=function()end
  9. TargetFrameSpellBar:ClearAllPoints() TargetFrameSpellBar:SetPoint("center", -120, 65) TargetFrameSpellBar.SetPoint=function()end
  10.  
  11. --[[ Scaling ]]
  12. PlayerFrame:SetScale("1.4")
  13. TargetFrame:SetScale("1.4")
  14. for i=1,4 do _G["PartyMemberFrame"..i]:SetScale("1.3") end
  15. Boss1TargetFrame:SetScale("1.3")
  16. Boss2TargetFrame:SetScale("1.3")
  17. Boss3TargetFrame:SetScale("1.3")
  18. TargetFrameSpellBar:SetScale("1.4")
  19. ComboFrame:SetScale("1.3")
  20.  
  21. --[[ Player castbar ]]
  22. local cbf = "CastingBarFrame"
  23. local cbbs = "Interface\\CastingBar\\UI-CastingBar-Border-Small"
  24. local cbfs = "Interface\\CastingBar\\UI-CastingBar-Flash-Small"
  25.  
  26. _G[cbf]:SetSize(180,10)
  27. _G[cbf.."Border"]:SetSize(240,40)
  28. _G[cbf.."Border"]:SetPoint("TOP", _G[cbf], 0, 15)
  29. _G[cbf.."Border"]:SetTexture(cbbs)
  30. _G[cbf.."Flash"]:SetSize(240,40)
  31. _G[cbf.."Flash"]:SetPoint("TOP", _G[cbf], 0, 15)
  32. _G[cbf.."Flash"]:SetTexture(cbfs)
  33. _G[cbf]:SetScale("1.3")
  34. _G[cbf.."Text"]:SetPoint("TOP", _G[cbf], 0, 4)
  35. _G[cbf]:ClearAllPoints()
  36. _G[cbf]:SetPoint("TOP", WorldFrame, "BOTTOM", 0, 130) --0, 100
  37. _G[cbf].SetPoint = function() end
  38. _G[cbf.."Icon"]:Show()
  39. _G[cbf.."Icon"]:SetHeight(20)
  40. _G[cbf.."Icon"]:SetWidth(20)
  41.  
  42. --[[ Castbar timer from thek ]]
  43. _G[cbf].timer = _G[cbf]:CreateFontString(nil)
  44. _G[cbf].timer:SetFont("Fonts\\ARIALN.ttf", 13, "THINOUTLINE")
  45. _G[cbf].timer:SetPoint("RIGHT", _G[cbf], "RIGHT", 24, 0)
  46. _G[cbf].update = .1
  47.  
  48. local tcbf = "TargetFrameSpellBar"
  49. _G[tcbf].timer = _G[tcbf]:CreateFontString(nil)
  50. _G[tcbf].timer:SetFont("Fonts\\ARIALN.ttf", 13, "THINOUTLINE")
  51. _G[tcbf].timer:SetPoint("RIGHT", _G[tcbf], "RIGHT", 24, 0)
  52. _G[tcbf].update = .1
  53.  
  54. local fcbf = "FocusFrameSpellBar"
  55. _G[fcbf].timer = _G[fcbf]:CreateFontString(nil)
  56. _G[fcbf].timer:SetFont("Fonts\\ARIALN.ttf", 13, "THINOUTLINE")
  57. _G[fcbf].timer:SetPoint("RIGHT", _G[fcbf], "RIGHT", 24, 0)
  58. _G[fcbf].update = .1
  59.  
  60. hooksecurefunc("CastingBarFrame_OnUpdate", function(self, elapsed)
  61.     if not self.timer then return end
  62.     if self.update and self.update < elapsed then
  63.         if self.casting then
  64.             self.timer:SetText(format("%.1f", max(self.maxValue - self.value, 0)))
  65.         elseif self.channeling then
  66.             self.timer:SetText(format("%.1f", max(self.value, 0)))
  67.         else
  68.             self.timer:SetText("")
  69.         end
  70.         self.update = .1
  71.     else
  72.         self.update = self.update - elapsed
  73.     end
  74. end)
  75.  
  76. --[[ Focus Castbar ]]
  77. hooksecurefunc(FocusFrameSpellBar, "Show", function()
  78.     FocusFrameSpellBar:SetScale("1.6")
  79.     FocusFrameSpellBar:ClearAllPoints()
  80.     FocusFrameSpellBar:SetPoint("CENTER", UIParent, "CENTER", 0, 150)
  81.     FocusFrameSpellBar.SetPoint = function() end
  82. end)
  83. FocusFrameSpellBar:SetStatusBarColor(0,0.45,0.9); FocusFrameSpellBar.SetStatusBarColor = function() end
  84.  
  85. --[[ Runebar ]]
  86. RuneFrame:ClearAllPoints() RuneFrame:SetPoint("CENTER",UIParent,"CENTER",0,-130) RuneFrame.SetPoint = function() end
  87. for i=1,6 do _G["RuneButtonIndividual"..i]:SetScale("1.4") end
  88. for i=1,6 do _G["RuneButtonIndividual"..i]:ClearAllPoints() end
  89. RuneButtonIndividual3:SetPoint("CENTER",-12,0)
  90. RuneButtonIndividual4:SetPoint("CENTER",12,0)
  91. RuneButtonIndividual2:SetPoint("RIGHT",RuneButtonIndividual3,"LEFT",-4,8)
  92. RuneButtonIndividual1:SetPoint("RIGHT",RuneButtonIndividual2,"LEFT",-4,8)
  93. RuneButtonIndividual5:SetPoint("LEFT",RuneButtonIndividual4,"RIGHT",4,8)
  94. RuneButtonIndividual6:SetPoint("LEFT",RuneButtonIndividual5,"RIGHT",4,8)
  95.  
  96. --[[ hiding pvp icon ]]
  97. PlayerPVPIcon:SetAlpha(0)
  98. TargetFrameTextureFramePVPIcon:SetAlpha(0)
  99.  
  100. --[[ Target and Focus HP-Text ]]
  101. FrameList = {"Player", "Target", "Focus"}
  102. function UpdateHealthValues(...)
  103.         for i = 1, select("#", unpack(FrameList)) do
  104.                 local FrameName = (select(i, unpack(FrameList)))
  105.                 local Health = AbbreviateLargeNumbers(UnitHealth(FrameName))
  106.                 local HealthMax = AbbreviateLargeNumbers(UnitHealthMax(FrameName))
  107.                 local HealthPercent = (UnitHealth(FrameName)/UnitHealthMax(FrameName))*100
  108.                 --Curr&MaxHP _G[FrameName.."FrameHealthBar"].TextString:SetText(Health.."/"..HealthMax.." ("..format("%.0f",HealthPercent).."%)")
  109.                 _G[FrameName.."FrameHealthBar"].TextString:SetText(Health.." ("..format("%.0f",HealthPercent).."%)")
  110.         end
  111. end
  112. hooksecurefunc("TextStatusBar_UpdateTextStringWithValues", UpdateHealthValues)
  113.  
  114. hooksecurefunc("TextStatusBar_UpdateTextStringWithValues", function()
  115. PlayerFrameManaBar.TextString:SetText(AbbreviateLargeNumbers(UnitMana("player")))
  116. TargetFrameManaBar.TextString:SetText(AbbreviateLargeNumbers(UnitMana("target")))
  117. FocusFrameManaBar.TextString:SetText(AbbreviateLargeNumbers(UnitMana("focus")))
  118. end)
  119.  
  120. --[[ hiding combat text ]]
  121. PetHitIndicator:ClearAllPoints()
  122. PlayerHitIndicator:ClearAllPoints()
  123.  
  124. --[[ Class Icons ]]
  125. UFP = "UnitFramePortrait_Update";
  126. UICC = "Interface\\TargetingFrame\\UI-Classes-Circles";
  127. CIT = CLASS_ICON_TCOORDS
  128.  
  129. hooksecurefunc(UFP,function(self)
  130.  if self.portrait then
  131.   if self.unit == "player" or self.unit == "pet" or self.unit == "partypet1" or self.unit == "partypet2" or self.unit == "partypet3" or self.unit == "partypet4" then return end
  132.    local t = CIT[select(2,UnitClass(self.unit))]
  133.  if t
  134.   then self.portrait:SetTexture(UICC) self.portrait:SetTexCoord(unpack(t)) end end end)

I've no clue how to fix this
  Reply With Quote
10-21-12, 01:10 AM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Code:
TargetFrameToT.SetPoint = function() end
This is your problem. Overwriting anything on a secure frame will taint the entire frame. You're doing this with several other members on several other frames, as well.

Instead, you should securehook the SetPoint method, and move the frame back to the desired location if out of combat, or queue the move for the end of combat if you're in combat. I'm not familiar with the internal workings of the Blizzard unitframes, as I haven't used them in 6+ years, but they are (hopefully) not calling SetPoint in an OnUpdate or something stupid.
__________________
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.
  Reply With Quote
10-23-12, 01:36 PM   #3
Rufio
A Murloc Raider
 
Rufio's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 9
It was my first "attemt" to fix this ^^
Even if i outcommand those lines i' still getting this error and have no ToT frame.
  Reply With Quote
10-23-12, 07:17 PM   #4
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Your code would be a lot more readable if you put each command on its own line, used consistent indentation, etc.

Here is your code, cleaned up so it is actually readable, with all of the obviously tainting lines commented out, and a couple of basic inefficiencies cleaned up (though some others remain because I didn't feel like digging through the Blizzard UI code to figure out how to do it right for you):
Lua Code:
  1. --[[ SetPoints ]]
  2. PlayerFrame:ClearAllPoints()
  3. PlayerFrame:SetPoint("CENTER", -165, -140)
  4. --PlayerFrame.SetPoint = function() end -- TAINT
  5.  
  6. TargetFrame:ClearAllPoints()
  7. TargetFrame:SetPoint("CENTER", 165, -140)
  8. --TargetFrame.SetPoint = function() end -- TAINT
  9.  
  10. TargetFrameToT:ClearAllPoints()
  11. TargetFrameToT:SetPoint("LEFT", TargetFrame, "TOP", -15, -1)
  12. --TargetFrameToT.SetPoint = function() end -- TAINT
  13.  
  14. TargetFrameToTTextureFrameName:ClearAllPoints()
  15. TargetFrameToTTextureFrameName:SetPoint("LEFT", TargetFrameToT, "TOP", -1, -8)
  16. --TargetFrameToTTextureFrameName.SetPoint = function() end -- TAINT
  17.  
  18. FocusFrameToT:SetPoint("BOTTOMRIGHT", -35, -13)
  19.  
  20. PartyMemberFrame1:ClearAllPoints()
  21. PartyMemberFrame1:SetPoint("TOPLEFT", 255, -275)
  22.  
  23. Boss1TargetFrame:ClearAllPoints()
  24. Boss1TargetFrame:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", -140, -230)
  25. --Boss1TargetFrame.SetPoint = function() end -- TAINT
  26.  
  27. TargetFrameSpellBar:ClearAllPoints()
  28. TargetFrameSpellBar:SetPoint("CENTER", -120, 65)
  29. --TargetFrameSpellBar.SetPoint = function() end -- TAINT
  30.  
  31. --[[ Scaling ]]
  32. PlayerFrame:SetScale("1.4")
  33. TargetFrame:SetScale("1.4")
  34. for i = 1, 4 do
  35.     _G["PartyMemberFrame"..i]:SetScale("1.3")
  36. end
  37. Boss1TargetFrame:SetScale("1.3")
  38. Boss2TargetFrame:SetScale("1.3")
  39. Boss3TargetFrame:SetScale("1.3")
  40. TargetFrameSpellBar:SetScale("1.4")
  41. ComboFrame:SetScale("1.3")
  42.  
  43. --[[ Player castbar ]]
  44. CastingBarFrame:SetSize(180,10)
  45. CastingBarFrame:SetScale("1.3")
  46. CastingBarFrame:ClearAllPoints()
  47. CastingBarFrame:SetPoint("TOP", WorldFrame, "BOTTOM", 0, 130) --0, 100
  48. --CastingBarFrame.SetPoint = function() end -- TAINT
  49.  
  50. CastingBarFrameBorder:SetSize(240,40)
  51. CastingBarFrameBorder:SetPoint("TOP", CastingBarFrame, 0, 15)
  52. CastingBarFrameBorder:SetTexture("Interface\\CastingBar\\UI-CastingBar-Border-Small")
  53.  
  54. CastingBarFrameFlash:SetSize(240,40)
  55. CastingBarFrameFlash:SetPoint("TOP", CastingBarFrame, 0, 15)
  56. CastingBarFrameFlash:SetTexture("Interface\\CastingBar\\UI-CastingBar-Flash-Small")
  57.  
  58. CastingBarFrameText:SetPoint("TOP", CastingBarFrame, 0, 4)
  59.  
  60. CastingBarFrameIcon:Show()
  61. CastingBarFrameIcon:SetHeight(20)
  62. CastingBarFrameIcon:SetWidth(20)
  63.  
  64. --[[ Castbar timer from thek ]]
  65. CastingBarFrame.timer = CastingBarFrame:CreateFontString(nil)
  66. CastingBarFrame.timer:SetFont("Fonts\\ARIALN.ttf", 13, "THINOUTLINE")
  67. CastingBarFrame.timer:SetPoint("RIGHT", CastingBarFrame, "RIGHT", 24, 0)
  68. CastingBarFrame.update = 0.1
  69.  
  70. TargetFrameSpellBar.timer = TargetFrameSpellBar:CreateFontString(nil)
  71. TargetFrameSpellBar.timer:SetFont("Fonts\\ARIALN.ttf", 13, "THINOUTLINE")
  72. TargetFrameSpellBar.timer:SetPoint("RIGHT", TargetFrameSpellBar, "RIGHT", 24, 0)
  73. TargetFrameSpellBar.update = 0.1
  74.  
  75. FocusFrameSpellBar.timer = FocusFrameSpellBar:CreateFontString(nil)
  76. FocusFrameSpellBar.timer:SetFont("Fonts\\ARIALN.ttf", 13, "THINOUTLINE")
  77. FocusFrameSpellBar.timer:SetPoint("RIGHT", FocusFrameSpellBar, "RIGHT", 24, 0)
  78. FocusFrameSpellBar.update = 0.1
  79.  
  80. hooksecurefunc("CastingBarFrame_OnUpdate", function(self, elapsed)
  81.     if not self.timer then return end
  82.     if self.update and self.update < elapsed then
  83.         if self.casting then
  84.             self.timer:SetText(format("%.1f", max(self.maxValue - self.value, 0)))
  85.         elseif self.channeling then
  86.             self.timer:SetText(format("%.1f", max(self.value, 0)))
  87.         else
  88.             self.timer:SetText("")
  89.         end
  90.         self.update = 0.1
  91.     else
  92.         self.update = self.update - elapsed
  93.     end
  94. end)
  95.  
  96. --[[ Focus Castbar ]]
  97. FocusFrameSpellBar:SetScale("1.6")
  98. FocusFrameSpellBar:ClearAllPoints()
  99. FocusFrameSpellBar:SetPoint("CENTER", UIParent, "CENTER", 0, 150)
  100. --FocusFrameSpellBar.SetPoint = function() end -- TAINT
  101.  
  102. FocusFrameSpellBar:SetStatusBarColor(0,0.45,0.9)
  103. --FocusFrameSpellBar.SetStatusBarColor = function() end -- TAINT
  104.  
  105. --[[ Runebar ]]
  106. RuneFrame:ClearAllPoints()
  107. RuneFrame:SetPoint("CENTER",UIParent,"CENTER",0,-130)
  108. --RuneFrame.SetPoint = function() end -- TAINT
  109.  
  110. for i=1,6 do
  111.     _G["RuneButtonIndividual"..i]:SetScale("1.4")
  112.     _G["RuneButtonIndividual"..i]:ClearAllPoints()
  113. end
  114.  
  115. RuneButtonIndividual3:SetPoint("CENTER",-12,0)
  116. RuneButtonIndividual4:SetPoint("CENTER",12,0)
  117. RuneButtonIndividual2:SetPoint("RIGHT",RuneButtonIndividual3,"LEFT",-4,8)
  118. RuneButtonIndividual1:SetPoint("RIGHT",RuneButtonIndividual2,"LEFT",-4,8)
  119. RuneButtonIndividual5:SetPoint("LEFT",RuneButtonIndividual4,"RIGHT",4,8)
  120. RuneButtonIndividual6:SetPoint("LEFT",RuneButtonIndividual5,"RIGHT",4,8)
  121.  
  122. --[[ hiding pvp icon ]]
  123. PlayerPVPIcon:SetAlpha(0)
  124. TargetFrameTextureFramePVPIcon:SetAlpha(0)
  125.  
  126. --[[ Target and Focus HP-Text ]]
  127. local HealthBarFontStrings = {
  128.     player = PlayerFrameHealthBar.TextString,
  129.     target = TargetFrameHealthBar.TextString,
  130.     focus = FocusFrameHealthBar.TextString,
  131. }
  132.  
  133. -- This is massively wasteful, but I don't feel like fixing it for you:
  134. hooksecurefunc("TextStatusBar_UpdateTextStringWithValues", function(...)
  135.     for unit, text in pairs(HealthBarFontStrings) do
  136.         local Health = UnitHealth(unit))
  137.         local HealthMax = UnitHealthMax(unit)
  138.         local HealthPercent = Health / HealthMax * 100
  139.  
  140.         --Curr&MaxHP:
  141.         --text:SetFormattedText("%s/%s (%d%%)", AbbreviateLargeNumbers(Health), AbbreviateLargeNumbers(HealthMax), HealthPercent)
  142.  
  143.         text:SetFormattedText("%s (%d%%)", AbbreviateLargeNumbers(Health), HealthPercent)
  144.     end
  145. end)
  146.  
  147. -- This is massively wasteful, but I don't feel like fixing it for you:
  148. hooksecurefunc("TextStatusBar_UpdateTextStringWithValues", function()
  149.     PlayerFrameManaBar.TextString:SetText(AbbreviateLargeNumbers(UnitPower("player")))
  150.     TargetFrameManaBar.TextString:SetText(AbbreviateLargeNumbers(UnitPower("target")))
  151.     FocusFrameManaBar.TextString:SetText(AbbreviateLargeNumbers(UnitPower("focus")))
  152. end)
  153.  
  154. --[[ hiding combat text ]]
  155. PetHitIndicator:ClearAllPoints()
  156. PlayerHitIndicator:ClearAllPoints()
  157.  
  158. --[[ Class Icons ]]
  159.  
  160. local UnitHasNoIcon = {
  161.     player = true,
  162.     pet = true,
  163.     partypet1 = true,
  164.     partypet2 = true,
  165.     partypet3 = true,
  166.     partypet4 = true,
  167. }
  168. hooksecurefunc(UnitFramePortrait_Update, function(self)
  169.     if self.portrait and not UnitHasNoIcon[self.unit] then
  170.         local _, class = UnitClass(self.unit)
  171.         local coords = CLASS_ICON_TCOORDS[class]
  172.         if coords then
  173.             self.portrait:SetTexture("Interface\\TargetingFrame\\UI-Classes-Circles")
  174.             self.portrait:SetTexCoord(unpack(coords))
  175.         end
  176.     end
  177. end)

On a side note, though, you should not actually be moving the default unit frames around using Lua like this. Just right-click on the frame in-game, select "Unlock Frame", drag the frame where you want it, right-click on it again, and select "Lock Frame". This feature was added to the game in Cataclysm.
__________________
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 : 10-23-12 at 07:19 PM.
  Reply With Quote
10-24-12, 09:55 AM   #5
Rufio
A Murloc Raider
 
Rufio's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 9
thanks a lot looks like the player and target setpoints where causing this error
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » ToT default UI Errors


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