forked from CleverRaven/Cataclysm-DDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
advanced_inv.h
124 lines (112 loc) · 2.84 KB
/
advanced_inv.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
121
122
123
124
#ifndef _ADVANCED_INV_H
#define _ADVANCED_INV_H_
#include "output.h"
#include "game.h"
#include <string>
struct advanced_inv_area {
int id;
int hscreenx;
int hscreeny;
int offx;
int offy;
int x;
int y;
std::string name;
std::string shortname;
bool canputitems;
vehicle *veh;
int vstor;
int size;
std::string desc;
int volume, weight;
int max_size, max_volume;
};
// for printing items in environment
struct advanced_inv_listitem {
int idx;
int area;
item *it;
std::string name;
bool autopickup;
int stacks;
int volume;
int weight;
int cat;
};
class advanced_inventory_pane {
public:
int pos;
int area, offx, offy, size, vstor; // quick lookup later
int index, max_page, max_index, page;
std::string area_string;
int sortby;
int issrc;
vehicle *veh;
WINDOW *window;
std::vector<advanced_inv_listitem> items;
int numcats;
std::string filter;
bool recalc;
bool redraw;
std::map<std::string, bool> filtercache;
advanced_inventory_pane() {
offx = 0; offy = 0; size = 0; vstor = -1;
index = 0; max_page = 0; max_index = 0; page = 0;
area_string = _("Initializing...");
sortby = 1; issrc = 0; veh = NULL; window = NULL;
items.clear();
numcats = 0; filter="";
filtercache.clear();
}
};
class advanced_inventory
{
public:
game * g;
player * p;
const int head_height;
const int min_w_height;
const int min_w_width;
const int max_w_width;
const int left;
const int right;
const int isinventory;
const int isall;
bool checkshowmsg;
bool showmsg;
int itemsPerPage;
int w_height;
int w_width;
int headstart;
int colstart;
// itemsPerPage=getmaxy(left_window)-ADVINVOFS;
// todo: awaiting ui::menu // last_tmpdest=-1;
bool exit;// = false;
bool redraw;// = true;
bool recalc;// = true;
int lastCh;// = 0;
int src;// = left; // the active screen , 0 for left , 1 for right.
int dest;// = right;
int max_inv;// = inv_chars.size() - u.worn.size() - ( u.is_armed() || u.weapon.is_style() ? 1 : 0 );
bool examineScroll;// = false;
bool filter_edit;
advanced_inventory_pane panes[2];
advanced_inv_area squares[11];
advanced_inventory() :
head_height(5),
min_w_height(10),
min_w_width(FULL_SCREEN_WIDTH),
max_w_width(120),
left(0),
right(1),
isinventory(0),
isall(10) {
}
void display(game *gp, player *pp);
void print_items(advanced_inventory_pane &pane, bool active);
void recalc_pane(int i);
void redraw_pane(int i);
void init(game *gp, player *pp);
private:
};
#endif