From f61a12f874a058f5d31e0d895fc20f88885a2acc Mon Sep 17 00:00:00 2001 From: Vladislav Khorev Date: Sat, 6 Jun 2026 18:40:40 +0300 Subject: [PATCH] Fixing bug in inventory --- src/MenuManager.cpp | 12 ++++++------ src/MenuManager.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/MenuManager.cpp b/src/MenuManager.cpp index dc6add2..301b3ed 100644 --- a/src/MenuManager.cpp +++ b/src/MenuManager.cpp @@ -181,7 +181,7 @@ namespace ZL { auto btn = uiManager.findButton(btnName); if (btn) { - auto tex = renderer.textureManager.LoadFromPng(items[i].icon, zipFile_, true); + auto tex = renderer.textureManager.LoadFromPng(items[i].icon, CONST_ZIP_FILE, true); btn->texNormal = btn->texHover = btn->texPressed = tex; } @@ -211,7 +211,7 @@ namespace ZL { const std::string prevBtnName = "item" + std::to_string(inventorySelectedIndex_ + 1) + "Button"; auto prevBtn = uiManager.findButton(prevBtnName); if (prevBtn) { - auto tex = renderer.textureManager.LoadFromPng(items[inventorySelectedIndex_].icon, zipFile_, true); + auto tex = renderer.textureManager.LoadFromPng(items[inventorySelectedIndex_].icon, CONST_ZIP_FILE, true); prevBtn->texNormal = prevBtn->texHover = prevBtn->texPressed = tex; } } @@ -224,7 +224,7 @@ namespace ZL { auto btn = uiManager.findButton(btnName); if (btn) { const std::string& selPath = item.selectedIcon.empty() ? item.icon : item.selectedIcon; - auto tex = renderer.textureManager.LoadFromPng(selPath, zipFile_, true); + auto tex = renderer.textureManager.LoadFromPng(selPath, CONST_ZIP_FILE, true); btn->texNormal = btn->texHover = btn->texPressed = tex; } @@ -232,7 +232,7 @@ namespace ZL { auto img = uiManager.findStaticImage("selectedItemPic"); if (img) { const std::string& path = item.selectedIcon.empty() ? item.icon : item.selectedIcon; - img->texture = renderer.textureManager.LoadFromPng(path, zipFile_, true); + img->texture = renderer.textureManager.LoadFromPng(path, CONST_ZIP_FILE, true); } uiManager.setText("selectedText", item.name); @@ -779,7 +779,7 @@ namespace ZL { inc ? texBubbleInLB_ : texBubbleOutLB_, inc ? texBubbleInRT_ : texBubbleOutRT_, inc ? texBubbleInRB_ : texBubbleOutRB_, - renderer, "resources/fonts/DroidSans.ttf", 20, zipFile_); + renderer, "resources/fonts/DroidSans.ttf", 20, CONST_ZIP_FILE); if (!nodeName.empty()) { auto n = uiManager.findNode(nodeName); phoneChatVisibleBubbles_.push_back({ nodeName, n ? n->height : 60.0f }); @@ -806,7 +806,7 @@ namespace ZL { incoming ? texBubbleInLB_ : texBubbleOutLB_, incoming ? texBubbleInRT_ : texBubbleOutRT_, incoming ? texBubbleInRB_ : texBubbleOutRB_, - renderer, "resources/fonts/DroidSans.ttf", 20, zipFile_); + renderer, "resources/fonts/DroidSans.ttf", 20, CONST_ZIP_FILE); if (nodeName.empty()) return; diff --git a/src/MenuManager.h b/src/MenuManager.h index 82acd44..22f564f 100644 --- a/src/MenuManager.h +++ b/src/MenuManager.h @@ -112,7 +112,7 @@ namespace ZL { GameState state = GameState::Gameplay; Inventory* inventory = nullptr; - std::string zipFile_; + //std::string zipFile_; int inventorySelectedIndex_ = -1; enum class UniIntTutorialState { Step10, Step11, DarklandsActive, DarklandsStep13, DarklandsFull };