From df51835b1c5d076f3e7440b37e307100bc8b25be Mon Sep 17 00:00:00 2001 From: Tachytaenius Date: Mon, 27 Mar 2023 22:05:06 +0100 Subject: [PATCH] Amend main module code in modding guide --- docs/guides/modding-guide.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/guides/modding-guide.rst b/docs/guides/modding-guide.rst index 5cabf0856..b386b48c3 100644 --- a/docs/guides/modding-guide.rst +++ b/docs/guides/modding-guide.rst @@ -457,6 +457,8 @@ Ok, you're all set up! Now, let's take a look at an example enabled = enabled or false function isEnabled() + -- this function is for the enabled API, the script won't show up on the + -- control panel without it return enabled end @@ -473,6 +475,10 @@ Ok, you're all set up! Now, let's take a look at an example dfhack.run_command('enable', 'example-mod') end + if dfhack_flags.module then + return + end + if not dfhack_flags.enable then print(dfhack.script_help()) print()