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