Skip to content

Commit 2f1c2d1

Browse files
committed
fix(ImGui_Editor): fix opening Theatre in editor while actively playing it
1 parent b2823dd commit 2f1c2d1

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Editor/gui/imgui_editor.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ void ImGui_Editor::TheatreEntered()
120120
ID _viewport_uid_3d{}, _viewport_uid_2d{};
121121
if(not Settings::Engine::IsEditorHint or not (
122122
m_spEditorTheatre = dynamic_cast<EditorTheatre*>(Theatre::Current())))
123-
{ return; }
123+
{
124+
if(mEditorTheatreData.data.empty())
125+
{ mEditorTheatreData = Theatre::Current()->InitialState(); }
126+
return;
127+
}
124128

125129
if(not Theatre::Current()->ThingExists("Editor-3DViewport"))
126130
{ _viewport_uid_3d = Theatre::Current()->CreateThing({ThingType::Viewport, "Editor-3DViewport"}); }
@@ -301,7 +305,7 @@ void ImGui_Editor::Update()
301305

302306
void ImGui_Editor::LoadEditorTheatre(bool inContinue)
303307
{
304-
sEditorJustLoaded = Settings::Engine::IsEditorHint;
308+
sEditorJustLoaded = Settings::Engine::IsEditorHint = true;
305309
g_pTheatreManager->SetNextTheatreType<EditorTheatre>();
306310
if(inContinue)
307311
{ g_pTheatreManager->LoadFromData(mEditorTheatreData); }

0 commit comments

Comments
 (0)