Fixing bug in inventory
This commit is contained in:
parent
0cc384028f
commit
f61a12f874
@ -181,7 +181,7 @@ namespace ZL {
|
|||||||
|
|
||||||
auto btn = uiManager.findButton(btnName);
|
auto btn = uiManager.findButton(btnName);
|
||||||
if (btn) {
|
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;
|
btn->texNormal = btn->texHover = btn->texPressed = tex;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ namespace ZL {
|
|||||||
const std::string prevBtnName = "item" + std::to_string(inventorySelectedIndex_ + 1) + "Button";
|
const std::string prevBtnName = "item" + std::to_string(inventorySelectedIndex_ + 1) + "Button";
|
||||||
auto prevBtn = uiManager.findButton(prevBtnName);
|
auto prevBtn = uiManager.findButton(prevBtnName);
|
||||||
if (prevBtn) {
|
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;
|
prevBtn->texNormal = prevBtn->texHover = prevBtn->texPressed = tex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -224,7 +224,7 @@ namespace ZL {
|
|||||||
auto btn = uiManager.findButton(btnName);
|
auto btn = uiManager.findButton(btnName);
|
||||||
if (btn) {
|
if (btn) {
|
||||||
const std::string& selPath = item.selectedIcon.empty() ? item.icon : item.selectedIcon;
|
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;
|
btn->texNormal = btn->texHover = btn->texPressed = tex;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -232,7 +232,7 @@ namespace ZL {
|
|||||||
auto img = uiManager.findStaticImage("selectedItemPic");
|
auto img = uiManager.findStaticImage("selectedItemPic");
|
||||||
if (img) {
|
if (img) {
|
||||||
const std::string& path = item.selectedIcon.empty() ? item.icon : item.selectedIcon;
|
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);
|
uiManager.setText("selectedText", item.name);
|
||||||
@ -779,7 +779,7 @@ namespace ZL {
|
|||||||
inc ? texBubbleInLB_ : texBubbleOutLB_,
|
inc ? texBubbleInLB_ : texBubbleOutLB_,
|
||||||
inc ? texBubbleInRT_ : texBubbleOutRT_,
|
inc ? texBubbleInRT_ : texBubbleOutRT_,
|
||||||
inc ? texBubbleInRB_ : texBubbleOutRB_,
|
inc ? texBubbleInRB_ : texBubbleOutRB_,
|
||||||
renderer, "resources/fonts/DroidSans.ttf", 20, zipFile_);
|
renderer, "resources/fonts/DroidSans.ttf", 20, CONST_ZIP_FILE);
|
||||||
if (!nodeName.empty()) {
|
if (!nodeName.empty()) {
|
||||||
auto n = uiManager.findNode(nodeName);
|
auto n = uiManager.findNode(nodeName);
|
||||||
phoneChatVisibleBubbles_.push_back({ nodeName, n ? n->height : 60.0f });
|
phoneChatVisibleBubbles_.push_back({ nodeName, n ? n->height : 60.0f });
|
||||||
@ -806,7 +806,7 @@ namespace ZL {
|
|||||||
incoming ? texBubbleInLB_ : texBubbleOutLB_,
|
incoming ? texBubbleInLB_ : texBubbleOutLB_,
|
||||||
incoming ? texBubbleInRT_ : texBubbleOutRT_,
|
incoming ? texBubbleInRT_ : texBubbleOutRT_,
|
||||||
incoming ? texBubbleInRB_ : texBubbleOutRB_,
|
incoming ? texBubbleInRB_ : texBubbleOutRB_,
|
||||||
renderer, "resources/fonts/DroidSans.ttf", 20, zipFile_);
|
renderer, "resources/fonts/DroidSans.ttf", 20, CONST_ZIP_FILE);
|
||||||
|
|
||||||
if (nodeName.empty()) return;
|
if (nodeName.empty()) return;
|
||||||
|
|
||||||
|
|||||||
@ -112,7 +112,7 @@ namespace ZL {
|
|||||||
|
|
||||||
GameState state = GameState::Gameplay;
|
GameState state = GameState::Gameplay;
|
||||||
Inventory* inventory = nullptr;
|
Inventory* inventory = nullptr;
|
||||||
std::string zipFile_;
|
//std::string zipFile_;
|
||||||
int inventorySelectedIndex_ = -1;
|
int inventorySelectedIndex_ = -1;
|
||||||
|
|
||||||
enum class UniIntTutorialState { Step10, Step11, DarklandsActive, DarklandsStep13, DarklandsFull };
|
enum class UniIntTutorialState { Step10, Step11, DarklandsActive, DarklandsStep13, DarklandsFull };
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user