diff --git a/toolkit/editor/editor/editor.cc b/toolkit/editor/editor/editor.cc index e0b5b7636..eae813212 100644 --- a/toolkit/editor/editor/editor.cc +++ b/toolkit/editor/editor/editor.cc @@ -40,12 +40,6 @@ Create() IO::AssignRegistry::Instance()->SetAssign(IO::Assign("work", "proj:work")); IO::AssignRegistry::Instance()->SetAssign(IO::Assign("assets", "work:assets")); - Scripting::ScriptServer::Instance()->AddModulePath("edscr:"); - Scripting::ScriptServer::Instance()->EvalFile("edscr:bootstrap.py"); - - /// Import reload to be able to reload modules. - Scripting::ScriptServer::Instance()->Eval("from importlib import reload"); - Game::TimeSourceCreateInfo editorTimeSourceInfo; editorTimeSourceInfo.hash = TIMESOURCE_EDITOR; Game::TimeManager::CreateTimeSource(editorTimeSourceInfo); @@ -63,7 +57,21 @@ Create() CreatePathConverter({}); Game::EditorState::Singleton = new Game::EditorState(); - Game::EditorState::Instance()->isRunning = true; +} + +//------------------------------------------------------------------------------ +/** +*/ +void +Start() +{ + Scripting::ScriptServer::Instance()->AddModulePath("edscr:"); + Scripting::ScriptServer::Instance()->EvalFile("edscr:bootstrap.py"); + + /// Import reload to be able to reload modules. + Scripting::ScriptServer::Instance()->Eval("from importlib import reload"); + + Game::EditorState::Instance()->isRunning = true; } //------------------------------------------------------------------------------ diff --git a/toolkit/editor/editor/editor.h b/toolkit/editor/editor/editor.h index e4cb35ec9..0a7a31dbd 100644 --- a/toolkit/editor/editor/editor.h +++ b/toolkit/editor/editor/editor.h @@ -47,6 +47,9 @@ struct State /// Create the editor void Create(); +/// Start the editor +void Start(); + /// Destroy the editor void Destroy(); diff --git a/toolkit/editor/editorfeature/editorfeatureunit.cc b/toolkit/editor/editorfeature/editorfeatureunit.cc index 97b30fb21..853ab060c 100644 --- a/toolkit/editor/editorfeature/editorfeatureunit.cc +++ b/toolkit/editor/editorfeature/editorfeatureunit.cc @@ -64,6 +64,8 @@ EditorFeatureUnit::OnActivate() this->AttachManager(Editor::UIManager::Create()); + Editor::Start(); + // TODO: move this to a game manager that is created by the editor Game::World* world = Game::GetWorld(WORLD_DEFAULT);