|
||||||
| Lua Code Discussion You scared? Terrified. Mortified. Petrified. Stupefied... by [coding]. | ||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Newbie
Join Date: Nov 2009
Posts: 3
|
Hello, people out there
Im pretty new to addonprogramming, but i think i got the concepts pretty well now. But an Error of the BlizzardUI is bothering me, called: Message: ...face\AddOns\Blizzard_InspectUI\InspectGuildFram e.lua:18: Usage: GetGuildInfo("unit") I already spended a lot time searching for solutions on google, but i wasnt able to find any. I know that the Error is caused by my NotifyInspect() call, but i really cant see what to do against it. I securehooked the function to make sure its my own call I get the response of and I dealt with the inconsistence of the function too, using a queue. But this Error is still showing up, I heared about the Addon InspectFix which should fix this for all addons, but I cant really get its point in the code. So please, help me (I dont think that you will need my code for this, since its a trouble with some Blizz-stuff, but you can still request it from me, ofc) Another problem that i just discovered is that GetInventoryItemLink(name, slot) sometimes returns the mogged item, not the real one. But only sometimes. Last edited by gnomi123; 04-10-2012 at 07:47 AM. |
|
|
|
|
|
#2 |
|
Amazing Member
Join Date: Feb 2005
Posts: 1,076
|
__________________
In wizardry, one must often be willing to consider serendipitous events as unqualified successes. -Vaarsuvius |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Nov 2009
Posts: 3
|
Like I said, I know that addon. But I would like to know what its code does to avoid it, exactly. And I cant force everyone who uses my addon to install InspectFix too, can I?
As a workaround, I simply used SetCVar("ScriptErrors", "0") to prevent any luaerrors to show up. What still is remaining is the problem that - sometimes - Im not getting back the real item, but the mogged one. Is there any way to prevent this? |
|
|
|
|
|
#4 | ||
|
Legendary Member
Join Date: May 2006
Posts: 6,572
|
Quote:
Quote:
|
||
|
|
|
|
|
#5 |
|
Full Member
Join Date: Dec 2008
Location: The Netherlands
Posts: 248
|
I don't know what InspectFix does exactly, but ..
in one of my addons I use a workaround, by setting InspectFrame.unit to yourself This should at least prevent InspectGuildFrame_Update() line 18 from giving an error Setting it to "player" should be safer than e.g. "none", "target" or the applicable unit id, since otherwise it still has a chance to give an error a bit further up at line 25 The idea is that it doesn't really matter what unit id it's set to, as long as it won't give an error, and since there isn't any actual inspecting going on anyway
Code:
if CanInspect(unit) then if InspectFrame then if not InspectFrame:IsShown() then InspectFrame.unit = "player" NotifyInspect(unit) end else NotifyInspect(unit) end end Edit: It seems this bug will be fixed in MoP (5.0.1.15589) AddOns/Blizzard_InspectUI/InspectGuildFrame.lua Line 7 Last edited by Ketho; 04-13-2012 at 01:11 AM. |
|
|
|
|
|
#6 |
|
Moderator
|
...which makes any other AddOn your users have installed do the same. Ugh.
__________________
Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes". Author/Maintainer of Archy, Ackis Recipe List, Revelation, Spamalyzer, Volumizer, and many other AddOns. |
|
|
|
|
|
#7 |
|
Newbie
Join Date: Nov 2009
Posts: 3
|
Thanks a lot, Ketho. That is the answer I needed.
The remaining problem is, that GetInventoryItemLink(name, slot) sometimes returns the item which was used for mogging, not the one with the right stats. Does someone know how to deal with that? |
|
|
|
|
|
#8 | |
|
Junior Member
Join Date: Dec 2007
Posts: 60
|
Quote:
__________________
Author/maintainer of BigBrother, ProfessionsVault, InspectFix, RetardCheck, RoleIcons, SavedInstances and others.. |
|
|
|
|
|
|
#9 |
|
Seal Cub Clubbing Club
Join Date: May 2005
Location: California, US
Posts: 7,758
|
Less dangerous than setting the ScriptErrors cvar to 0... at least if you break the inspect frame, the problem is obvious to you (and your users). If you simply hide the problem, it becomes much more difficult to even tell that a problem is happening at all.
Plus, even if you interfere with other inspect addons, I'd have to say that's better than hiding errors from all addons, most of which have nothing to do with inspecting.
__________________
& Author/maintainer of Grid, PhanxChat, and many more. | PM me on CurseForge Troubleshoot an addon | Turn any code into an addon | More addon resources Need help with your code? Attach or paste your whole, real files. Please don't PM me about addon bugs, requests, or code help. Post a comment, ticket, or thread instead! |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Dec 2007
Posts: 60
|
Yes, that goes without saying - ScriptErrors is a user setting, one that addons have no business changing without the user's consent.
__________________
Author/maintainer of BigBrother, ProfessionsVault, InspectFix, RetardCheck, RoleIcons, SavedInstances and others.. |
|
|
|
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
All times are GMT. The time now is 11:44 PM.
WowAce Forums








