diff --git a/Crawler/Crawler.cpp b/Crawler/Crawler.cpp index 50bcdeb4..af4eb3a9 100644 --- a/Crawler/Crawler.cpp +++ b/Crawler/Crawler.cpp @@ -174,6 +174,7 @@ bool Crawler::OnUserCreate(){ Inventory::AddItem("Blue Slime Remains",22); LoadLevel(LEVEL_NAMES["starting_map"_S]); + Inventory::AddItem("Blue Slime Remains",10); ChangePlayerClass(WARRIOR); GameState::Initialize(); @@ -1303,6 +1304,8 @@ void Crawler::LoadLevel(MapName map){ totalDamageDealt=0; encounterStarted=false; totalBossEncounterMobs=0; + Inventory::Clear("Monster Loot"); + Inventory::Clear("Stage Loot"); #pragma region Monster Spawn Data Setup for(auto key:MAP_DATA[map].SpawnerData){ diff --git a/Crawler/InventoryScrollableWindowComponent.h b/Crawler/InventoryScrollableWindowComponent.h index b9de1f01..2517ae8c 100644 --- a/Crawler/InventoryScrollableWindowComponent.h +++ b/Crawler/InventoryScrollableWindowComponent.h @@ -126,7 +126,7 @@ protected: }; MenuItemButton*button=NEW MenuItemButton{parentMenu,{{float(totalSpacing*x),float(totalSpacing*y)},{float(buttonSize),float(buttonSize)}},Inventory::get("Consumables"),itemIndex,useItemFunc,parentMenu,"itemName","itemDescription"}; - AddComponent(Menu::menus[parentMenu],"item"+std::to_string(itemIndex),button); + AddComponent(Menu::menus[parentMenu],"item_"+cat+"_"+std::to_string(itemIndex),button); }else if(components.size()>inv.size()){ //There are empty spots, so let's clean up. RemoveEmptySlots(); diff --git a/Crawler/Item.cpp b/Crawler/Item.cpp index 1585fe20..4ac14128 100644 --- a/Crawler/Item.cpp +++ b/Crawler/Item.cpp @@ -1,3 +1,4 @@ +#pragma region License /* License (OLC-3) ~~~~~~~~~~~~~~~ @@ -29,6 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma endregion #include "Item.h" #include "safemap.h" #include "DEFINES.h" @@ -271,4 +273,11 @@ ItemScript&ItemInfo::OnUseAction(){ bool Item::IsBlank(){ return amt==0||it==nullptr; +} + +void Inventory::Clear(ITCategory itemCategory){ + std::vectoritemList=get(itemCategory); //We have to make a copy here because RemoveItem() will modify the list provided by get() inline. + for(IT&item:itemList){ + RemoveItem(item,GetItemCount(item)); + } } \ No newline at end of file diff --git a/Crawler/Item.h b/Crawler/Item.h index 0d29b19f..0dec12d0 100644 --- a/Crawler/Item.h +++ b/Crawler/Item.h @@ -75,6 +75,7 @@ public: static bool UseItem(IT it,uint32_t amt=1); static bool RemoveItem(IT it,uint32_t amt=1); static std::vector&get(ITCategory itemCategory); + static void Clear(ITCategory itemCategory); static bool SwapItems(ITCategory itemCategory,uint32_t slot1,uint32_t slot2); //Makes sure this is a valid category. Will error out if it doesn't exist! Use for ERROR HANDLING! diff --git a/Crawler/Menu.cpp b/Crawler/Menu.cpp index 275d3f4f..49eff436 100644 --- a/Crawler/Menu.cpp +++ b/Crawler/Menu.cpp @@ -1,3 +1,4 @@ +#pragma region License /* License (OLC-3) ~~~~~~~~~~~~~~~ @@ -29,6 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma endregion #include "Crawler.h" #include "MenuComponent.h" #include "DEFINES.h" diff --git a/Crawler/MenuItemButton.h b/Crawler/MenuItemButton.h index 5dd71998..b8834692 100644 --- a/Crawler/MenuItemButton.h +++ b/Crawler/MenuItemButton.h @@ -1,3 +1,4 @@ +#pragma region License /* License (OLC-3) ~~~~~~~~~~~~~~~ @@ -29,6 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma endregion #pragma once #include "Menu.h" #include "MenuLabel.h" diff --git a/Crawler/Version.h b/Crawler/Version.h index 1f9f5a4b..5f26205a 100644 --- a/Crawler/Version.h +++ b/Crawler/Version.h @@ -33,7 +33,7 @@ SUCH DAMAGE. #define VERSION_MAJOR 0 #define VERSION_MINOR 2 #define VERSION_PATCH 1 -#define VERSION_BUILD 2954 +#define VERSION_BUILD 2961 #define stringify(a) stringify_(a) #define stringify_(a) #a