diff --git a/UnleashedRecomp/app.cpp b/UnleashedRecomp/app.cpp index 18187e51..8d5e8b37 100644 --- a/UnleashedRecomp/app.cpp +++ b/UnleashedRecomp/app.cpp @@ -3,12 +3,14 @@ #include #include +bool g_isGameLoaded = false; double g_deltaTime; // CApplication::Update PPC_FUNC_IMPL(__imp__sub_822C1130); PPC_FUNC(sub_822C1130) { + g_isGameLoaded = true; g_deltaTime = ctx.f1.f64; SDL_PumpEvents(); diff --git a/UnleashedRecomp/app.h b/UnleashedRecomp/app.h index 4e1d379e..b9b1bf5c 100644 --- a/UnleashedRecomp/app.h +++ b/UnleashedRecomp/app.h @@ -1,3 +1,4 @@ #pragma once +extern bool g_isGameLoaded; extern double g_deltaTime; diff --git a/UnleashedRecomp/ui/message_window.cpp b/UnleashedRecomp/ui/message_window.cpp index adcff1e5..eb21a8cd 100644 --- a/UnleashedRecomp/ui/message_window.cpp +++ b/UnleashedRecomp/ui/message_window.cpp @@ -2,7 +2,7 @@ #include "imgui_utils.h" #include #include -#include +#include #include #include #include @@ -149,7 +149,7 @@ void MessageWindow::Draw() if (!s_isVisible) return; - auto pInputState = InstallerWizard::s_isVisible ? nullptr : SWA::CInputState::GetInstance(); + auto pInputState = g_isGameLoaded ? SWA::CInputState::GetInstance() : nullptr; auto drawList = ImGui::GetForegroundDrawList(); auto& res = ImGui::GetIO().DisplaySize; @@ -299,7 +299,7 @@ bool MessageWindow::Open(std::string text, int* result, std::span b g_text = text; g_buttons = std::vector(buttons.begin(), buttons.end()); - g_defaultButtonIndex = defaultButtonIndex; + g_defaultButtonIndex = g_isGameLoaded ? defaultButtonIndex : -1; ResetSelection();