23 #ifndef M4_BURGER_GUI_CHEAPO_H 24 #define M4_BURGER_GUI_CHEAPO_H 26 #include "common/str.h" 27 #include "m4/graphics/gr_buff.h" 28 #include "m4/m4_types.h" 34 constexpr int16 INVENTORY_CELLS_COUNT = 128;
35 constexpr int16 ARROW_WIDTH = 8;
36 constexpr int16 MAX_BUTTONS = 20;
37 constexpr int16 MAX_INVENTORY = 9;
39 constexpr int16 LEFT_ARROW_TAG = 128;
40 constexpr int16 RIGHT_ARROW_TAG = 129;
42 constexpr int16 LEFT_ARROW_TAG_DORMANT = 130;
43 constexpr int16 RIGHT_ARROW_TAG_DORMANT = 134;
44 constexpr int16 LEFT_ARROW_TAG_ROLL = 131;
45 constexpr int16 RIGHT_ARROW_TAG_ROLL = 135;
46 constexpr int16 LEFT_ARROW_TAG_DOWN = 132;
47 constexpr int16 RIGHT_ARROW_TAG_DOWN = 136;
48 constexpr int16 LEFT_ARROW_TAG_NONFUNC = 133;
49 constexpr int16 RIGHT_ARROW_TAG_NONFUNC = 137;
52 NOTHING, IN_CONTROL, OVER_CONTROL, SELECTED, TRACKING
56 BUTTON_0, BUTTON_RELAXED, BUTTON_OVER, BUTTON_PICKED
66 int16 _x1 = 0, _x2 = 0, _y1 = 0, _y2 = 0;
69 RectClass(int16 x1, int16 y1, int16 x2, int16 y2);
72 virtual int16 inside(int16 x, int16 y)
const;
76 void set(int16 x1, int16 y1, int16 x2, int16 y2);
82 char *_string =
nullptr;
83 int16 _string_len = 0;
85 bool _must_redraw =
false;
88 TextField(int16 x1, int16 y1, int16 x2, int16 y2);
91 void set_string(
const char *
string);
92 void draw(
GrBuff *interface_buffer);
104 bool _highlighted =
false;
105 bool _hidden =
false;
108 void zap_resources();
111 ButtonState _state = BUTTON_RELAXED;
113 bool _must_redraw =
false;
119 int16 unknown, int16 relaxed, int16 over, int16 picked,
int sprite);
122 void draw(
GrBuff *interface_buffer);
123 int16 inside(int16 x, int16 y)
const override;
124 virtual ControlStatus track(int32 eventType, int16 x, int16 y);
127 void set(int16 x1, int16 y1, int16 x2, int16 y2, int16 tag);
128 void set(int16 x1, int16 y1, int16 x2, int16 y2, int16 tag, int16 unknown,
129 int16 relaxed, int16 over, int16 picked, int32 sprite);
132 int16 get_tag()
const;
136 bool is_hidden()
const;
137 void set_sprite_relaxed(int16 r);
138 void set_sprite_picked(int16 p);
139 void set_sprite_over(int16 o);
140 void set_sprite_unknown(int16 val);
145 ControlStatus _toggle_state;
148 ControlStatus track(int32 eventType, int16 x, int16 y);
153 bool _selected =
false;
158 int16 _highlight_index = 0;
159 bool _must_redraw_all =
false;
165 void draw(
GrBuff *interface_buffer);
166 int16 inside(int16 x, int16 y)
const override;
167 ControlStatus track(int32 eventType, int16 x, int16 y);
170 int16 check_inventory(int16 x, int16 y);
171 void highlight_button(int16 index);
172 void set_selected(
bool);
186 int16 _num_cells = 0;
187 bool _right_arrow_visible =
false;
189 int16 cell_pos_x(int16 index);
190 int16 cell_pos_y(int16 index);
191 int16 interface_tracking = -1;
195 int16 _cells_h = 0, _cells_v = 0;
196 int16 _cell_w = 0, _cell_h = 0;
197 int16 _must_redraw1 = 0, _must_redraw2 = 0;
198 int16 _highlight = 0;
199 bool _must_redraw_all =
false;
201 Entry _items[INVENTORY_CELLS_COUNT];
204 Inventory(
const RectClass &r, int32 sprite, int16 cells_h, int16 cells_v, int16 cell_w, int16 cell_h, int16 tag);
207 void draw(
GrBuff *interface_buffer);
209 int16 inside(int16 x, int16 y)
const override;
210 ControlStatus track(int32 eventType, int16 x, int16 y);
214 void highlight_part(int16 index);
216 bool need_left()
const;
217 bool need_right()
const;
218 void set_scroll(int32 new_scroll);
Definition: gui_cheapo.h:176
Definition: gui_cheapo.h:64
Definition: database.h:28
Definition: gui_cheapo.h:151
Definition: gui_cheapo.h:80
Definition: gui_cheapo.h:143