This commit is contained in:
Vladislav Khorev committed 2026-04-17 16:30:09 +03:00
commit 3778a603f2
9 files changed
+304 -98

No files matched your search

+19 -8
View File
@@ -55,6 +55,7 @@ namespace ZL
: newTickCount(0)
, lastTickCount(0)
, menuManager(renderer)
, audioPlayer(std::make_unique<AudioPlayerAsync>())
{
}
@@ -211,6 +212,15 @@ namespace ZL
loadingCompleted = true;
if (audioPlayer->init()) {
audioPlayer->setMusicVolume(100);
audioPlayer->setSoundVolume(80);
std::cout << "Audio initialized successfully" << std::endl;
}
else {
std::cout << "Audio initialization failed" << std::endl;
}
}
void Game::drawUI()
@@ -474,16 +484,17 @@ namespace ZL
}
}
if (event.type == SDL_KEYDOWN) {
if (currentLocation && currentLocation->dialogueSystem.handleKeyDown(event.key.keysym.sym))
{
continue;
}
}
if (event.type == SDL_KEYDOWN && event.key.repeat == 0) {
switch (event.key.keysym.sym) {
case SDLK_1:
if (audioPlayer) audioPlayer->playSoundAsync("resources/sounds/background.wav");
break;
case SDLK_2:
if (audioPlayer) audioPlayer->playMusicAsync("resources/sounds/lullaby-music-vol20-186394--online-audio-convert.com.ogg");
break;
case SDLK_3:
if (audioPlayer) audioPlayer->stopMusicAsync();
break;
case SDLK_f:
currentLocation->dialogueSystem.startDialogue("test_choice_dialogue");
break;