mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-28 05:11:37 +00:00
Implemented safer way to check if the game is loaded
This commit is contained in:
parent
56153cb60a
commit
8fe163e7c2
3 changed files with 6 additions and 3 deletions
|
|
@ -3,12 +3,14 @@
|
||||||
#include <ui/window.h>
|
#include <ui/window.h>
|
||||||
#include <patches/audio_patches.h>
|
#include <patches/audio_patches.h>
|
||||||
|
|
||||||
|
bool g_isGameLoaded = false;
|
||||||
double g_deltaTime;
|
double g_deltaTime;
|
||||||
|
|
||||||
// CApplication::Update
|
// CApplication::Update
|
||||||
PPC_FUNC_IMPL(__imp__sub_822C1130);
|
PPC_FUNC_IMPL(__imp__sub_822C1130);
|
||||||
PPC_FUNC(sub_822C1130)
|
PPC_FUNC(sub_822C1130)
|
||||||
{
|
{
|
||||||
|
g_isGameLoaded = true;
|
||||||
g_deltaTime = ctx.f1.f64;
|
g_deltaTime = ctx.f1.f64;
|
||||||
|
|
||||||
SDL_PumpEvents();
|
SDL_PumpEvents();
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
extern bool g_isGameLoaded;
|
||||||
extern double g_deltaTime;
|
extern double g_deltaTime;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
#include "imgui_utils.h"
|
#include "imgui_utils.h"
|
||||||
#include <api/SWA.h>
|
#include <api/SWA.h>
|
||||||
#include <gpu/video.h>
|
#include <gpu/video.h>
|
||||||
#include <ui/installer_wizard.h>
|
#include <app.h>
|
||||||
#include <exports.h>
|
#include <exports.h>
|
||||||
#include <res/images/common/general_window.dds.h>
|
#include <res/images/common/general_window.dds.h>
|
||||||
#include <res/images/common/select_fade.dds.h>
|
#include <res/images/common/select_fade.dds.h>
|
||||||
|
|
@ -149,7 +149,7 @@ void MessageWindow::Draw()
|
||||||
if (!s_isVisible)
|
if (!s_isVisible)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto pInputState = InstallerWizard::s_isVisible ? nullptr : SWA::CInputState::GetInstance();
|
auto pInputState = g_isGameLoaded ? SWA::CInputState::GetInstance() : nullptr;
|
||||||
auto drawList = ImGui::GetForegroundDrawList();
|
auto drawList = ImGui::GetForegroundDrawList();
|
||||||
auto& res = ImGui::GetIO().DisplaySize;
|
auto& res = ImGui::GetIO().DisplaySize;
|
||||||
|
|
||||||
|
|
@ -299,7 +299,7 @@ bool MessageWindow::Open(std::string text, int* result, std::span<std::string> b
|
||||||
|
|
||||||
g_text = text;
|
g_text = text;
|
||||||
g_buttons = std::vector(buttons.begin(), buttons.end());
|
g_buttons = std::vector(buttons.begin(), buttons.end());
|
||||||
g_defaultButtonIndex = defaultButtonIndex;
|
g_defaultButtonIndex = g_isGameLoaded ? defaultButtonIndex : -1;
|
||||||
|
|
||||||
ResetSelection();
|
ResetSelection();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue