Dragooon

  • I can code! Really!
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,841
Optional hooks
« on June 5th, 2012, 10:13 AM »
Currently if a hook isn't present the plugin is unable to install. Perhaps there should be a third stage where the hook is optional. This can be used to provide optional support to plugins if available, otherwise that functionality will be disabled but other parts of the plugin can continue to function.
The way it's meant to be

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Optional hooks
« Reply #1, on June 5th, 2012, 12:40 PM »
Way ahead of you, when you declare the hook, add the optional parameter:

Code: [Select]
<function point="hookname" function="myfunction" filename="$plugindir/File" optional="yes" />

Registers the hook but doesn't enforce it as being absolutely required.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Dragooon

  • I can code! Really!
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,841
Re: Optional hooks
« Reply #2, on June 6th, 2012, 01:28 PM »
Oh damn, missed that while reading the source. Thanks!