Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eat menu #33304

Closed
wants to merge 25 commits into from
Closed

Eat menu #33304

Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions data/json/player_activities.json
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,15 @@
"based_on": "neither",
"no_resume": true
},
{
"id": "ACT_COMESTIBLE_INVENTORY",
"type": "activity_type",
"activity_level": "NO_EXERCISE",
"verb": "interacting with inventory",
"suspendable": false,
"based_on": "neither",
"no_resume": true
},
{
"id": "ACT_ARMOR_LAYERS",
"type": "activity_type",
Expand Down
8 changes: 8 additions & 0 deletions src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include "action.h"
#include "advanced_inv.h"
#include "comestible_inv.h"
#include "avatar.h"
#include "avatar_action.h"
#include "clzones.h"
Expand Down Expand Up @@ -139,6 +140,7 @@ activity_handlers::do_turn_functions = {
{ activity_id( "ACT_MOVE_ITEMS" ), move_items_do_turn },
{ activity_id( "ACT_MOVE_LOOT" ), move_loot_do_turn },
{ activity_id( "ACT_ADV_INVENTORY" ), adv_inventory_do_turn },
{ activity_id( "ACT_COMESTIBLE_INVENTORY" ), comestible_inventory_do_turn },
{ activity_id( "ACT_ARMOR_LAYERS" ), armor_layers_do_turn },
{ activity_id( "ACT_ATM" ), atm_do_turn },
{ activity_id( "ACT_CRACKING" ), cracking_do_turn },
Expand Down Expand Up @@ -2608,6 +2610,12 @@ void activity_handlers::adv_inventory_do_turn( player_activity *, player *p )
advanced_inv();
}

void activity_handlers::comestible_inventory_do_turn(player_activity*, player* p)
{
p->cancel_activity();
comestible_inv();
}

void activity_handlers::drive_do_turn( player_activity *act, player *p )
{
vehicle *player_veh = veh_pointer_or_null( g->m.veh_at( p->pos() ) );
Expand Down
1 change: 1 addition & 0 deletions src/activity_handlers.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ void move_loot_do_turn( player_activity *act, player *p );
void travel_do_turn( player_activity *act, player *p );
void drive_do_turn( player_activity *act, player *p );
void adv_inventory_do_turn( player_activity *act, player *p );
void comestible_inventory_do_turn( player_activity *act, player *p );
void armor_layers_do_turn( player_activity *act, player *p );
void atm_do_turn( player_activity *act, player *p );
void fish_do_turn( player_activity *act, player *p );
Expand Down
2 changes: 2 additions & 0 deletions src/advanced_inv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ void advanced_inventory::load_settings()
panes[i].filter = uistate.adv_inv_filter[i];
}
uistate.adv_inv_exit_code = exit_none;

add_msg(m_info, "~~~ %d %d", uistate.wishitem_selected, uistate.save_var);
}

std::string advanced_inventory::get_sortname( advanced_inv_sortby sortby )
Expand Down
Loading