diff --git a/Crawler/Item.cpp b/Crawler/Item.cpp index b52ebc38..62a1ba5e 100644 --- a/Crawler/Item.cpp +++ b/Crawler/Item.cpp @@ -1,4 +1,3 @@ -#pragma once #include "Item.h" #include "safemap.h" #include "DEFINES.h" @@ -26,6 +25,7 @@ void ItemInfo::InitializeItems(){ for(auto&key:DATA["ItemCategory"].GetKeys()){ ITEM_CATEGORIES[key.first]; Inventory::sortedInv[key.first]; + Menu::inventoryListeners[key.first]; } for(auto&key:DATA["ItemDatabase"].GetKeys()){ @@ -75,6 +75,7 @@ void ItemInfo::InitializeItems(){ ITEM_DATA.SetInitialized(); ITEM_CATEGORIES.SetInitialized(); + Menu::inventoryListeners.SetInitialized(); std::cout<Menu::stack; std::mapMenu::menus; std::string Menu::themeSelection="BlueDefault"; safeunorderedmapMenu::themes; +safemap>Menu::inventoryListeners; const vf2d Menu::CENTERED = {-456,-456}; INCLUDE_GFX diff --git a/Crawler/Menu.h b/Crawler/Menu.h index 8ba63867..77a4bfba 100644 --- a/Crawler/Menu.h +++ b/Crawler/Menu.h @@ -22,6 +22,7 @@ enum MenuType{ class Menu:IAttributable{ friend class Crawler; friend class Player; + friend class ItemInfo; float buttonHoldTime=0; std::vectordisplayComponents; //Comp.onents that are only for displaying purposes. diff --git a/Crawler/ScrollableWindowComponent.h b/Crawler/ScrollableWindowComponent.h index 8e5282c4..d0fb836f 100644 --- a/Crawler/ScrollableWindowComponent.h +++ b/Crawler/ScrollableWindowComponent.h @@ -1,6 +1,7 @@ #pragma once #include "Menu.h" #include "MenuComponent.h" +#include "MenuItemButton.h" #include "Crawler.h" typedef Attribute A; diff --git a/Crawler/assets/config/items/ItemCategory.txt b/Crawler/assets/config/items/ItemCategory.txt index 719c2b5a..1ee1fe60 100644 --- a/Crawler/assets/config/items/ItemCategory.txt +++ b/Crawler/assets/config/items/ItemCategory.txt @@ -3,6 +3,6 @@ ItemCategory # Random side note, these descriptions aren't used anywhere in-game atm. Consumables = Items that will be consumed after a single use. Equipment = Gear that can be placed onto a player. - Accesories = Items worn as extra items on the player. + Accessories = Items worn as extra items on the player. Materials = Items used as crafting materials for the forge. } \ No newline at end of file