The open source repository for the action RPG game in development by Sig Productions titled 'Adventures in Lestoria'! https://forums.lestoria.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AdventuresInLestoria/Crawler/InventoryWindow.cpp

35 lines
888 B

#pragma once
#include "Crawler.h"
#include "DEFINES.h"
#include "olcPixelGameEngine.h"
#include "safemap.h"
#include "Item.h"
#include "MenuItemButton.h"
INCLUDE_GFX
typedef Attribute A;
const Menu Menu::InitializeInventoryWindow(){
constexpr int invWidth=5;
constexpr int invHeight=3;
constexpr int totalItemSlots=invWidth*invHeight;
constexpr int itemSpacing=8;
constexpr int buttonSize=24;
constexpr int totalSpacing=buttonSize+itemSpacing;
Menu inventoryWindow(CENTERED,{totalSpacing*invWidth,totalSpacing*(invHeight+1)});
MenuFunc useItemFunc=[](MenuFuncData data){
};
for(int y=0;y<invHeight;y++){
for(int x=0;x<invWidth;x++){
int itemIndex=y*invWidth+x;
MenuItemButton button1{{{float(totalSpacing*x),float(totalSpacing*y)},{float(buttonSize),float(buttonSize)}},Inventory::get("Consumables"),itemIndex,useItemFunc};
}
}
return inventoryWindow;
}