+ def pickup_menu(key):
+
+ def f(key, selectables):
+ if key == 'p' and len(selectables) > 0:
+ id_ = selectables[self.item_pointer]
+ self.socket.send('TASK:PICKUP %s' % id_)
+ self.socket.send('GET_PICKABLE_ITEMS')
+ else:
+ return False
+ return True
+
+ selectables_menu(key, pickable_items_widget,
+ self.game.world.pickable_items, f)
+
+ def inventory_menu(key):
+
+ def f(key, selectables):
+ if key == 'd' and len(selectables) > 0:
+ id_ = selectables[self.item_pointer]
+ self.socket.send('TASK:DROP %s' % id_)
+ elif key == 'e' and len(selectables) > 0:
+ id_ = selectables[self.item_pointer]
+ self.socket.send('TASK:EAT %s' % id_)
+ else:
+ return False
+ return True
+
+ selectables_menu(key, inventory_widget,
+ self.game.world.player_inventory, f)
+