X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=src%2Fcontrol.c;h=c59053923a7d9cf1c60d6e558d8a439cb0f5e468;hb=657d5dbc6d362d7b20693c63b38d8d99f3d2dbbd;hp=874601b90d32092e946e97c95ffc6911c38b2ccf;hpb=b05b66a27258c581a10e81348088c3486cb8f569;p=plomrogue
diff --git a/src/control.c b/src/control.c
index 874601b..c590539 100644
--- a/src/control.c
+++ b/src/control.c
@@ -15,10 +15,12 @@
* growshrink_active_window(), toggle_winconfig(),
* toggle_win_height_type(), toggle_win_width_type()
*/
-#include "map_object_actions.h" /* for player_wait(), move_player() */
+#include "map_object_actions.h" /* for player_wait(), move_player(),
+ * player_drop(), player_pick()
+ */
#include "command_db.h" /* for is_command_id_shortdsc() */
#include "misc.h" /* for load_interface_conf(), unload_interface_conf(),
- * save_interface_conf()
+ * save_interface_conf(), nav_inventory()
*/
#include "yx_uint16.h" /* for dir enum */
#include "map_objects.h" /* for get_player() */
@@ -73,13 +75,25 @@ extern void record_control(int action, struct World * world)
{
move_player(world, WEST);
}
+ else if (is_command_id_shortdsc(world, action, "drop"))
+ {
+ player_drop(world);
+ }
+ else if (is_command_id_shortdsc(world, action, "pick"))
+ {
+ player_pick(world);
+ }
}
extern uint8_t player_control(int key, struct World * world)
{
- if (key == get_available_keycode_to_action(world, "player_u"))
+ if (key == get_available_keycode_to_action(world, "wait"))
+ {
+ player_wait(world);
+ }
+ else if (key == get_available_keycode_to_action(world, "player_u"))
{
move_player(world, NORTH);
}
@@ -95,9 +109,13 @@ extern uint8_t player_control(int key, struct World * world)
{
move_player(world, WEST);
}
- else if (key == get_available_keycode_to_action(world, "wait"))
+ else if (key == get_available_keycode_to_action(world, "drop"))
{
- player_wait(world);
+ player_drop(world);
+ }
+ else if (key == get_available_keycode_to_action(world, "pick"))
+ {
+ player_pick(world);
}
else
{
@@ -306,6 +324,14 @@ extern uint8_t meta_control(int key, struct World * world)
{
map_center_object(world->map, get_player(world), win_map->frame.size);
}
+ else if (key == get_available_keycode_to_action(world, "inv_u"))
+ {
+ nav_inventory(world, 'u');
+ }
+ else if (key == get_available_keycode_to_action(world, "inv_d"))
+ {
+ nav_inventory(world, 'd');
+ }
else if (key == get_available_keycode_to_action(world, "reload_conf"))
{
unload_interface_conf(world);