So, I have two addons that people here/WoW forums made for me.
One shows basic health information for enemies (in a more simplified manner than the default Blizzard way), and the other hides my focus target. (So I don't have an extra character panel on my screen when I have a focus target).
However, ever since 7.0, I've had the whole "Your addons are causing a lot of LUA errors, which may be slowing down your system" issue. I narrowed it down to just these two addons, when I disabled everything but just them. I was hoping someone might be able to take a look and see what might be causing them? They work perfectly fine but the error pop up is annoying. :/
Health one, (Treeston, <3 You've made/remade this one for me like 3 times xD)
Code:
local function round(num, places)
return tonumber(string.format("%."..(places or 0).."f",num))
end
local function short(num)
if num > 10000000 then
return round(num/1000000, 1).."m"
elseif num > 10000 then
return round(num/1000, 1).."k"
else
return num
end
end
TFUtils = CreateFrame("Frame")
--force target frame health text to show
local tftfhbt = TargetFrameTextureFrameHealthBarText
local tfh = tftfhbt.Hide
local tfs = tftfhbt.Show
local tfs2 = function(self) self:SetAlpha(1) tfs(self) end
local tfh2 = function(self) self:SetAlpha(1) tfs(self) end
local tfst = tftfhbt.SetText
function tftfhbt:SetText()
if UnitExists("target") then
local uh, uhm = UnitHealth("target"), UnitHealthMax("target")
local pct = round(uh/uhm*100, 1)
tfst(self, short(uh).."/"..short(uhm).." ("..pct.."%)")
else
tfst(self, "")
end
end
local emptyfunc = function() end
local tftfmbt = TargetFrameTextureFrameManaBarText
local tfms = tftfmbt.Show
local tfms2 = function(self) self:SetAlpha(1) tfms(self) end
local tfmh2 = function(self) self:SetAlpha(1) tfms(self) end
local tfmst = tftfmbt.SetText
function tftfmbt:SetText()
if UnitExists("target") and UnitPowerMax("target")>0 then
local up, upm = UnitPower("target"), UnitPowerMax("target")
local pct = round(up/upm*100, 1)
tfmst(self, short(up).."/"..short(upm).." ("..pct.."%)")
else
tfmst(self, "")
end
end
TFUtils:SetScript("OnEvent", function()
--[[tftfhbt.Hide = UnitCanAttack("player", "target") and tfh2 or tfh
tftfhbt.Show = UnitCanAttack("player", "target") and tfs2 or tfs--]]
tftfhbt.Hide = tfh2
tftfhbt.Show = tfs2
--tftfhbt[(UnitCanAttack("player", "target") or tftfhbt:GetParent():IsMouseOver()) and "Show" or "Hide"](tftfhbt)
tftfhbt:Show()
if not UnitCanAttack("player", "target") then
tftfhbt:SetAlpha(1)
end
if not tftfhbt:GetParent():IsMouseOver() then
tftfhbt:Hide()
end
tftfmbt.Hide = tfmh2
tftfmbt.Show = tfms2
tftfmbt[(UnitCanAttack("player", "target") or tftfmbt:GetParent():IsMouseOver()) and "Show" or "Hide"](tftfmbt)
tftfmbt:Show()
if not UnitCanAttack("player", "target") then
tftfmbt:SetAlpha(1)
end
if not tftfmbt:GetParent():IsMouseOver() then
tftfmbt:Hide()
end
end)
TFUtils:RegisterEvent("UNIT_FACTION")
TFUtils:RegisterEvent("PLAYER_TARGET_CHANGED")
And the Focus Target one: (which I highly doubt is the culprit, as well, it's really small lol)
Code:
-- This file is loaded from "FocusHide.toc"
RegisterStateDriver(FocusFrame,"visibility","hide")
FocusFrame:UnregisterAllEvents()