魔兽世界 API 设定点 API "Couldn't find region named '(null)'"



我想修复我的 TukUI 插件GameTooltip:SetPoint(): Couldn't find region named '(null)'中的 lua 错误。当我的两个插件打开时,就会发生这种情况:TukUI(修改后(和LKAnnounce。如果我关闭LKAnnounce,错误就会消失。我读到你不能简单地在WoW中调试lua代码,因为你可能会在附加调试器时被禁止。我唯一能想到的就是使用print调用。这有点奇怪,但是如果我重新加载UI(/reload(,该错误消息就会消失。它可能与附加组件加载顺序有关吗?

我的目标是自己确定问题并解决问题。我在这里找到了那个 API:https://wowwiki.fandom.com/wiki/API_Region_SetPoint

附加组件的链接:https://easyupload.io/t90ozw (3.3.5(

打印结果:

print(self) // nil
print(TukuiDB) // table: 1BDD81D0

这是错误消息:

Message: InterfaceAddOnsTukuidatatextsystem.lua:98: GameTooltip:SetPoint(): Couldn't find region named '(null)'
Time: 01/30/20 11:50:59
Count: 1
Stack: [C]: in function `SetPoint'
InterfaceAddOnsTukuidatatextsystem.lua:98: in function <InterfaceAddOnsTukuidatatextsystem.lua:94>
Locals: (*temporary) = GameTooltip {
updateTooltip = 0.12099999543279
SetInventoryItem = <function> defined @InterfaceAddOnsGearScoreLiteGearScoreLite.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 @InterfaceAddOnsLKAnnounceLKAnnounce.lua:2650
ratio_to_hex_color = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:14
RemoveFromAssignments = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:3405
stuns = <table> {
}
HandleCombatMessage = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:3491
RemoveRotationSelect = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:2505
ReleaseUID = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:2361
UpdateRaidRoster = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:2814
debug = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:3
dec_to_hex_color = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:21
message = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:45
Announce_Slows = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:2715
AddHealer = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:2616
ValkyrTimeout = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:3635
CheckWipe = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:2963
AnnounceInfests = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:2576
possible_infests = <table> {
}
possible_aoe_stuns = <table> {
}
slows = <table> {
}
AddInfest = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:2513
shapes_sets = <table> {
}
StartEncounter = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:2969
ChatUpdate = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:299
possible_stuns = <table> {
}
GetDefaultOptions = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:4142
CheckInfestWasted = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:2470
PlagueExpired = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:3765
aoe_slows = <table> {
}
FlashScreen = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:2447
printraid = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:49
EndEncounter = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:2988
Set_Assignment = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:2492
pad = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:35
Announce_Trap_Hits = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:3770
LeftRaid = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:3004
AnnounceDPS = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:2552
DefaultOptions = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:4339
DefaultAssignments = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:4138
GetDefaultAssignments = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:4125
Handle_Valks = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:3819
RemoveRole = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:3200
AnnounceHealingAssignment = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:3476
Calculate_Plagues = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.lua:3641
UpdateTarget = <function> defined @InterfaceAddOnsLKAnnounceLKAnnounce.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.44datatextsystem.lua:98: GameTooltip:SetPoint(): Couldn't find region named '(null)'
Tukui-1.44datatextsystem.lua:98: in function <Tukuidatatextsystem.lua:94>
Locals:
formatMem = <function> @ Tukuidatatextsystem.lua:16:
Total = 11453.549804688
Memory = <table> {
1 = <table> {}
2 = <table> {}
...

系统.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

问题:游戏工具提示:SetPoint(( 从魔兽世界 8.2 开始受到保护以防止作弊。

详细信息:此插件试图通过手动将锚点重新定位到其他地方来覆盖 GameTooltip:SetOwner(( 的行为,该行为仅呈现了两行。 它通过清除所有点(第 93 行(并手动分配一个点(第 94 行(来实现此目的。

假设:SetPoint 命令最初是在 WoW 8.2 之前正确完成的,这意味着 TukuiDB.mult 旨在作为工具提示的数字 y 偏移量。

解决方案:将第 92 行到 94 行替换为单个命令。

GameTooltip:SetOwner(self, "ANCHOR_TOP", 0, TukuiDB.mult)

引用:

  • 哇百科
  • 凯瓦克斯,19年6月19日,阿兹沙拉崛起的UI变化

相关内容

  • 没有找到相关文章

最新更新