showResourceTooltip hook
Moderator: Moderator
showResourceTooltip hook
showResourceTooltip() in Minimalist.lua needs a hook to allow hiding of custom resources. A list of available hooks would also be nice.
Author of the Glutton class.
Re: showResourceTooltip hook
When I asked for a list, I got this url: http://git.develz.org/?p=tome.git&a=sea ... riggerHook -- and it has been a very handy url.
At least with showResourceTooltip, you can superload it to call a function accepting the list-- like:
if _M.editList then local base_editList = _M.editList end
function _M:editList(list)
list[#list+1] = "my edit"
if base_editList then base_editList(self,list) end
end
That way, even though you're replacing the showResourceTooltip function whole, at least everybody that does it the same way can coexist happily. I've been doing something very similar to add items to the main game menu.
EDIT: Or of course you could just all superload the function to call a hook, exactly where it'd be called in the svn, which would of course be a lot smarter. I just did things that way because I was uncomfortable with hooks (but man did I think I was clever pulling that off!)
At least with showResourceTooltip, you can superload it to call a function accepting the list-- like:
if _M.editList then local base_editList = _M.editList end
function _M:editList(list)
list[#list+1] = "my edit"
if base_editList then base_editList(self,list) end
end
That way, even though you're replacing the showResourceTooltip function whole, at least everybody that does it the same way can coexist happily. I've been doing something very similar to add items to the main game menu.
EDIT: Or of course you could just all superload the function to call a hook, exactly where it'd be called in the svn, which would of course be a lot smarter. I just did things that way because I was uncomfortable with hooks (but man did I think I was clever pulling that off!)