From 1f40e846acdf6f09480b112d8770d21756325445 Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Wed, 18 Oct 2023 17:51:08 +0000 Subject: [PATCH] Typo on Accessories. Initialize listener categories Co-authored-by: sigonasr2 --- Crawler/Item.cpp | 3 ++- Crawler/Menu.cpp | 1 + Crawler/Menu.h | 1 + Crawler/ScrollableWindowComponent.h | 1 + Crawler/assets/config/items/ItemCategory.txt | 2 +- 5 files changed, 6 insertions(+), 2 deletions(-) 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