diff --git a/UnleashedRecomp/CMakeLists.txt b/UnleashedRecomp/CMakeLists.txt index 24362d72..e36644a9 100644 --- a/UnleashedRecomp/CMakeLists.txt +++ b/UnleashedRecomp/CMakeLists.txt @@ -402,7 +402,9 @@ BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/ga BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/images/game_icon_night.bmp" DEST_FILE "${RESOURCES_OUTPUT_PATH}/images/game_icon_night.bmp" ARRAY_NAME "g_game_icon_night") BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/sounds/sys_worldmap_cursor.wav" DEST_FILE "${RESOURCES_OUTPUT_PATH}/sounds/sys_worldmap_cursor.wav" ARRAY_NAME "g_sys_worldmap_cursor") BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/sounds/sys_worldmap_finaldecide.wav" DEST_FILE "${RESOURCES_OUTPUT_PATH}/sounds/sys_worldmap_finaldecide.wav" ARRAY_NAME "g_sys_worldmap_finaldecide") +BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/sounds/sys_actstg_pausecansel.wav" DEST_FILE "${RESOURCES_OUTPUT_PATH}/sounds/sys_actstg_pausecansel.wav" ARRAY_NAME "g_sys_actstg_pausecansel") BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/sounds/sys_actstg_pausecursor.wav" DEST_FILE "${RESOURCES_OUTPUT_PATH}/sounds/sys_actstg_pausecursor.wav" ARRAY_NAME "g_sys_actstg_pausecursor") BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/sounds/sys_actstg_pausedecide.wav" DEST_FILE "${RESOURCES_OUTPUT_PATH}/sounds/sys_actstg_pausedecide.wav" ARRAY_NAME "g_sys_actstg_pausedecide") +BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/sounds/sys_actstg_pausewinclose.wav" DEST_FILE "${RESOURCES_OUTPUT_PATH}/sounds/sys_actstg_pausewinclose.wav" ARRAY_NAME "g_sys_actstg_pausewinclose") BIN2C(TARGET_OBJ UnleashedRecomp SOURCE_FILE "${RESOURCES_SOURCE_PATH}/sounds/sys_actstg_pausewinopen.wav" DEST_FILE "${RESOURCES_OUTPUT_PATH}/sounds/sys_actstg_pausewinopen.wav" ARRAY_NAME "g_sys_actstg_pausewinopen") diff --git a/UnleashedRecomp/apu/audio.cpp b/UnleashedRecomp/apu/audio.cpp index 7bb0aed3..76dac7cc 100644 --- a/UnleashedRecomp/apu/audio.cpp +++ b/UnleashedRecomp/apu/audio.cpp @@ -7,6 +7,7 @@ #define AUDIO_DRIVER_KEY (uint32_t)('DAUD') +// Use to dump raw audio captures to the game folder. //#define AUDIO_DUMP_SAMPLES_PATH "audio.pcm" #ifdef AUDIO_DUMP_SAMPLES_PATH diff --git a/UnleashedRecomp/apu/embedded_player.cpp b/UnleashedRecomp/apu/embedded_player.cpp index cfb3308d..acecc3c5 100644 --- a/UnleashedRecomp/apu/embedded_player.cpp +++ b/UnleashedRecomp/apu/embedded_player.cpp @@ -5,16 +5,20 @@ #include #include +#include #include #include +#include #include enum class EmbeddedSound { SysWorldMapCursor, SysWorldMapFinalDecide, + SysActStgPauseCansel, SysActStgPauseCursor, SysActStgPauseDecide, + SysActStgPauseWinClose, SysActStgPauseWinOpen, Count, }; @@ -34,8 +38,10 @@ static const std::unordered_map g_embeddedSoundMap = { { "sys_worldmap_cursor", EmbeddedSound::SysWorldMapCursor }, { "sys_worldmap_finaldecide", EmbeddedSound::SysWorldMapFinalDecide }, + { "sys_actstg_pausecansel", EmbeddedSound::SysActStgPauseCansel }, { "sys_actstg_pausecursor", EmbeddedSound::SysActStgPauseCursor }, { "sys_actstg_pausedecide", EmbeddedSound::SysActStgPauseDecide }, + { "sys_actstg_pausewinclose", EmbeddedSound::SysActStgPauseWinClose }, { "sys_actstg_pausewinopen", EmbeddedSound::SysActStgPauseWinOpen }, }; @@ -60,6 +66,10 @@ static void PlayEmbeddedSound(EmbeddedSound s) soundData = g_sys_worldmap_finaldecide; soundDataSize = sizeof(g_sys_worldmap_finaldecide); break; + case EmbeddedSound::SysActStgPauseCansel: + soundData = g_sys_actstg_pausecansel; + soundDataSize = sizeof(g_sys_actstg_pausecansel); + break; case EmbeddedSound::SysActStgPauseCursor: soundData = g_sys_actstg_pausecursor; soundDataSize = sizeof(g_sys_actstg_pausecursor); @@ -68,6 +78,10 @@ static void PlayEmbeddedSound(EmbeddedSound s) soundData = g_sys_actstg_pausedecide; soundDataSize = sizeof(g_sys_actstg_pausedecide); break; + case EmbeddedSound::SysActStgPauseWinClose: + soundData = g_sys_actstg_pausewinclose; + soundDataSize = sizeof(g_sys_actstg_pausewinclose); + break; case EmbeddedSound::SysActStgPauseWinOpen: soundData = g_sys_actstg_pausewinopen; soundDataSize = sizeof(g_sys_actstg_pausewinopen); diff --git a/UnleashedRecomp/ui/installer_wizard.cpp b/UnleashedRecomp/ui/installer_wizard.cpp index cecc2c03..104a25e1 100644 --- a/UnleashedRecomp/ui/installer_wizard.cpp +++ b/UnleashedRecomp/ui/installer_wizard.cpp @@ -134,7 +134,7 @@ static WizardPage g_currentPage = g_firstPage; static std::string g_currentMessagePrompt = ""; static bool g_currentMessagePromptConfirmation = false; static int g_currentMessageResult = -1; -static bool g_currentMessageUpdateRemaining = false; +static bool g_filesPickerSkipUpdate = false; static ImVec2 g_joypadAxis = {}; static int g_currentCursorIndex = -1; static int g_currentCursorDefault = 0; @@ -217,7 +217,7 @@ public: case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEMOTION: { - for (size_t i = 0; i < g_currentCursorRects.size(); i++) + for (size_t i = 0; i < g_currentCursorRects.size() && !g_filesPickerSkipUpdate; i++) { auto ¤tRect = g_currentCursorRects[i]; if (ImGui::IsMouseHoveringRect(currentRect.first, currentRect.second, false)) @@ -888,7 +888,7 @@ static bool ShowFilesPicker(std::list &filePaths) const nfdpathset_t *pathSet; nfdresult_t result = NFD_OpenDialogMultipleU8(&pathSet, nullptr, 0, nullptr); - g_currentMessageUpdateRemaining = true; + g_filesPickerSkipUpdate = true; if (result == NFD_OKAY) { @@ -908,7 +908,7 @@ static bool ShowFoldersPicker(std::list &folderPaths) const nfdpathset_t *pathSet; nfdresult_t result = NFD_PickFolderMultipleU8(&pathSet, nullptr); - g_currentMessageUpdateRemaining = true; + g_filesPickerSkipUpdate = true; if (result == NFD_OKAY) { @@ -1012,6 +1012,8 @@ static void DrawLanguagePicker() static void DrawSourcePickers() { + g_filesPickerSkipUpdate = false; + bool buttonPressed = false; std::list paths; if (g_currentPage == WizardPage::SelectGameAndUpdate || g_currentPage == WizardPage::SelectDLC) @@ -1301,17 +1303,16 @@ static void DrawBorders() static void DrawMessagePrompt() { - if (g_currentMessagePrompt.empty()) - { - return; - } - - if (g_currentMessageUpdateRemaining) + if (g_filesPickerSkipUpdate) { // If a blocking function like the files picker is called, we must wait one update before actually showing // the message box, as a lot of time has passed since the last real update. Otherwise, animations will play // too quickly and input glitches might happen. - g_currentMessageUpdateRemaining = false; + return; + } + + if (g_currentMessagePrompt.empty()) + { return; } diff --git a/UnleashedRecompResources b/UnleashedRecompResources index c66456b9..86376058 160000 --- a/UnleashedRecompResources +++ b/UnleashedRecompResources @@ -1 +1 @@ -Subproject commit c66456b90dcd4d6e158c3a58f9580c81a2dc015a +Subproject commit 86376058708c6b729a451df391617aaabf91018a