From 16ad10e62f4dcf620f9a962b07aa39f1c561f8dc Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Thu, 19 Jul 2012 14:09:16 +0300 Subject: Allow defining player's inventory form in Lua --- doc/lua_api.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 511ec7c8e..823b4b825 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -759,6 +759,10 @@ minetest.register_on_respawnplayer(func(ObjectRef)) ^ Called when player is to be respawned ^ Called _before_ repositioning of player occurs ^ return true in func to disable regular player placement +minetest.register_on_joinplayer(func(ObjectRef)) +^ Called when a player joins the game +minetest.register_on_leaveplayer(func(ObjectRef)) +^ Called when a player leaves the game minetest.register_on_chat_message(func(name, message)) Other registration functions: @@ -993,8 +997,8 @@ LuaEntitySAO-only: (no-op for other objects) - settexturemod(mod) - setsprite(p={x=0,y=0}, num_frames=1, framelength=0.2, - select_horiz_by_yawpitch=false) -- ^ Select sprite from spritesheet with optional animation and DM-style -- texture selection based on yaw relative to camera + ^ Select sprite from spritesheet with optional animation and DM-style + texture selection based on yaw relative to camera - get_entity_name() (DEPRECATED: Will be removed in a future version) - get_luaentity() Player-only: (no-op for other objects) @@ -1003,6 +1007,10 @@ Player-only: (no-op for other objects) - get_look_dir(): get camera direction as a unit vector - get_look_pitch(): pitch in radians - get_look_yaw(): yaw in radians (wraps around pretty randomly as of now) +- set_inventory_formspec(formspec) + ^ Redefine player's inventory form + ^ Should usually be called in on_joinplayer +- get_inventory_formspec() -> formspec string InvRef: Reference to an inventory methods: -- cgit v1.2.3