add hooks framework and add hook for portal added (fixes #87)

This commit is contained in:
Stefan Breunig
2013-02-10 23:07:33 +01:00
parent d0df5b84a3
commit 1bbbe05a86
3 changed files with 55 additions and 0 deletions

View File

@ -20,3 +20,9 @@ Plugins may be developed in the same way as the total conversion script. Plugins
You can use the guess player level script as an example to get you started. Just update the names and the part between `// PLUGIN START` and `// PLUGIN END` and you should be able to develop your plugin. The other code ensures your plugin is executed after the main script.
If you happen the write general purpose functions for your plugin, consider adding them to the main script instead. For example, if you write a `getResoCountFromPortal(details)` function it may be very well added to `code/portal_info.js`.
Available Hooks
---------------
Available hooks are documented in the code. Please refer to the [boilerplate explanation in `hooks.js`](https://raw.github.com/breunigs/ingress-intel-total-conversion/gh-pages/code/hooks.js) to see which are available and how to listen for them. If you need additional hooks, open bug reports (preferably with patches attached).