prepare final room logic
This commit is contained in:
parent
19c2f62ba9
commit
0db76cb793
@ -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);
|
||||
|
||||
@ -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; // Добавляем переменные для хранения позиции мыши
|
||||
|
||||
Loading…
Reference in New Issue
Block a user