From c42c53fccf87a3819ca78de52f8f20c47c4fbb9f Mon Sep 17 00:00:00 2001 From: red-001 Date: Tue, 24 Jan 2017 16:26:15 +0000 Subject: [CSM] Add local formspecs. (#5094) --- doc/client_lua_api.txt | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/client_lua_api.txt b/doc/client_lua_api.txt index 8ce487bf8..3170f4c84 100644 --- a/doc/client_lua_api.txt +++ b/doc/client_lua_api.txt @@ -699,7 +699,10 @@ Call these functions only at load time! * Called when server modified player's HP * `minetest.register_on_damage_taken(func(hp))` * Called when player take damages - +* `minetest.register_on_formspec_input(func(formname, fields))` + * Called when a button is pressed in player's inventory form + * Newest functions are called first + * If function returns `true`, remaining functions are not called ### Sounds * `minetest.sound_play(spec, parameters)`: returns a handle * `spec` is a `SimpleSoundSpec` @@ -754,7 +757,15 @@ Call these functions only at load time! * Encodes a string in base64. * `minetest.decode_base64(string)`: returns string * Decodes a string encoded in base64. - +* `core.gettext(string) : returns string + * look up the translation of a string in the gettext message catalog +* `fgettext_ne(string, ...)` + * call core.gettext(string), replace "$1"..."$9" with the given + extra arguments and return the result +* `fgettext(string, ...)` : returns string + * same as fgettext_ne(), but calls core.formspec_escape before returning result +* `show_formspec(formname, formspec)` : returns true on success + * Shows a formspec to the player Class reference --------------- -- cgit v1.2.3