mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 14:01:49 +00:00
lua: hud library
This commit is contained in:
parent
ffed4319da
commit
7e553efdec
14 changed files with 140 additions and 31 deletions
|
|
@ -16,6 +16,7 @@ class Player;
|
|||
class Level;
|
||||
class Engine;
|
||||
class SlotView;
|
||||
class Inventory;
|
||||
class InventoryView;
|
||||
class LevelFrontend;
|
||||
class UiDocument;
|
||||
|
|
@ -59,7 +60,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class HudRenderer {
|
||||
class Hud {
|
||||
Assets* assets;
|
||||
std::unique_ptr<Camera> uicamera;
|
||||
|
||||
|
|
@ -83,13 +84,15 @@ class HudRenderer {
|
|||
std::vector<HudElement> elements;
|
||||
|
||||
std::shared_ptr<InventoryView> inventoryView = nullptr;
|
||||
std::shared_ptr<InventoryView> blockUI = nullptr;
|
||||
glm::ivec3 currentblock {};
|
||||
|
||||
std::shared_ptr<gui::UINode> createDebugPanel(Engine* engine);
|
||||
std::shared_ptr<InventoryView> createContentAccess();
|
||||
std::shared_ptr<InventoryView> createHotbar();
|
||||
public:
|
||||
HudRenderer(Engine* engine, LevelFrontend* frontend);
|
||||
~HudRenderer();
|
||||
Hud(Engine* engine, LevelFrontend* frontend);
|
||||
~Hud();
|
||||
|
||||
void update(bool hudVisible);
|
||||
void draw(const GfxContext& context);
|
||||
|
|
@ -100,6 +103,7 @@ public:
|
|||
void setPause(bool pause);
|
||||
|
||||
void openInventory();
|
||||
void openInventory(glm::ivec3 block, UiDocument* doc, std::shared_ptr<Inventory> blockInv);
|
||||
void closeInventory();
|
||||
|
||||
void add(HudElement element);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue