From b48752a2205a86621e35acfc3292cda932ddaf65 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 18 Nov 2016 14:46:37 +0100 Subject: Add doc.set_category_order --- API.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'API.md') diff --git a/API.md b/API.md index 4dbc2e2..b7af03f 100644 --- a/API.md +++ b/API.md @@ -67,6 +67,7 @@ These functions are available: * `doc.new_category`: Adds a new category * `doc.new_entry`: Adds a new entry +* `doc.set_category_order`: Sets the order of categories in the category list * `doc.show_entry`: Shows a particular entry to a player * `doc.show_category`: Shows the entry list of a category to a player * `doc.show_doc`: Opens the main Documentation System form for a player @@ -199,6 +200,26 @@ the category definition. #### Return value Always `nil`. +### `doc.set_category_order(category_list)` +Sets the order of categories in the category list. +The Documentation System starts with this default order: + + {"basics", "online", "nodes", "tools", "craftitems"} + +This function can be called at any time, but it recommended to only call +this function once for the entire server session and to only call it +from subgame mods, to avoid contradictions. If this function is called a +second time by any mod, a warning is written into the log. + +#### Parameters +* `category_list`: List of category IDs in the order they should appear + in the category list. All unspecified categories will be appended to + the end + +#### Return value +Always `nil`. + + ### `doc.show_doc(playername)` Opens the main documentation formspec for the player (Main tab). -- cgit v1.2.3