From e5beb64128f4aa3059c231658ab8e5465c347045 Mon Sep 17 00:00:00 2001 From: muiph Date: Tue, 12 Dec 2023 10:39:10 -0500 Subject: [PATCH] Renamed variables to be more fitting. fixed bugs and logic in the textbox private helper functions. fixed limit --- source/Interfaces/Inventory.cpp | 38 ++++++++++---------- source/Interfaces/Inventory.hpp | 6 ++-- source/Interfaces/MainInterface.cpp | 10 +++--- source/Interfaces/Menu.cpp | 4 +-- source/Interfaces/Menu.hpp | 4 +-- source/Interfaces/TextBox.cpp | 56 +++++++++++------------------ source/Interfaces/TextBox.hpp | 18 +++++----- 7 files changed, 60 insertions(+), 76 deletions(-) diff --git a/source/Interfaces/Inventory.cpp b/source/Interfaces/Inventory.cpp index 7a17713f..0ab67b49 100644 --- a/source/Interfaces/Inventory.cpp +++ b/source/Interfaces/Inventory.cpp @@ -13,14 +13,14 @@ namespace i_2D { * @param font The font used by the inventory list */ void Inventory::ConstructInventory(sf::Font &font, const std::vector &interfaceAgentInventory) { - mInventoryWindow = std::make_unique(); - mInventoryWindow->setSize({mWorldSize.x, mWorldSize.y / 2}); - mInventoryWindow->setFillColor(sf::Color::Black); - mInventoryWindow->setPosition(sf::Vector2f{0.f, 50.f}); + mCanvas = std::make_unique(); + mCanvas->setSize({mWorldSize.x, mWorldSize.y / 2}); + mCanvas->setFillColor(sf::Color::Black); + mCanvas->setPosition(sf::Vector2f{0.f, 50.f}); - mInventoryItems.clear(); - mInventoryItems.resize(interfaceAgentInventory.size()); - std::ranges::copy(interfaceAgentInventory,mInventoryItems.begin()); + mItems.clear(); + mItems.resize(interfaceAgentInventory.size()); + std::ranges::copy(interfaceAgentInventory,mItems.begin()); // Set row & col sizes if (mWorldSize.x > 1800) { @@ -38,8 +38,8 @@ namespace i_2D { v1.push_back(std::make_unique