Master and BidNotOpen are globals? any chance these are getting overwritten by another mod? or even blizzard?
you may want to put those debug print statements back in right at the top just to confirm if your hook is being called.
Well they are declared outside of the functions like this...
local Master = false;
local BidNotOpen = true;
Does that make them local to my addon? Because that was my intent. However, I have used debugs before to try to solve this issue. When it occurs my HandleModifiedItemClicks function is not called at all.
edit: Should they be declared DrunkardSK.Master and DrunkardSK.BidNotOpen?
Well they are declared outside of the functions like this...
local Master = false;
local BidNotOpen = true;
Does that make them local to my addon? Because that was my intent. However, I have used debugs before to try to solve this issue. When it occurs my HandleModifiedItemClicks function is not called at all.
edit: Should they be declared DrunkardSK.Master and DrunkardSK.BidNotOpen?
mine picks up all the lootable items when you loot and queues them up so ive no need to check for alt clicking on the loot slots themselves but if thats what youre doing it shouldnt be too hard to figure out what the frame is called and hook that as well (if the setitemref hook doesnt work for that)
The reason I am trying to use HandleModifiedItemClick is because that would make it usable on any item in any frame. If I wanted to use it for like orbs or something out of the guild bank. Also it is easy to get the itemlink from it.
k, so simple check to see if its being replaced by another mod.
add [FONT=Courier New]print( HandleModifiedItemClick )[/FONT] as the first line in your OnInitialize function
should print "function: xxxxxxxx"
and keep printing it every now and then (either in code or manually).
if it changes value then another mod just overwrote it and you need to figure out what you just did to cause that other mod to load at that point. im presuming its not loading at game load because your stuff does work for a while, its got to be a load on demand mod.
if it stays the same then theres an issue somewhere in your code that i cant see yet.
Heres something which should help finding out whats changing the function.
local mt = getmetatable(_G)
local function newnewindex(t, key, val)
if key == "HandleModifiedItemClick" then
print(debugstack(2))
end
t[key] = val
end
if mt then
if mt.__newindex then
local _mtnewindex = mt.__newindex
--pre hook newindex
function mt.__newindex(t, key, ...)
if key == "HandleModifiedItemClick" then
print(debugstack(2))
end
return _mtnewindex(t, key, ...)
end
else
mt.__newindex = newnewindex
end
else
setmetatable(_G, {__newindex = newnewindex})
end
Well Opie is the only other addon I have that hooks HandleModifiedItemClick. Here is the code for where that happens... It isn't in a function or anything just inside a "do"
do -- Hook linking buttons
local O_SetItemRef, O_SpellButton_OnModifiedClick, O_HandleModifiedItemClick, O_CompanionButton_OnModifiedClick =
SetItemRef, SpellButton_OnModifiedClick, HandleModifiedItemClick, CompanionButton_OnModifiedClick;
...
function HandleModifiedItemClick(...)
if IsModifiedClick("CHATLINK") and GetCurrentKeyBoardFocus() == RKCD_EntryMacro and type((...)) == "string" then
return RKC_HandleLink((...));
end
return O_HandleModifiedItemClick(...);
end
...
end
Could this be overwriting my hook? It is not obvious to me when this is called.
Well they are declared outside of the functions like this...
Does that make them local to my addon? Because that was my intent. However, I have used debugs before to try to solve this issue. When it occurs my HandleModifiedItemClicks function is not called at all.
edit: Should they be declared DrunkardSK.Master and DrunkardSK.BidNotOpen?
Yes.
Either way is fine.
The reason I am trying to use HandleModifiedItemClick is because that would make it usable on any item in any frame. If I wanted to use it for like orbs or something out of the guild bank. Also it is easy to get the itemlink from it.
just that ace itself will unhook all your securehooks when your ace based mod is disabled (or at least it used to, not sure if it still does)
edit: stupid bloody smilies.
Nope not disabling it.
k, so simple check to see if its being replaced by another mod.
add [FONT=Courier New]print( HandleModifiedItemClick )[/FONT] as the first line in your OnInitialize function
should print "function: xxxxxxxx"
and keep printing it every now and then (either in code or manually).
if it changes value then another mod just overwrote it and you need to figure out what you just did to cause that other mod to load at that point. im presuming its not loading at game load because your stuff does work for a while, its got to be a load on demand mod.
if it stays the same then theres an issue somewhere in your code that i cant see yet.
DrunkardSK: function: 1B2F19E8
To...
DrunkardSK: function: 4D1F71E0
Seems to only happen after zoning into a dungeon. Guess it is time to try to narrow that down more.
Won't work, as __newindex is only called when a new key is set, not when an already existing key is associated with a new value.
Could this be overwriting my hook? It is not obvious to me when this is called.
do you use AddonLoader? and is your mod setup for it?
are there other mods setup to use it and loading when you zone?
try temporarily moving addonloader to another directory outside of wow (you cant just disable it) and see if your hooks work again when you zone.
No I do not use AddonLoader.
After login...
Dump: value=issecurevariable("HandleModifiedItemClick")
[2]="OPie"
That was using SecureHook()... Using just Hook() I get...
Dump: value=issecurevariable("HandleModifiedItemClick")
[2]="DrunkardSK"
Dump: value=issecurevariable("HandleModifiedItemClick")
[1]=1
Also, it definitely happens on zoning into an instance... but not always.