22#ifndef QDENGINE_QDCORE_QD_INVENTORY_H
23#define QDENGINE_QDCORE_QD_INVENTORY_H
25#include "qdengine/system/input/mouse_input.h"
26#include "qdengine/qdcore/qd_named_object.h"
27#include "qdengine/qdcore/qd_inventory_cell.h"
56 INV_DEFAULT_SHADOW_COLOR = 0,
57 INV_DEFAULT_SHADOW_ALPHA = 128
61 return QD_NAMED_OBJECT_INVENTORY;
67 void remove_cell_set(
int idx);
69 const qdInventoryCellSet &get_cell_set(
int id = 0)
const {
70 return _cell_sets[id];
73 void set_cells_pos(
int set_id,
const Vect2s &pos) {
74 if (set_id >= 0 && set_id < (
int)_cell_sets.
size())
75 _cell_sets[set_id].set_screen_pos(pos);
77 void set_cells_type(
int set_id,
const qdInventoryCellType &tp) {
78 if (set_id >= 0 && set_id < (
int)_cell_sets.
size())
79 _cell_sets[set_id].set_cell_type(tp);
81 void set_cells_size(
int set_id,
const Vect2s &sz) {
82 if (set_id >= 0 && set_id < (
int)_cell_sets.
size())
83 _cell_sets[set_id].set_size(sz);
86 int cell_index(
const qdGameObjectAnimated *obj)
const;
87 Vect2s cell_position(
int cell_idx)
const;
89 void redraw(
int offs_x = 0,
int offs_y = 0,
bool inactive_mode =
false)
const;
90 void toggle_redraw(
bool state) {
93 void pre_redraw()
const;
96 bool put_object(qdGameObjectAnimated *p);
97 bool put_object(qdGameObjectAnimated *p,
const Vect2s &pos);
98 bool remove_object(qdGameObjectAnimated *p);
99 qdGameObjectAnimated *get_object(
const Vect2s &pos)
const;
100 bool is_object_in_list(
const qdGameObjectAnimated *p)
const;
102 uint32 shadow_color()
const {
103 return _shadow_color;
105 void set_shadow_color(uint32 color) {
106 _shadow_color = color;
109 int shadow_alpha()
const {
110 return _shadow_alpha;
112 void set_shadow_alpha(
int alpha) {
113 _shadow_alpha = alpha;
116 bool load_script(
const xml::tag *p);
119 bool load_resources();
120 bool free_resources();
131 void objects_quant(
float dt);
133 Vect2s additional_cells()
const {
134 return _additional_cells;
136 void set_additional_cells(
Vect2s val) {
137 _additional_cells = val;
146 void debug_log()
const;
154 uint32 _shadow_color;
size_type size() const
Definition: array.h:316
void push_back(const T &element)
Definition: array.h:181
mouseEvent
События.
Definition: mouse_input.h:41
Группа ячеек инвентори.
Definition: qd_inventory_cell.h:176
Инвентори.
Definition: qd_inventory.h:36
bool save_data(Common::WriteStream &fh) const
Запись данных в сэйв.
int named_object_type() const
Возвращает тип объекта.
Definition: qd_inventory.h:60
bool load_data(Common::SeekableReadStream &fh, int save_version)
Загрузка данных из сэйва.
void scroll_left()
Скроллинг
@ INV_VISIBLE_WHEN_INACTIVE
отрисовывается даже если неактивно в данный момент
Definition: qd_inventory.h:52
@ INV_PUT_OBJECT_AFTER_CLICK
если установлен, то после клика объектом он возвращается в инветори
Definition: qd_inventory.h:48
@ INV_DONT_OPEN_AFTER_TAKE
если установлен, то после взятия объекта инвентори не открывается
Definition: qd_inventory.h:46
@ INV_ENABLE_RIGHT_CLICK
если установлен, объект возвращается в инветори по правому клику мыши
Definition: qd_inventory.h:50
@ INV_TAKE_TO_MOUSE
если установлен, объект берется сначала на мышь
Definition: qd_inventory.h:44
Поименованный объект.
Definition: qd_named_object.h:70
Definition: algorithm.h:29
Базовый класс для игровых ресурсов.
Definition: console.h:28