prepare final room logic

This commit is contained in:
maka70vv 2025-03-03 07:51:10 +06:00
parent 19c2f62ba9
commit 0db76cb793
2 changed files with 19 additions and 9 deletions

View File

@ -342,13 +342,6 @@ void GameObjectManager::handleEvent(const SDL_Event& event) {
objects_in_inventory--;
}
}
else if (bearName.length() >= 3 && !(bearName.compare("TOM") == 0)) {
bearName = "";
for (const auto& cube : selectedCubes) {
gInventoryMap[cube.name] = cube;
}
selectedCubes.clear();
}
}
else if (current_room_index==1) {
if (InventoryItem* item = GetItemSelected(true)){
@ -389,7 +382,7 @@ void GameObjectManager::handleEvent(const SDL_Event& event) {
}
else if (current_room_index==2) {
if (InventoryItem* item = GetItemSelected(true)){
if (item->name == "lockFriend"){}
}
}
}
@ -401,7 +394,7 @@ void GameObjectManager::handleEvent(const SDL_Event& event) {
continue;
}
if (ao->name != "lampe") {
if (ao->name != "lampe" && ao->name != "doorGlory" && ao->name != "lockFriend" ) {
AddItemToInventory(ao->name, ao->inventoryIconTexturePtr, objects_in_inventory+1);
objects_in_inventory++;
@ -409,6 +402,20 @@ void GameObjectManager::handleEvent(const SDL_Event& event) {
rooms[current_room_index].removeByPtr(ao);
activeObjects = rooms[current_room_index].objects;
}
else if (ao->name != "doorGlory"){
hasMadeChoise = true;
hasChoisedFriendship = false;
// debug switching
switch_room(0);
}
else if (ao->name != "lockFriend"){
hasMadeChoise = true;
hasChoisedFriendship = true;
// debug switching
switch_room(0);
}
//aoMgr.removeByName(ao->name);

View File

@ -103,6 +103,9 @@ public:
std::shared_ptr<Texture> batteryDialogTexturePtr; // Активная текстура диалога
bool isBatteryDialogActive = false; // Флаг активности диалога
bool hasChoisedFriendship = false;
bool hasMadeChoise = false;
private:
//int animationCounter = 0;
int lastMouseX = 0; // Добавляем переменные для хранения позиции мыши