hud refactor (part II)

This commit is contained in:
MihailRis
2024-01-07 19:22:29 +03:00
parent 8118afce5c
commit e493c67dfa
13 changed files with 142 additions and 91 deletions
+7 -8
View File
@@ -10,18 +10,15 @@
class Assets;
class GfxContext;
class ContentIndices;
class BlocksPreview;
class ContentGfxCache;
class LevelFrontend;
typedef std::function<void(blockid_t)> slotconsumer;
class InventoryView {
const Assets* assets;
const ContentIndices* indices;
const ContentGfxCache* const cache;
std::vector<blockid_t> blocks;
BlocksPreview* blocksPreview;
slotconsumer consumer = nullptr;
LevelFrontend* frontend;
int scroll = 0;
int columns;
@@ -32,13 +29,15 @@ class InventoryView {
public:
InventoryView(
int columns,
const Assets* assets,
const ContentIndices* indices,
const ContentGfxCache* cache,
LevelFrontend* frontend,
std::vector<blockid_t> blocks);
virtual ~InventoryView();
virtual void actAndDraw(const GfxContext* ctx);
void setPosition(int x, int y);
void actAndDraw(const GfxContext* ctx);
int getWidth() const;
int getHeight() const;
void setSlotConsumer(slotconsumer consumer);