diff --git a/src/engine/editor/Editor.cpp b/src/engine/editor/Editor.cpp index d0093d035..446da7487 100644 --- a/src/engine/editor/Editor.cpp +++ b/src/engine/editor/Editor.cpp @@ -41,6 +41,14 @@ namespace Editor { } void Editor::Tick() { + + if (CVarGetInteger("gEditorEnabled", 0) == true) { + bEditorEnabled = true; + } else { + bEditorEnabled = false; + return; + } + auto wnd = GameEngine::Instance->context->GetWindow(); static bool wasMouseDown = false; @@ -94,6 +102,9 @@ namespace Editor { } void Editor::Draw() { + if (!bEditorEnabled) { + return; + } eObjectPicker.Draw(); for (auto& object : eGameObjects) { object->Draw(); diff --git a/src/engine/editor/Editor.h b/src/engine/editor/Editor.h index e3b74b5fc..759c59355 100644 --- a/src/engine/editor/Editor.h +++ b/src/engine/editor/Editor.h @@ -29,6 +29,7 @@ public: void SetLevelDimensions(s16 minX, s16 maxX, s16 minZ, s16 maxZ, s16 minY, s16 maxY); void ClearMatrixPool(); void DeleteObject(); + bool bEditorEnabled = false; private: bool _draw = false;