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

Add IDropAction and related stuff

This commit is contained in:
Kahrl 2011-11-27 05:01:38 +02:00 committed by Perttu Ahola
parent 82a460ec90
commit f42c57d9a8
7 changed files with 229 additions and 17 deletions

View file

@ -1215,9 +1215,19 @@ void the_game(
input->step(dtime);
/*
Launch menus according to keys
Launch menus and trigger stuff according to keys
*/
if(input->wasKeyDown(getKeySetting("keymap_inventory")))
if(input->wasKeyDown(getKeySetting("keymap_drop")))
{
// drop selected item
IDropAction *a = new IDropAction();
a->count = 0;
a->from_inv = "current_player";
a->from_list = "main";
a->from_i = g_selected_item;
client.inventoryAction(a);
}
else if(input->wasKeyDown(getKeySetting("keymap_inventory")))
{
infostream<<"the_game: "
<<"Launching inventory"<<std::endl;