mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
InventoryBuilder used for access panel and hotbar
This commit is contained in:
parent
d9408a7cfc
commit
9e3c4fb00c
3 changed files with 23 additions and 36 deletions
|
|
@ -156,7 +156,7 @@ void SlotView::draw(Batch2D* batch, Assets* assets) {
|
|||
auto preview = frontend->getBlocksPreview();
|
||||
auto indices = content->getIndices();
|
||||
|
||||
ItemDef* item = indices->getItemDef(stack.getItemId());
|
||||
ItemDef* item = indices->getItemDef(stack.getItemId());
|
||||
switch (item->iconType) {
|
||||
case item_icon_type::none:
|
||||
break;
|
||||
|
|
@ -285,8 +285,11 @@ InventoryView::InventoryView(
|
|||
InventoryView::~InventoryView() {}
|
||||
|
||||
void InventoryView::build() {
|
||||
int index = 0;
|
||||
size_t index = 0;
|
||||
for (auto& slot : layout->getSlots()) {
|
||||
if (index >= inventory->size())
|
||||
break;
|
||||
|
||||
ItemStack& item = inventory->getSlot(index);
|
||||
|
||||
auto view = std::make_shared<SlotView>(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue