diff --git a/GameObjectManager.cpp b/GameObjectManager.cpp index 5bc3a1c..b58f209 100644 --- a/GameObjectManager.cpp +++ b/GameObjectManager.cpp @@ -173,7 +173,7 @@ void GameObjectManager::initialize() { ActiveObject lock; - lock.name = "lock"; + lock.name = "lockFriend"; lock.activeObjectMesh = ZL::LoadFromTextFile("./lock.txt"); // Add ZL:: namespace lock.activeObjectMesh.Scale(2); lock.activeObjectMeshMutable.AssignFrom(lock.activeObjectMesh); @@ -189,7 +189,7 @@ void GameObjectManager::initialize() { ActiveObject door; - door.name = "door"; + door.name = "doorGlory"; door.activeObjectMesh = ZL::LoadFromTextFile("./door.txt"); // Add ZL:: namespace door.activeObjectMesh.Scale(60); // cubeForFirstRoomO.activeObjectMesh.RotateByMatrix(QuatToMatrix(QuatFromRotateAroundZ(M_PI * 0.5))); @@ -254,7 +254,7 @@ void GameObjectManager::initialize() { room_3.sound_name = "unseen-danger-fss-no-copyright-music-252588--online-audio-convert.com.ogg"; room_3.objects.push_back(lock); room_3.objects.push_back(door); - room_3.roomLogic = createRoom1Logic(); + room_3.roomLogic = createRoom3Logic(); room_3.textMesh = preloadedRoomMeshArr[2]; room_3.textMeshMutable.AssignFrom(room_3.textMesh); room_3.collisionMgr.setRoomBoundary(790, 790); @@ -378,13 +378,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)){ @@ -425,7 +418,7 @@ void GameObjectManager::handleEvent(const SDL_Event& event) { } else if (current_room_index==2) { if (InventoryItem* item = GetItemSelected(true)){ - + if (item->name == "lockFriend"){} } } } @@ -437,7 +430,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++; @@ -445,6 +438,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); diff --git a/GameObjectManager.h b/GameObjectManager.h index 9718ebc..c00afda 100644 --- a/GameObjectManager.h +++ b/GameObjectManager.h @@ -105,6 +105,9 @@ public: std::shared_ptr batteryDialogTexturePtr; // Активная текстура диалога bool isBatteryDialogActive = false; // Флаг активности диалога + bool hasChoisedFriendship = false; + bool hasMadeChoise = false; + private: //int animationCounter = 0; int lastMouseX = 0; // Добавляем переменные для хранения позиции мыши diff --git a/QuestScripts.cpp b/QuestScripts.cpp index 7ca107a..a45b581 100644 --- a/QuestScripts.cpp +++ b/QuestScripts.cpp @@ -44,4 +44,14 @@ namespace ZL }; } + + std::function createRoom3Logic() + { + return [](GameObjectManager& gom, size_t ms) +// Simple test logic + { + + }; + } + } diff --git a/QuestScripts.h b/QuestScripts.h index dcdd1d0..29d001a 100644 --- a/QuestScripts.h +++ b/QuestScripts.h @@ -6,5 +6,6 @@ namespace ZL { std::function createRoom1Logic(); std::function createRoom2Logic(); + std::function createRoom3Logic(); }