Build script options are now disabled when in play or pause mode

This commit is contained in:
Kah Wei 2022-11-05 15:34:56 +08:00
parent 06afd384af
commit 04e2c255b0
1 changed files with 2 additions and 0 deletions

View File

@ -117,6 +117,7 @@ namespace SHADE
auto* scriptEngine = static_cast<SHScriptEngine*>(SHSystemManager::GetSystem<SHScriptEngine>()); auto* scriptEngine = static_cast<SHScriptEngine*>(SHSystemManager::GetSystem<SHScriptEngine>());
scriptEngine->GenerateScriptsCsProjFile(); scriptEngine->GenerateScriptsCsProjFile();
} }
ImGui::BeginDisabled(SHSystemManager::GetSystem<SHEditor>()->editorState != SHEditor::State::STOP);
if (ImGui::Selectable("Build Scripts - Debug")) if (ImGui::Selectable("Build Scripts - Debug"))
{ {
auto* scriptEngine = static_cast<SHScriptEngine*>(SHSystemManager::GetSystem<SHScriptEngine>()); auto* scriptEngine = static_cast<SHScriptEngine*>(SHSystemManager::GetSystem<SHScriptEngine>());
@ -131,6 +132,7 @@ namespace SHADE
scriptEngine->BuildScriptAssembly(false, true); scriptEngine->BuildScriptAssembly(false, true);
SHSceneManager::RestartScene(SHSceneManager::GetCurrentSceneAssetID()); SHSceneManager::RestartScene(SHSceneManager::GetCurrentSceneAssetID());
} }
ImGui::EndDisabled();
ImGui::EndMenu(); ImGui::EndMenu();
} }