mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-06 19:45:33 +00:00
FullscreenUI: Fix possible crash with RAIntegration
This commit is contained in:
parent
e67ce7b54d
commit
b2dcf39f8b
@ -734,7 +734,8 @@ bool FullscreenUI::Initialize()
|
||||
if (s_state.initialized)
|
||||
return true;
|
||||
|
||||
if (s_state.tried_to_initialize)
|
||||
// some achievement callbacks fire early while e.g. there is a load state popup blocking system init
|
||||
if (s_state.tried_to_initialize || !ImGuiManager::IsInitialized())
|
||||
return false;
|
||||
|
||||
ImGuiFullscreen::SetAnimations(Host::GetBaseBoolSettingValue("Main", "FullscreenUIAnimations", true));
|
||||
|
@ -311,6 +311,11 @@ ImGuiContext* ImGuiManager::GetMainContext()
|
||||
return s_state.imgui_context;
|
||||
}
|
||||
|
||||
bool ImGuiManager::IsInitialized()
|
||||
{
|
||||
return (s_state.imgui_context != nullptr);
|
||||
}
|
||||
|
||||
void ImGuiManager::SetScreenMargin(float margin)
|
||||
{
|
||||
s_state.screen_margin = std::max(margin, 0.0f);
|
||||
|
@ -86,6 +86,9 @@ void Shutdown();
|
||||
/// Returns main ImGui context.
|
||||
ImGuiContext* GetMainContext();
|
||||
|
||||
/// Returns true if there is currently a context created.
|
||||
bool IsInitialized();
|
||||
|
||||
/// Sets the size of the screen margins, or "safe zone".
|
||||
void SetScreenMargin(float margin);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user