functions missing

User avatar
JPRuehmann
Member
 
Posts: 334
Joined: Fri Mar 21, 2014 21:40

functions missing

by JPRuehmann » Mon Apr 21, 2014 07:49

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
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

Re: functions missing

by sfan5 » Mon Apr 21, 2014 07:58

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)
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
JPRuehmann
Member
 
Posts: 334
Joined: Fri Mar 21, 2014 21:40

Re: functions missing

by JPRuehmann » Mon Apr 21, 2014 08:20

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
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

Re: functions missing

by sfan5 » Mon Apr 21, 2014 08:21

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.
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
JPRuehmann
Member
 
Posts: 334
Joined: Fri Mar 21, 2014 21:40

Re: functions missing

by JPRuehmann » Mon Apr 21, 2014 08:48

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.
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 1 guest