aboutsummaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-07-22 17:10:58 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-07-22 17:40:48 +0300
commit4cc98d7add7b697ac302a6136bbeb95ef78cec45 (patch)
treeefcdd9352f25c99557a1acd5177b6d586ecba881 /src/game.cpp
parent506203345ba2795aa0af68a434f4b77cf50e664a (diff)
downloadminetest-4cc98d7add7b697ac302a6136bbeb95ef78cec45.tar.gz
minetest-4cc98d7add7b697ac302a6136bbeb95ef78cec45.tar.bz2
minetest-4cc98d7add7b697ac302a6136bbeb95ef78cec45.zip
minetest.register_on_player_receive_fields()
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 3ba90789a..19c4707de 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -111,6 +111,20 @@ struct TextDestNodeMetadata : public TextDest
Client *m_client;
};
+struct TextDestPlayerInventory : public TextDest
+{
+ TextDestPlayerInventory(Client *client)
+ {
+ m_client = client;
+ }
+ void gotText(std::map<std::string, std::string> fields)
+ {
+ m_client->sendInventoryFields("", fields);
+ }
+
+ Client *m_client;
+};
+
/* Respawn menu callback */
class MainRespawnInitiator: public IRespawnInitiator
@@ -1507,6 +1521,7 @@ void the_game(
assert(src);
menu->setFormSpec(src->getForm(), inventoryloc);
menu->setFormSource(src);
+ menu->setTextDest(new TextDestPlayerInventory(&client));
menu->drop();
}
else if(input->wasKeyDown(EscapeKey))