Я хотел исправить ошибку lua в моем дополнении TukUI GameTooltip:SetPoint(): Couldn't find region named '(null)'
. Это происходит, когда включены два моих аддона: TukUI (modded) и LKAnnounce. Если я отключу LKAnnounce, ошибка исчезнет. Я читал, что вы не можете просто отладить код lua в WoW, потому что вас могут забанить при подключении отладчика. Единственное, о чем я могу думать, это использовать print
звонки. Это немного странно, но это сообщение об ошибке исчезает, если я перезагружаю свой интерфейс (/ reload). Может ли это быть связано с последовательностью загрузки AddOn?
Моя цель - определить проблему самостоятельно и устранить ее. Я нашел этот API здесь: https://wowwiki.fandom.com/wiki/API_Region_SetPoint
Ссылка для дополнений: https://easyupload.io/t90ozw (3.3.5)
Результат от отпечатков :
print(self) // nil
print(TukuiDB) // table: 1BDD81D0
Это сообщение об ошибке:
Message: Interface\AddOns\Tukui\datatext\system.lua:98: GameTooltip:SetPoint(): Couldn't find region named '(null)'
Time: 01/30/20 11:50:59
Count: 1
Stack: [C]: in function `SetPoint'
Interface\AddOns\Tukui\datatext\system.lua:98: in function <Interface\AddOns\Tukui\datatext\system.lua:94>
Locals: (*temporary) = GameTooltip {
updateTooltip = 0.12099999543279
SetInventoryItem = <function> defined @Interface\AddOns\GearScoreLite\GearScoreLite.lua:226
0 = <userdata>
comparing = false
shoppingTooltips = <table> {
}
}
(*temporary) = "BOTTOM"
(*temporary) = <table> {
ZOOMED_ICON_SMALL = ":12:12:0:0:64:64:4:60:4:60"
RemoveHealer = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:2650
ratio_to_hex_color = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:14
RemoveFromAssignments = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:3405
stuns = <table> {
}
HandleCombatMessage = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:3491
RemoveRotationSelect = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:2505
ReleaseUID = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:2361
UpdateRaidRoster = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:2814
debug = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:3
dec_to_hex_color = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:21
message = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:45
Announce_Slows = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:2715
AddHealer = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:2616
ValkyrTimeout = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:3635
CheckWipe = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:2963
AnnounceInfests = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:2576
possible_infests = <table> {
}
possible_aoe_stuns = <table> {
}
slows = <table> {
}
AddInfest = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:2513
shapes_sets = <table> {
}
StartEncounter = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:2969
ChatUpdate = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:299
possible_stuns = <table> {
}
GetDefaultOptions = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:4142
CheckInfestWasted = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:2470
PlagueExpired = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:3765
aoe_slows = <table> {
}
FlashScreen = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:2447
printraid = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:49
EndEncounter = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:2988
Set_Assignment = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:2492
pad = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:35
Announce_Trap_Hits = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:3770
LeftRaid = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:3004
AnnounceDPS = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:2552
DefaultOptions = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:4339
DefaultAssignments = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:4138
GetDefaultAssignments = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:4125
Handle_Valks = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:3819
RemoveRole = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:3200
AnnounceHealingAssignment = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:3476
Calculate_Plagues = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:3641
UpdateTarget = <function> defined @Interface\AddOns\LKAnnounce\LKAnnounce.lua:2887
Get_Assignment = <function>
AddOns \ Tukui \ datatext \ system. lua
Stat:SetScript("OnEnter", function()
if not InCombatLockdown() then
GameTooltip:SetOwner(this, "ANCHOR_TOP", 0, TukuiDB.Scale(6));
GameTooltip:ClearAllPoints()
GameTooltip:SetPoint("BOTTOM", self, "TOP", 0, TukuiDB.mult) --94 line
print(self) --nil
print(TukuiDB) --table: 1BDD81D0
GameTooltip:ClearLines()
GameTooltip:AddDoubleLine(tukuilocal.datatext_totalmemusage,formatMem(Total), 0.69, 0.31, 0.31,0.84, 0.75, 0.65)
GameTooltip:AddLine(" ")
for i = 1, #Memory do
if Memory[i][3] then
local red = Memory[i][2]/Total*2
local green = 1 - red
GameTooltip:AddDoubleLine(Memory[i][1], formatMem(Memory[i][2], false), 1, 1, 1, red, green+1, 0)
end
end
GameTooltip:Show()
end
end)
Я также читал эту статью : https://www.wowinterface.com/portal.php?id=460&a=faq&faqid=486 и я попробовал BugSack и BugGrabber, чтобы определить проблему. В нем говорится следующее:
1. 1x Tukui-1.44\datatext\system.lua:98: GameTooltip:SetPoint(): Couldn't find region named '(null)'
Tukui-1.44\datatext\system.lua:98: in function <Tukui\datatext\system.lua:94>
Locals:
formatMem = <function> @ Tukui\datatext\system.lua:16:
Total = 11453.549804688
Memory = <table> {
1 = <table> {}
2 = <table> {}
...
system. lua от строки 16 до строки 40:
local function formatMem(memory, color)
if color then
statColor = { "|cff"..colorme, "|r" }
else
statColor = { "", "" }
end
local mult = 10^1
if memory > 999 then
local mem = floor((memory/1024) * mult + 0.5) / mult
if mem % 1 == 0 then
return mem..string.format(".0 %smb%s", unpack(statColor))
else
return mem..string.format(" %smb%s", unpack(statColor))
end
else
local mem = floor(memory * mult + 0.5) / mult
if mem % 1 == 0 then
return mem..string.format(".0 %skb%s", unpack(statColor))
else
return mem..string.format(" %skb%s", unpack(statColor))
end
end
end