UiDocument

This commit is contained in:
MihailRis
2024-02-07 19:29:20 +03:00
parent c902ed506b
commit 1dd0e9f939
17 changed files with 257 additions and 42 deletions
+2 -2
View File
@@ -31,6 +31,7 @@
#include "../objects/Player.h"
#include "../physics/Hitbox.h"
#include "../maths/voxmaths.h"
#include "../files/files.h"
#include "gui/controls.h"
#include "gui/panels.h"
#include "gui/UINode.h"
@@ -172,7 +173,7 @@ std::shared_ptr<InventoryView> HudRenderer::createContentAccess() {
auto indices = content->getIndices();
auto player = level->player;
auto inventory = player->getInventory();
int itemsCount = indices->countItemDefs();
auto accessInventory = std::make_shared<Inventory>(0, itemsCount);
for (int id = 1; id < itemsCount; id++) {
@@ -376,7 +377,6 @@ void HudRenderer::draw(const GfxContext& ctx){
uishader->use();
uishader->uniformMatrix("u_projview", uicamera->getProjView());
// Draw selected item preview
hotbarView->setCoord(glm::vec2(width/2, height-65));
hotbarView->setSelected(player->getChosenSlot());