Fix empty inventory render bug

+ missing help text
This commit is contained in:
xtreme8000 2023-12-02 23:06:35 +01:00
parent b996696b86
commit c44212221c

View file

@ -85,7 +85,7 @@ static void screen_inventory_reset(struct screen* s, int width, int height) {
};
}
for(int k = 0; k < 4; k++) {
for(int k = 0; k < INVENTORY_SIZE_CRAFTING; k++) {
slots[slots_index++] = (struct inv_slot) {
.x = (88 + (k % 2) * 18) * 2,
.y = (26 + (k / 2) * 18) * 2,
@ -259,6 +259,7 @@ static void screen_inventory_render2D(struct screen* s, int width, int height) {
inventory_get_slot(inv, INVENTORY_SLOT_ARMOR + 3, &boots) ? &boots :
NULL);
gfx_write_buffers(true, false, false);
gfx_matrix_modelview(GLM_MAT4_IDENTITY);
// draw items
for(size_t k = 0; k < slots_index; k++) {
@ -279,6 +280,8 @@ static void screen_inventory_render2D(struct screen* s, int width, int height) {
if(inventory_get_picked_item(inv, NULL)) {
icon_offset
+= gutil_control_icon(icon_offset, IB_GUI_CLICK, "Swap item");
icon_offset
+= gutil_control_icon(icon_offset, IB_GUI_CLICK_ALT, "Place one");
} else if(inventory_get_slot(inv, selection->slot, NULL)) {
icon_offset
+= gutil_control_icon(icon_offset, IB_GUI_CLICK, "Pickup item");