ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Fri Nov 24, 2017 10:21 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: showResourceTooltip hook
PostPosted: Sun Mar 24, 2013 11:29 pm 
Offline
Cornac

Joined: Sun Jan 20, 2013 8:49 am
Posts: 33
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.


Top
 Profile  
 
PostPosted: Mon Mar 25, 2013 1:00 am 
Offline
Wyrmic

Joined: Fri Jan 18, 2013 8:35 am
Posts: 261
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!)

_________________
Proud father of Fx4fx and Chronometer add-ons; proud mother of Fated add-on


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group