showResourceTooltip hook

Moderator: Moderator

Post Reply
Message
Author
desophos
Cornac
Posts: 33
Joined: Sun Jan 20, 2013 8:49 am

showResourceTooltip hook

#1 Post by desophos »

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.

nate
Wyrmic
Posts: 261
Joined: Fri Jan 18, 2013 8:35 am

Re: showResourceTooltip hook

#2 Post by nate »

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!)
Proud father of Fx4fx and Chronometer add-ons; proud mother of Fated add-on

Post Reply