Thread Tools Display Modes
01-14-16, 04:44 AM   #1
Lesteryoung
A Black Drake
Join Date: Aug 2015
Posts: 81
Troubleshooting a few errors.

I've been getting these few errors for a few weeks and it doesn't seem to effect much, but it's really annoying nonetheless and shouldn't be happening. Would appreciate if someone more knowledgeable than I could take a look.

The errors only happen in combat, and seem to happen more in groups.

Errors:

Lua Code:
  1. 4x [ADDON_ACTION_BLOCKED] AddOn 'Tweaks' tried to call the protected function 'Boss2TargetFrame:Hide()'.
  2. !BugGrabber\BugGrabber.lua:573: in function <!BugGrabber\BugGrabber.lua:573>
  3. [C]: in function `Hide'
  4. FrameXML\TargetFrame.lua:108: in function `TargetFrame_Update'
  5. FrameXML\TargetFrame.lua:174: in function `OnEvent'
  6. FrameXML\UnitFrame.lua:676: in function <FrameXML\UnitFrame.lua:674>
  7.  
  8.  
  9. 1x [ADDON_ACTION_BLOCKED] AddOn 'Tweaks' tried to call the protected function 'Boss2TargetFrame:Show()'.
  10. !BugGrabber\BugGrabber.lua:573: in function <!BugGrabber\BugGrabber.lua:573>
  11. [C]: in function `Show'
  12. FrameXML\TargetFrame.lua:110: in function `TargetFrame_Update'
  13. FrameXML\TargetFrame.lua:174: in function `OnEvent'
  14. FrameXML\UnitFrame.lua:676: in function <FrameXML\UnitFrame.lua:674>
  15.  
  16.  
  17. 1x [ADDON_ACTION_BLOCKED] AddOn 'Tweaks' tried to call the protected function 'CompactRaidFrame11:Show()'.
  18. !BugGrabber\BugGrabber.lua:573: in function <!BugGrabber\BugGrabber.lua:573>
  19. [C]: in function `Show'
  20. FrameXML\CompactUnitFrame.lua:290: in function `CompactUnitFrame_UpdateVisible'
  21. FrameXML\CompactUnitFrame.lua:248: in function <FrameXML\CompactUnitFrame.lua:246>
  22. [C]: in function `CompactUnitFrame_UpdateAll'
  23. FrameXML\CompactUnitFrame.lua:100: in function <FrameXML\CompactUnitFrame.lua:47>
  24.  
  25.  
  26. 8x FrameXML\UnitFrame.lua:410: Usage: GameTooltip:SetUnit("unit"[, hideStatus])
  27. [C]: in function `SetUnit'
  28. FrameXML\UnitFrame.lua:410: in function `UnitFrame_UpdateTooltip'
  29. FrameXML\UnitFrame.lua:396: in function <FrameXML\UnitFrame.lua:383>

Code:

Lua Code:
  1. -- red bars
  2.  
  3. hooksecurefunc('CooldownFrame_SetTimer', function(self) if self.currentCooldownType == COOLDOWN_TYPE_LOSS_OF_CONTROL then self:SetCooldown(0,0) end end)
  4.  
  5. -- no bling on GCD
  6.  
  7. for k,v in pairs(_G) do if type(v)=="table" and type(v.SetDrawBling)=="function" then v:SetDrawBling(false) end end
  8. hooksecurefunc(getmetatable(ActionButton1Cooldown).__index, 'SetCooldown', function(self) self:SetDrawBling(false) end)
  9.  
  10. --- percent hp on target frame
  11.  
  12. hooksecurefunc("TextStatusBar_UpdateTextStringWithValues",function(statusFrame, textString, value, valueMin, valueMax)
  13.  if valueMax == 0 then return end
  14.  if statusFrame.powerToken then return end
  15.  if string.find(statusFrame:GetName(),"PlayerFrame") == 1 then return end
  16.  if string.find(statusFrame:GetName(),"FocusFrame") == 1 then return end
  17.  if string.find(statusFrame:GetName(),"PetFrame") == 1 then return end
  18.  local unit = statusFrame:GetParent().unit
  19.  if unit and UnitIsDead(unit) then return end
  20.  textString:SetText(tostring(AbbreviateLargeNumbers(value)).." / "..tostring(AbbreviateLargeNumbers(valueMax)).." "..tostring(math.ceil((value / valueMax) * 100)).."%");
  21.  if(statusFrame.LeftText and statusFrame.RightText) then
  22.  statusFrame.LeftText:Hide();
  23.  statusFrame.RightText:Hide();
  24.  textString:Show();
  25.  end
  26. end)
  27.  
  28. function AbbreviateLargeNumbers(value)
  29.  local strLen = strlen(value);
  30.  local retString = value;
  31.  if ( strLen > 6 ) then
  32.  retString = string.sub(value, 1, -7)..SECOND_NUMBER_CAP;
  33.  elseif ( strLen > 4 ) then
  34.  retString = string.sub(value, 1, -4)..FIRST_NUMBER_CAP;
  35.  elseif (strLen > 3 ) then
  36.  retString = BreakUpLargeNumbers(value);
  37.  end
  38.  return retString;
  39. end
  40.  
  41. ---
  42.  
  43. -- /rl command in chat to Reload
  44.  
  45. SlashCmdList["RELOADUI"] = function() ReloadUI() end
  46.     SLASH_RELOADUI1 = "/rl"
  47.  
  48. -- /clear command to clear chat window
  49.  
  50. SlashCmdList["CLEAR"] = function()
  51.     SELECTED_CHAT_FRAME:Clear()
  52. end
  53.  
  54. -- /clearcombat
  55.  
  56. SlashCmdList["CLEARCOMBAT"] = function() CombatLogClearEntries() end
  57. SLASH_CLEARCOMBAT1 = "/clearcombat"
  58.  
  59. -- leaves group
  60.  
  61. SlashCmdList["LEAVEGROUP"] = function() LeaveParty() end
  62.     SLASH_LEAVEGROUP1 = "/lg"
  63.  
  64. -- Hides gryphons
  65.  
  66. MainMenuBarLeftEndCap:Hide()
  67. MainMenuBarRightEndCap:Hide()
  68.  
  69. -- No delay on Combo points
  70.  
  71. COMBOFRAME_FADE_IN = 0
  72. COMBOFRAME_FADE_OUT = 0
  73. COMBOFRAME_SHINE_FADE_IN = 0
  74. COMBOFRAME_SHINE_FADE_OUT = 0
  75. COMBOFRAME_HIGHLIGHT_FADE_IN = 0
  76.  
  77. -- Hide minimap zoom icons, enable scroll wheel zooming
  78.  
  79. MinimapZoomIn:Hide()
  80. MinimapZoomOut:Hide()
  81.  
  82.     Minimap:EnableMouseWheel(true)
  83.     Minimap:SetScript('OnMouseWheel', function(self, arg1)
  84.         if arg1 > 0 then
  85.             Minimap_ZoomIn()
  86.         else
  87.             Minimap_ZoomOut()
  88.         end
  89.     end)
  90.  
  91. -- loot money
  92.  
  93. local f = CreateFrame("Frame")
  94. f:RegisterEvent("LOOT_OPENED")
  95. f:SetScript("OnEvent", function(self, event, ...)
  96.     for i = GetNumLootItems(), 1, -1 do
  97.         local slotType = GetLootSlotType(i)
  98.         local _, _, _, _, locked, isQuestItem = GetLootSlotInfo(i)
  99.         if not locked and (slotType == LOOT_SLOT_MONEY or slotType == LOOT_SLOT_CURRENCY) then
  100.             LootSlot(i)
  101.         end
  102.     end
  103. end)
  104.  
  105. -- adds caster of buffs/debuffs to their tooltips
  106.  
  107. hooksecurefunc(GameTooltip,"SetUnitAura",function(self,unit,index,filter)
  108.  local caster = select(8,UnitAura(unit,index,filter))
  109.  if caster and UnitExists(caster) then
  110.  GameTooltip:AddLine("Cast by: "..UnitName(caster),.65,.85,1,1)
  111.  GameTooltip:Show()
  112.  end
  113. end)
  114.  
  115. -- disable healing prediction
  116.  
  117. local oldfunc=CompactUnitFrameUtil_UpdateFillBar;
  118. function CompactUnitFrameUtil_UpdateFillBar(frame,previous,bar,...)
  119.     if bar==frame.myHealPrediction or bar==frame.otherHealPrediction then
  120.         return previous;
  121.     end
  122.  
  123.     return oldfunc(frame,previous,bar,...);
  124. end
  125.  
  126. hooksecurefunc("CompactUnitFrame_SetUpFrame",function(frame)
  127.     frame.myHealPrediction:Hide();
  128.     frame.otherHealPrediction:Hide();
  129. end);
  130.  
  131. -- repair
  132.  
  133. local f = CreateFrame'Frame'
  134. f:RegisterEvent'MERCHANT_SHOW'
  135. f:SetScript('OnEvent', function()
  136.     local cost, canRepair = GetRepairAllCost()
  137.     if canRepair and GetMoney() > cost then
  138.         ChatFrame1:AddMessage('Your items have been repaired for '..GetCoinText(cost, ", ")..".", 1, 1, 0)
  139.         RepairAllItems()
  140.     end
  141. end)
  142.  
  143. --- tooltip stuff
  144.  
  145. local SET_TEXT = TARGET .. ": |cff%02x%02x%02x%s|r"
  146. local MATCH_TEXT = "^" .. TARGET
  147.  
  148. local last
  149. GameTooltip:HookScript("OnUpdate", function(self)
  150.     local name = UnitName("mouseovertarget")
  151.     if not name or name == "" then return end
  152.     last = name
  153.  
  154.     local r, g, b
  155.     if UnitIsPlayer("mouseovertarget") then
  156.         local _, class = UnitClass("mouseovertarget")
  157.         local color = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
  158.         r, g, b = color.r, color.g, color.b
  159.     else
  160.         r, g, b = GameTooltip_UnitColor("mouseovertarget")
  161.     end
  162.  
  163.     for i = 2, self:NumLines() do
  164.         local line = _G["GameTooltipTextLeft"..i]
  165.         if strfind(line:GetText() or "", MATCH_TEXT) then
  166.             line:SetFormattedText(SET_TEXT, r * 255, g * 255, b * 255, name)
  167.             return self:Show()
  168.         end
  169.     end
  170.     self:AddLine(format(SET_TEXT, r * 255, g * 255, b * 255, name))
  171.     self:Show()
  172. end)
  173.  
  174. -- color
  175.  
  176. GameTooltip:HookScript("OnTooltipSetUnit", function(GameTooltip)
  177.     local _, unit = GameTooltip:GetUnit()
  178.     if UnitIsPlayer(unit) then
  179.         local _, class = UnitClass(unit)
  180.         local color = class and (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class]
  181.         if color then
  182.             local text = GameTooltipTextLeft1:GetText()
  183.             GameTooltipTextLeft1:SetFormattedText("|cff%02x%02x%02x%s|r", color.r * 255, color.g * 255, color.b * 255, text:match("|cff\x\x\x\x\x\x(.+)|r") or text)
  184.         end
  185.     end
  186. end)
  187.  
  188. --- class color on unit frames
  189.  
  190. local frame = CreateFrame("FRAME")
  191. frame:RegisterEvent("GROUP_ROSTER_UPDATE")
  192. frame:RegisterEvent("PLAYER_TARGET_CHANGED")
  193. frame:RegisterEvent("PLAYER_FOCUS_CHANGED")
  194. frame:RegisterEvent("UNIT_FACTION")
  195.  
  196. local function eventHandler(self, event, ...)
  197.         if UnitIsPlayer("target") then
  198.                 local c = RAID_CLASS_COLORS[select(2, UnitClass("target"))]
  199.                 if c then
  200.                     TargetFrameNameBackground:SetVertexColor(c.r, c.g, c.b)
  201.                 end
  202.         end
  203.         if UnitIsPlayer("focus") then
  204.                 local c = RAID_CLASS_COLORS[select(2, UnitClass("focus"))]
  205.                 if c then
  206.                     FocusFrameNameBackground:SetVertexColor(c.r, c.g, c.b)
  207.                 end
  208.         end
  209. end
  210.  
  211. frame:SetScript("OnEvent", eventHandler)
  212.  
  213. for _, BarTextures in pairs({TargetFrameNameBackground, FocusFrameNameBackground}) do
  214.         BarTextures:SetTexture("Interface\\TargetingFrame\\UI-StatusBar")
  215. end
  216.  
  217. local fontStrings = {
  218.     PlayerName,
  219.  
  220.     TargetFrameTextureFrameName,
  221.     TargetFrameTextureFrameDeadText,
  222.  
  223.     FocusFrameTextureFrameName,
  224.     FocusFrameTextureFrameDeadText
  225. }
  226.  
  227. for _, v in pairs(fontStrings) do
  228.     v:SetFont("Fonts\\FRIZQT__.TTF", 10, "OUTLINE")
  229.     v:SetShadowOffset(0, 0)
  230.     v:SetTextColor(1,.92,0)
  231. end
  232.  
  233. TargetFrameTextureFrameName:SetWidth(117)
  234. TargetFrameToTTextureFrameName:SetWidth(64)
  235.  
  236. FocusFrameTextureFrameName:SetWidth(117)
  237. FocusFrameToTTextureFrameName:SetWidth(64)
  238.  
  239. local fontStrings = {
  240.     TargetFrameToTTextureFrameName,
  241.     FocusFrameToTTextureFrameName
  242. }
  243.  
  244. for _, v in pairs(fontStrings) do
  245.     v:SetTextColor(1,.92,0)
  246. end

Last edited by Lesteryoung : 01-14-16 at 04:49 AM.
  Reply With Quote
01-14-16, 07:24 AM   #2
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
You overwrite the following global functions and values which blizzard uses in the interface; every time a blizzard function tries to use the value you replaced it taints the rest of what that function does, preventing it from executing anything that would normally be restricted in combat.
  • AbbreviateLargeNumbers
  • CompactUnitFrameUtil_UpdateFillBar
  • COMBOFRAME_FADE_IN
  • COMBOFRAME_FADE_OUT
  • COMBOFRAME_SHINE_FADE_IN
  • COMBOFRAME_SHINE_FADE_OUT
  • COMBOFRAME_HIGHLIGHT_FADE_IN
  Reply With Quote
01-14-16, 07:29 AM   #3
Lesteryoung
A Black Drake
Join Date: Aug 2015
Posts: 81
Is there anyway to safely execute those functions? I like what that stuff is doing, but not that it's causing taint.
  Reply With Quote
01-14-16, 07:45 AM   #4
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Originally Posted by Lesteryoung View Post
Is there anyway to safely execute those functions? I like what that stuff is doing, but not that it's causing taint.
You'll have to securely hook the affected functions and perform the altered behaviour yourself.
__________________
Grab your sword and fight the Horde!
  Reply With Quote
01-14-16, 02:07 PM   #5
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
He's altering the returns of the functions, which can't be done with a secure hook.
__________________
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
01-16-16, 05:59 AM   #6
Lesteryoung
A Black Drake
Join Date: Aug 2015
Posts: 81
Originally Posted by SDPhantom View Post
He's altering the returns of the functions, which can't be done with a secure hook.
So, is there anyway I can perform those functions without getting error spammed?
  Reply With Quote
01-16-16, 08:01 AM   #7
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Originally Posted by Lesteryoung View Post
So, is there anyway I can perform those functions without getting error spammed?
Yes, instead of pre-hooking the functions like you're doing (overwriting the original function) you can post-hook them and "fix" what the original function changed after it's finished.

First, I assume you can just get rid of your CompactUnitFrameUtil_UpdateFillBar hook since "Display Incoming Heals" is something you can turn off under Raid Profiles in the interface.

For AbbreviateLargeNumbers, since you're already hooking "TextStatusBar_UpdateTextStringWithValues" and that seems to be the only place that function is even used, you could make it a local function and move it above your hook.

I don't think your combo point hack is causing any errors since that frame isn't touching anything secure, but if it is I would probably unregister the events from the original frame (ComboFrame:UnregisterEvent('UNIT_COMBO_POINTS') ComboFrame:UnregisterEvent('PlayerTargetChanged')) and create my own event handler for it that shows and hides the frames immediately.

You would essentially copy the update function from ComboFrame.lua, except without all the fading stuff.
  Reply With Quote
01-16-16, 09:58 AM   #8
Lesteryoung
A Black Drake
Join Date: Aug 2015
Posts: 81
Someone on here made the CompactUnitFrameUtil_UpdateFillBar for me because "display incoming healing" in the raid options also controls the display of absorbs. So I wanted to keep absorbs but remove the incoming healing overlay.

I should note that I didn't write any of this code. Well, actually, I managed to piece together the slash commands, but that's it. The rest is an amalgam of stuff I've found on the internet.

I'm not sure what you mean by "moving it above". I understand hook and local.
  Reply With Quote
01-16-16, 10:50 AM   #9
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Originally Posted by Lesteryoung View Post
I'm not sure what you mean by "moving it above". I understand hook and local.
Cut your AbbreviateLargeNumbers function and paste it above your "TextStatusBar_UpdateTextStringWithValues" hook and put the word "local" in front of the function. It has to be written before the hook because you're calling the function from it, if you make it local and leave it after the hook it's going to use the original AbbreviateLargeNumbers instead of yours.

To hide the heal predictions you can probably do something like this after you comment out or delete your current hook.
Lua Code:
  1. hooksecurefunc('CompactUnitFrame_UpdateHealPrediction', function(frame)
  2.     frame.myHealPrediction:Hide()
  3.     frame.otherHealPrediction:Hide()
  4. end)
  Reply With Quote
01-16-16, 12:12 PM   #10
Lesteryoung
A Black Drake
Join Date: Aug 2015
Posts: 81
I moved the AbbreviateLargeNumbers function and it's working fine, but it's not applying to my Focus Frame anymore. Only the Target Frame.

And the new function you gave to hide healing prediction works, error free, but unlike the other one I had, this function leaves a black blank spot where the overlay used to be.
  Reply With Quote
01-16-16, 12:31 PM   #11
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Your hook explicitly ignores the PlayerFrame, FocusFrame and PetFrame; if you want it to display the same way as your target frame then just remove if string.find(statusFrame:GetName(),"FocusFrame") == 1 then return end, if you want it to do something differently you'll need to write an exception for it.

I'll have to think about what the best solution for the healing prediction is, since it's probably going to display the absorbs in the wrong spot if it thinks there are incoming heals.

Last edited by semlar : 01-16-16 at 12:37 PM.
  Reply With Quote
01-16-16, 12:49 PM   #12
Lesteryoung
A Black Drake
Join Date: Aug 2015
Posts: 81
The other code I had did simply ignore the healing prediction and didn't show it at all. But it spammed the aforementioned errors.
  Reply With Quote
01-18-16, 01:02 PM   #13
Lesteryoung
A Black Drake
Join Date: Aug 2015
Posts: 81
BUMP

Anyone know of a way to do

Code:
local oldfunc=CompactUnitFrameUtil_UpdateFillBar;
function CompactUnitFrameUtil_UpdateFillBar(frame,previous,bar,...)
    if bar==frame.myHealPrediction or bar==frame.otherHealPrediction then
        return previous;
    end
 
    return oldfunc(frame,previous,bar,...);
end
 
hooksecurefunc("CompactUnitFrame_SetUpFrame",function(frame)
    frame.myHealPrediction:Hide();
    frame.otherHealPrediction:Hide();
end);
without getting action blocked errors?
  Reply With Quote
01-18-16, 09:39 PM   #14
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
Originally Posted by semlar View Post
Lua Code:
  1. hooksecurefunc('CompactUnitFrame_UpdateHealPrediction', function(frame)
  2.     frame.myHealPrediction:Hide()
  3.     frame.otherHealPrediction:Hide()
  4. end)
I looked at this as an idea when asked about this before and saw the problem that the original function doesn't check if these are hidden. Since these bars don't overlap and are always rendered with one starting at the end of the previous one, this will cause a gap to show when you have an absorb and an incoming heal at the same time.
__________________
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 : 01-18-16 at 09:41 PM.
  Reply With Quote
01-19-16, 11:26 AM   #15
Lesteryoung
A Black Drake
Join Date: Aug 2015
Posts: 81
Originally Posted by SDPhantom View Post
I looked at this as an idea when asked about this before and saw the problem that the original function doesn't check if these are hidden. Since these bars don't overlap and are always rendered with one starting at the end of the previous one, this will cause a gap to show when you have an absorb and an incoming heal at the same time.
The code you gave solves this problem, but it also error spams for some reason.
  Reply With Quote
01-19-16, 12:48 PM   #16
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
I'm not sure what it could be doing to spread taint, but if it really is, then there's nothing that can be done to fix it other than replacing the entire set of unitframes with a custom UI and tweak that if needed.
__________________
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
01-19-16, 05:14 PM   #17
Lesteryoung
A Black Drake
Join Date: Aug 2015
Posts: 81
Originally Posted by SDPhantom View Post
I'm not sure what it could be doing to spread taint, but if it really is, then there's nothing that can be done to fix it other than replacing the entire set of unitframes with a custom UI and tweak that if needed.
Well, thanks for your help. Maybe there will be better raid frame options in Legion.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Troubleshooting a few errors.

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