Page 1 of 1

functions missing

PostPosted: Mon Apr 21, 2014 07:49
by JPRuehmann
Hi
I think there are some missing functions for the lua.api
-on_enter() (for text fields in formspecs, defins what will hapen if the user presses the enter key.)
-get_gamemode(username) (to get the gamemode of an player (creative or survival) to circumvent wrong behaviour of code if used in incompatible mode)
Thanks,
JPR

Re: functions missing

PostPosted: Mon Apr 21, 2014 07:58
by sfan5
JPRuehmann wrote:get_gamemode(username) (to get the gamemode of an player (creative or survival) to circumvent wrong behaviour of code if used in incompatible mode)

Minetest does not have per-player gamemodes, either it is creative mode for everyone (creative_mode=true) or survival mode for everyone (creative_mode=false)

Re: functions missing

PostPosted: Mon Apr 21, 2014 08:20
by JPRuehmann
Hello
OK thanks
But still seems usefull to me to get the mode from within mods.
That could but not must be changed.
Would be nice to have per user modes.
Thanks,
JPR

Re: functions missing

PostPosted: Mon Apr 21, 2014 08:21
by sfan5
JPRuehmann wrote:But still seems usefull to me to get the mode from within mods.

minetest.setting_getbool('creative_mode') returns true when creative mode is enabled.

Re: functions missing

PostPosted: Mon Apr 21, 2014 08:48
by JPRuehmann
Thanks
I didn“t found that by Google and no mod is using it as far as I know, so I thought that it wasn`t there. now I can change that by myself for mods where it seems useful.