trying to make battery dialog
This commit is contained in:
parent
112be9bb0c
commit
5e7c274645
@ -282,14 +282,14 @@ void GameObjectManager::handleEvent(const SDL_Event& event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isBatteryDialogActive) {
|
if (isBatteryDialogActive) {
|
||||||
BatteryDialogIndex++;
|
BatteryDialogIndex++;
|
||||||
if (BatteryDialogIndex < batteryDialogTextures.size()) {
|
if (BatteryDialogIndex <= batteryDialogTextures.size()) {
|
||||||
batteryDialogTexturePtr = std::make_shared<Texture>(CreateTextureDataFromBmp24(batteryDialogTextures[BatteryDialogIndex]));
|
batteryDialogTexturePtr = std::make_shared<Texture>(CreateTextureDataFromBmp24(batteryDialogTextures[BatteryDialogIndex]));
|
||||||
} else {
|
} else {
|
||||||
isBatteryDialogActive = false;
|
isBatteryDialogActive = false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (event.type == SDL_MOUSEBUTTONDOWN) {
|
else if (event.type == SDL_MOUSEBUTTONDOWN) {
|
||||||
const auto highlightedObjects = rooms[current_room_index].findByHighlighted(true);
|
const auto highlightedObjects = rooms[current_room_index].findByHighlighted(true);
|
||||||
|
|
||||||
|
|||||||
@ -88,7 +88,7 @@ public:
|
|||||||
ZL::VertexRenderStruct monsterScreenMeshMutable;
|
ZL::VertexRenderStruct monsterScreenMeshMutable;
|
||||||
|
|
||||||
std::vector<std::string> dialogTextures = { // Список диалогов
|
std::vector<std::string> dialogTextures = { // Список диалогов
|
||||||
"./start_dialog.bmp",
|
"./photo.bmp",
|
||||||
"./next_dialog.bmp",
|
"./next_dialog.bmp",
|
||||||
"./final_dialog.bmp",
|
"./final_dialog.bmp",
|
||||||
};
|
};
|
||||||
|
|||||||
@ -221,6 +221,8 @@ void RenderSystem::drawUI(const GameObjectManager& gameObjects) {
|
|||||||
renderer.DrawVertexRenderStruct(gameObjects.inventoryIconMeshMutable); // Используем 2D меш инвентаря
|
renderer.DrawVertexRenderStruct(gameObjects.inventoryIconMeshMutable); // Используем 2D меш инвентаря
|
||||||
renderer.PopMatrix();
|
renderer.PopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Отрисовка диалогового окна батарейки
|
||||||
if (gameObjects.isBatteryDialogActive && gameObjects.batteryDialogTexturePtr) {
|
if (gameObjects.isBatteryDialogActive && gameObjects.batteryDialogTexturePtr) {
|
||||||
renderer.PushMatrix();
|
renderer.PushMatrix();
|
||||||
float xPos = Environment::width / 2.0f - 250; // Центрируем
|
float xPos = Environment::width / 2.0f - 250; // Центрируем
|
||||||
@ -232,6 +234,7 @@ void RenderSystem::drawUI(const GameObjectManager& gameObjects) {
|
|||||||
renderer.PopMatrix();
|
renderer.PopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//for (const auto* ao : gameObjects.aoMgr.findByHighlighted(true)) {
|
//for (const auto* ao : gameObjects.aoMgr.findByHighlighted(true)) {
|
||||||
for (auto& ao : gameObjects.rooms[gameObjects.current_room_index].findByHighlighted(true)) {
|
for (auto& ao : gameObjects.rooms[gameObjects.current_room_index].findByHighlighted(true)) {
|
||||||
std::cout << ao->name << std::endl;
|
std::cout << ao->name << std::endl;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user