Disable Editor when its disabled

This commit is contained in:
MegaMech
2025-04-25 08:08:52 -06:00
parent 0b6c37e067
commit 2b9acc677f
2 changed files with 12 additions and 0 deletions
+11
View File
@@ -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();
+1
View File
@@ -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;