document that enableable scripts must also be modules

develop
Myk Taylor 2023-01-16 13:53:16 -08:00
parent 9c36c3978f
commit e98271ddc3
No known key found for this signature in database
1 changed files with 8 additions and 3 deletions

@ -5812,9 +5812,13 @@ Enabling and disabling scripts
============================== ==============================
Scripts can choose to recognize the built-in ``enable`` and ``disable`` commands Scripts can choose to recognize the built-in ``enable`` and ``disable`` commands
by including the following line anywhere in their file:: by including the following line near the top of their file::
--@ enable = true --@enable = true
--@module = true
Note that enableable scripts must also be `modules <reqscript>` so their
``isEnabled()`` functions can be called from outside the script.
When the ``enable`` and ``disable`` commands are invoked, the ``dfhack_flags`` When the ``enable`` and ``disable`` commands are invoked, the ``dfhack_flags``
table passed to the script will have the following fields set: table passed to the script will have the following fields set:
@ -5829,7 +5833,8 @@ command.
Example usage:: Example usage::
--@ enable = true --@enable = true
--@module = true
enabled = enabled or false enabled = enabled or false
function isEnabled() function isEnabled()