functionCommandUnBotSetting(index) UnBotHideAllSubFrame(); UnBotCloseAllBagsFrame(); OnlineFrame:Hide(); NPCFrame:Hide(); if ( InspectFrame:IsShown()) then DisplayInfomation("InspectFrame_Show "..UnitName(InspectFrame.unit)..", Name "..InspectFrame:GetName()); end end
直接改成下面代码
1 2 3
if (InspectFrame and InspectFrame:IsShown()) then DisplayInfomation("InspectFrame_Show "..UnitName(InspectFrame.unit)..", Name "..InspectFrame:GetName()); end
然后是这个函数被作者注释掉了,但是却还有引用:
1 2 3 4 5 6 7 8 9 10 11
functionInspectFrame_Show(unit) HideUIPanel(InspectFrame); if ( CanInspect(unit, true) ) then NotifyInspect(unit); InspectFrame.unit = unit; InspectSwitchTabs(1); ShowUIPanel(InspectFrame); InspectFrame_UpdateTalentTab(); DisplayInfomation("InspectFrame_Show "..UnitName(unit)); end end
这里起初我也不太懂,但是如果只是把调用点全部去除的话 查看机器人装备的功能就失效了。这时候就只能祭出我正常多年的魔兽世界编程宝典 - World of Warcraft Programming: A Guide and Reference for Creating WoW Addons 同时也全局搜索了下现有的多玩插件与大脚插件相关内容,发现这个InspectFrame 其实就是装备查看的UI框架。同时在多玩中的DuowanMove 插件发现了这些框架是按需加载的
IsAddOnLoaded Returns whether an addon is currently loaded. loaded = IsAddOnLoaded(“name“) or IsAddOnLoaded(index) Arguments: name—Name of an addon (name of the addon’s folder and TOC file, not the Title found in the TOC) (string) index—Index of an addon in the addon list (between 1 and GetNumAddOns()) (number) Returns: loaded—1 if the addon is loaded; otherwise nil (1nil)
functionInspectFrame_Show(unit) if(InspectFrame) then DoInspectFrameShow(unit); else if( IsAddOnLoaded("Blizzard_InspectUI") == nil) then localloaded, reason = LoadAddOn("Blizzard_InspectUI"); if( loaded == nil) then DisplayInfomation("窗口初始化失败:"..reason); else DoInspectFrameShow(unit); end end end end
functionDoInspectFrameShow(unit) if(InspectFrame) then HideUIPanel(InspectFrame); if ( CanInspect(unit, true) ) then NotifyInspect(unit); InspectFrame.unit = unit; InspectSwitchTabs(1); ShowUIPanel(InspectFrame); InspectFrame_UpdateTalentTab(); DisplayInfomation("InspectFrame_Show "..UnitName(unit)); end end end