From 37114e7d1a73c0107c6e475d5511039c5b73e8a4 Mon Sep 17 00:00:00 2001 From: cora Date: Mon, 18 Jul 2022 22:12:56 +0200 Subject: [PATCH] Add API documentation --- mods/HUD/mcl_info/API.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 mods/HUD/mcl_info/API.md diff --git a/mods/HUD/mcl_info/API.md b/mods/HUD/mcl_info/API.md new file mode 100644 index 000000000..18c901162 --- /dev/null +++ b/mods/HUD/mcl_info/API.md @@ -0,0 +1,18 @@ +## mcl_info +An api to make custom entries in the mcl2 debug hud. + +### mcl_info.register_debug_field(name,defintion) +Debug field defintion example: +{ + level = 3, + --show with debug level 3 and upwards + + func = function(player,pos) return minetest.pos_to_string(pos) end, + -- Function that is run for at each debug + -- sample (default: every .63 seconds) + -- It should output a string and determines + -- the content of the debug field. +} + +### mcl_info.registered_debug_fields +Table the debug definitions are stored in. Do not modify this directly. If you need to overwrite a field just set it again with mcl_info.register_debug_field().