1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

minetest.register_on_player_receive_fields()

This commit is contained in:
Perttu Ahola 2012-07-22 17:10:58 +03:00
parent 506203345b
commit 4cc98d7add
11 changed files with 127 additions and 3 deletions

View file

@ -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))