adding cubes in inventory map ifuncorrect name
This commit is contained in:
parent
4f2741765b
commit
c39eac4241
@ -10,6 +10,9 @@ namespace ZL {
|
|||||||
const float GameObjectManager::INVENTORY_ICON_SIZE = 44.0f;
|
const float GameObjectManager::INVENTORY_ICON_SIZE = 44.0f;
|
||||||
const float GameObjectManager::INVENTORY_MARGIN = 20.0f;
|
const float GameObjectManager::INVENTORY_MARGIN = 20.0f;
|
||||||
|
|
||||||
|
const float GameObjectManager::SELECTED_CUBE_ICON_SIZE = 44.0f;
|
||||||
|
const float GameObjectManager::SELECTED_CUBE_MARGIN = 20.0f;
|
||||||
|
|
||||||
void GameObjectManager::initializeLoadingScreen()
|
void GameObjectManager::initializeLoadingScreen()
|
||||||
{
|
{
|
||||||
loadingScreenTexturePtr = std::make_shared<Texture>(CreateTextureDataFromBmp24("./loading.bmp"));
|
loadingScreenTexturePtr = std::make_shared<Texture>(CreateTextureDataFromBmp24("./loading.bmp"));
|
||||||
@ -216,19 +219,25 @@ void GameObjectManager::handleEvent(const SDL_Event& event) {
|
|||||||
if (item->name == "cube_T"){
|
if (item->name == "cube_T"){
|
||||||
bearName += "T";
|
bearName += "T";
|
||||||
selectedCubes.push_back(*item);
|
selectedCubes.push_back(*item);
|
||||||
|
gInventoryMap.erase(item->name);
|
||||||
}
|
}
|
||||||
else if (item->name == "cube_O"){
|
else if (item->name == "cube_O"){
|
||||||
bearName += "O";
|
bearName += "O";
|
||||||
selectedCubes.push_back(*item);
|
selectedCubes.push_back(*item);
|
||||||
|
gInventoryMap.erase(item->name);
|
||||||
}
|
}
|
||||||
else if (item->name == "cube_M"){
|
else if (item->name == "cube_M"){
|
||||||
bearName += "M";
|
bearName += "M";
|
||||||
selectedCubes.push_back(*item);
|
selectedCubes.push_back(*item);
|
||||||
|
gInventoryMap.erase(item->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (bearName.length() >= 3 && !(bearName.compare("TOM") == 0)) {
|
else if (bearName.length() >= 3 && !(bearName.compare("TOM") == 0)) {
|
||||||
bearName = "";
|
bearName = "";
|
||||||
|
for (const auto& cube : selectedCubes) {
|
||||||
|
gInventoryMap[cube.name] = cube;
|
||||||
|
}
|
||||||
selectedCubes.clear();
|
selectedCubes.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user