forked from cataclysmbnteam/Cataclysm-BN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
game_inventory.h
120 lines (105 loc) · 4.05 KB
/
game_inventory.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#pragma once
#ifndef CATA_SRC_GAME_INVENTORY_H
#define CATA_SRC_GAME_INVENTORY_H
#include <functional>
#include <list>
#include <string>
#include <utility>
#include <optional>
#include "item_handling_util.h"
#include "item_location.h"
struct tripoint;
class avatar;
class item;
class player;
class repair_item_actor;
class salvage_actor;
using item_filter = std::function<bool( const item & )>;
namespace game_menus
{
namespace inv
{
// item selector for all items in @you's inventory.
item_location titled_menu( avatar &you, const std::string &title,
const std::string &none_message = "" );
// item selector for items in @you's inventory with a filter
item_location titled_filter_menu( item_filter filter, avatar &you,
const std::string &title, const std::string &none_message = "" );
/**
* @name Customized inventory menus
*
* The functions here execute customized inventory menus for specific game situations.
* Each menu displays only related inventory (or nearby) items along with context dependent information.
* More functions will follow. TODO: update all 'inv_for...()' functions to return @ref item_location instead of
* plain int and move them here.
* @return Either location of the selected item or null location if none was selected.
*/
/*@{*/
void common( avatar &you );
void compare( player &p, const std::optional<tripoint> &offset );
void compare( const item &left, const item &right );
/** Assign (or reassign from existing) letter to item in character's inventory. */
void reassign_letter( Character &who, item &it, int invlet );
/** Prompt to assign (or clear) letter to item in character's inventory. */
void prompt_reassign_letter( Character &who, item &it );
void swap_letters( player &p );
/**
* Select items to drop.
* @return A list of pairs of item_location, quantity.
*/
drop_locations multidrop( player &p );
/**
* Select items to wash.
* @param water Available water
* @param cleanser Available cleanser
* @param do_soft Whether to allow soft items
* @param do_hard Whether to allow hard items
* @return A list of selected item_locations with quantities.
*/
iuse_locations multiwash( Character &ch, int water, int cleanser, bool do_soft, bool do_hard );
/** Consuming an item. */
item_location consume( player &p );
/** Consuming a food item via a custom menu. */
item_location consume_food( player &p );
/** Consuming a drink item via a custom menu. */
item_location consume_drink( player &p );
/** Consuming a medication item via a custom menu. */
item_location consume_meds( player &p );
/** Choosing a container for liquid. */
item_location container_for( avatar &you, const item &liquid, int radius = 0 );
/** Item disassembling menu. */
item_location disassemble( player &p );
/** Gunmod installation menu. */
item_location gun_to_modify( player &p, const item &gunmod );
/** Book reading menu. */
item_location read( player &pl );
/** Menu for stealing stuff. */
item_location steal( avatar &you, player &victim );
/** Item activation menu. */
item_location use( avatar &you );
/** Item wielding/unwielding menu. */
item_location wield( avatar &you );
/** Item wielding/unwielding menu. */
item_location holster( player &p, item &holster );
/** Choosing a gun to saw down it's barrel. */
item_location saw_barrel( player &p, item &tool );
/** Choosing a gun to saw down its barrel. */
item_location saw_stock( player &p, item &tool );
/** Choose item to wear. */
item_location wear( player &p );
/** Choose item to take off. */
item_location take_off( avatar &you );
/** Item cut up menu. */
item_location salvage( player &p, const salvage_actor *actor );
/** Repair menu. */
item_location repair( player &p, const repair_item_actor *actor, const item *main_tool );
/** Bionic install menu. */
item_location install_bionic( player &p, player &patient, bool surgeon = false );
/** Bionic uninstall menu. */
item_location uninstall_bionic( player &p, player &patient );
/**Autoclave sterilize menu*/
item_location sterilize_cbm( player &p );
/*@}*/
} // namespace inv
} // namespace game_menus
#endif // CATA_SRC_GAME_INVENTORY_H