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:
parent
506203345b
commit
4cc98d7add
11 changed files with 127 additions and 3 deletions
15
src/game.cpp
15
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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue