mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-07 12:05:52 +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)
|
if (s_state.initialized)
|
||||||
return true;
|
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;
|
return false;
|
||||||
|
|
||||||
ImGuiFullscreen::SetAnimations(Host::GetBaseBoolSettingValue("Main", "FullscreenUIAnimations", true));
|
ImGuiFullscreen::SetAnimations(Host::GetBaseBoolSettingValue("Main", "FullscreenUIAnimations", true));
|
||||||
|
@ -311,6 +311,11 @@ ImGuiContext* ImGuiManager::GetMainContext()
|
|||||||
return s_state.imgui_context;
|
return s_state.imgui_context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ImGuiManager::IsInitialized()
|
||||||
|
{
|
||||||
|
return (s_state.imgui_context != nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
void ImGuiManager::SetScreenMargin(float margin)
|
void ImGuiManager::SetScreenMargin(float margin)
|
||||||
{
|
{
|
||||||
s_state.screen_margin = std::max(margin, 0.0f);
|
s_state.screen_margin = std::max(margin, 0.0f);
|
||||||
|
@ -86,6 +86,9 @@ void Shutdown();
|
|||||||
/// Returns main ImGui context.
|
/// Returns main ImGui context.
|
||||||
ImGuiContext* GetMainContext();
|
ImGuiContext* GetMainContext();
|
||||||
|
|
||||||
|
/// Returns true if there is currently a context created.
|
||||||
|
bool IsInitialized();
|
||||||
|
|
||||||
/// Sets the size of the screen margins, or "safe zone".
|
/// Sets the size of the screen margins, or "safe zone".
|
||||||
void SetScreenMargin(float margin);
|
void SetScreenMargin(float margin);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user