Added label, text, and quantity descriptions for all items on the inventory menu.

This commit is contained in:
2023-10-07 19:06:56 -05:00
parent 803a0189d8
commit 461265a8a4
11 changed files with 73 additions and 26 deletions
+7 -1
View File
@@ -5,6 +5,7 @@
#include "safemap.h"
#include "Item.h"
#include "MenuItemButton.h"
#include "MenuLabel.h"
INCLUDE_GFX
typedef Attribute A;
@@ -28,10 +29,15 @@ const Menu Menu::InitializeInventoryWindow(){
for(int y=0;y<invHeight;y++){
for(int x=0;x<invWidth;x++){
int itemIndex=y*invWidth+x;
MenuItemButton*button=new MenuItemButton{{{float(totalSpacing*x),float(totalSpacing*y)},{float(buttonSize),float(buttonSize)}},Inventory::get("Consumables"),itemIndex,useItemFunc};
MenuItemButton*button=new MenuItemButton{INVENTORY,{{float(totalSpacing*x),float(totalSpacing*y)},{float(buttonSize),float(buttonSize)}},Inventory::get("Consumables"),itemIndex,useItemFunc};
inventoryWindow.AddComponent("item"+std::to_string(itemIndex),button);
}
}
MenuLabel*itemNameLabel=new MenuLabel{INVENTORY,vf2d{0,invHeight*totalSpacing-4},"",false,true};
inventoryWindow.AddComponent("itemName",itemNameLabel);
MenuLabel*itemDescriptionLabel=new MenuLabel{INVENTORY,vf2d{2+inventoryWindow.size.x/2,invHeight*totalSpacing+4+itemSpacing},"",true,true};
inventoryWindow.AddComponent("itemDescription",itemDescriptionLabel);
return inventoryWindow;
}