ToME: the Tales of Maj'Eyal
http://forums.te4.org/

showResourceTooltip hook
http://forums.te4.org/viewtopic.php?f=45&t=37351
Page 1 of 1

Author:  desophos [ Sun Mar 24, 2013 11:29 pm ]
Post subject:  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:  nate [ Mon Mar 25, 2013 1:00 am ]
Post subject:  Re: showResourceTooltip hook

When I asked for a list, I got this url: http://git.develz.org/?p=tome.git&a=search&h=HEAD&st=grep&s=triggerHook -- 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!)

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/