hud refactor
This commit is contained in:
@@ -2,44 +2,46 @@
|
||||
#define FRONTEND_INVENTORY_VIEW_H_
|
||||
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include "../typedefs.h"
|
||||
|
||||
class Player;
|
||||
class Assets;
|
||||
class GfxContext;
|
||||
class ContentIndices;
|
||||
class BlocksPreview;
|
||||
class ContentGfxCache;
|
||||
|
||||
typedef std::function<void(blockid_t)> slotconsumer;
|
||||
|
||||
class InventoryView {
|
||||
Player* player;
|
||||
const Assets* assets;
|
||||
const ContentIndices* indices;
|
||||
const ContentGfxCache* const cache;
|
||||
std::vector<blockid_t> blocks;
|
||||
BlocksPreview* blocksPreview;
|
||||
slotconsumer consumer = nullptr;
|
||||
|
||||
int inventoryScroll = 0;
|
||||
int invColumns;
|
||||
int scroll = 0;
|
||||
int columns;
|
||||
uint iconSize = 48;
|
||||
uint interval = 4;
|
||||
int padX = interval;
|
||||
int padY = interval;
|
||||
int invX = 0;
|
||||
int invY = 0;
|
||||
glm::ivec2 padding {interval, interval};
|
||||
glm::ivec2 position {0, 0};
|
||||
public:
|
||||
InventoryView(
|
||||
int columns,
|
||||
Player* player,
|
||||
const Assets* assets,
|
||||
const ContentIndices* indices,
|
||||
const ContentGfxCache* cache,
|
||||
std::vector<blockid_t> blocks);
|
||||
|
||||
void setPosition(int x, int y);
|
||||
void actAndDraw(const GfxContext* ctx);
|
||||
int getWidth() const;
|
||||
int getHeight() const;
|
||||
void setSlotConsumer(slotconsumer consumer);
|
||||
};
|
||||
|
||||
#endif // FRONTEND_INVENTORY_VIEW_H_
|
||||
|
||||
Reference in New Issue
Block a user