diff --git a/.gitignore b/.gitignore index 5d998cfd..06ae45fd 100644 --- a/.gitignore +++ b/.gitignore @@ -364,3 +364,7 @@ MigrationBackup/ *.filters Assets/Editor/Layouts/UserLayout.ini + +JSON/Schemas/Catalog/ + +Assets/Editor/Editor.SHConfig diff --git a/SHADE_Application/src/Application/SBApplication.cpp b/SHADE_Application/src/Application/SBApplication.cpp index dfeb781b..5f451dea 100644 --- a/SHADE_Application/src/Application/SBApplication.cpp +++ b/SHADE_Application/src/Application/SBApplication.cpp @@ -67,6 +67,9 @@ namespace Sandbox SHFileUtilities::SetWorkDirToExecDir(); WindowData wndData{}; auto& appConfig = SHConfigurationManager::LoadApplicationConfig(&wndData); +#if SHEDITOR + auto& editorConfig = SHConfigurationManager::LoadEditorConfig(&wndData); +#endif window.Create(hInstance, hPrevInstance, lpCmdLine, nCmdShow, wndData); // Create Systems @@ -156,8 +159,11 @@ namespace Sandbox SHSystemManager::Init(); +#if SHEDITOR + SHSceneManager::InitSceneManager(editorConfig.workingSceneID); +#else SHSceneManager::InitSceneManager(appConfig.startingSceneID); - +#endif SHFrameRateController::UpdateFRC(); // Link up SHDebugDraw diff --git a/SHADE_Engine/src/Editor/Command/SHCommandManager.cpp b/SHADE_Engine/src/Editor/Command/SHCommandManager.cpp index b86f9247..fec30142 100644 --- a/SHADE_Engine/src/Editor/Command/SHCommandManager.cpp +++ b/SHADE_Engine/src/Editor/Command/SHCommandManager.cpp @@ -18,11 +18,17 @@ namespace SHADE SHCommandManager::CommandStackPtr SHCommandManager::pCurrUndoStack(&undoStack); SHCommandManager::CommandStackPtr SHCommandManager::pCurrRedoStack(&redoStack); + bool SHCommandManager::failedExecution(false); void SHCommandManager::PerformCommand(BaseCommandPtr commandPtr, bool const& overrideValue) { - *pCurrRedoStack = CommandStack(defaultStackSize); commandPtr->Execute(); + if(failedExecution) + { + failedExecution = false; + return; + } + *pCurrRedoStack = CommandStack(defaultStackSize); if (overrideValue && !pCurrUndoStack->Empty()) { pCurrUndoStack->Top()->Merge(commandPtr); @@ -68,12 +74,14 @@ namespace SHADE void SHCommandManager::PopLatestCommandFromRedoStack() { - pCurrRedoStack->Pop(); + if(!pCurrRedoStack->Empty()) + pCurrRedoStack->Pop(); } void SHCommandManager::PopLatestCommandFromUndoStack() { - pCurrUndoStack->Pop(); + if(!pCurrUndoStack->Empty()) + pCurrUndoStack->Pop(); } void SHCommandManager::SwapStacks() diff --git a/SHADE_Engine/src/Editor/Command/SHCommandManager.h b/SHADE_Engine/src/Editor/Command/SHCommandManager.h index 178347b5..f3574030 100644 --- a/SHADE_Engine/src/Editor/Command/SHCommandManager.h +++ b/SHADE_Engine/src/Editor/Command/SHCommandManager.h @@ -38,7 +38,8 @@ namespace SHADE static void SwapStacks(); static void ClearAll(); - + + static bool failedExecution; static constexpr CommandStack::SizeType defaultStackSize = 100; private: static CommandStackPtr pCurrUndoStack; diff --git a/SHADE_Engine/src/Editor/EditorWindow/HierarchyPanel/SHHierarchyPanel.cpp b/SHADE_Engine/src/Editor/EditorWindow/HierarchyPanel/SHHierarchyPanel.cpp index 2235f831..6ac5933c 100644 --- a/SHADE_Engine/src/Editor/EditorWindow/HierarchyPanel/SHHierarchyPanel.cpp +++ b/SHADE_Engine/src/Editor/EditorWindow/HierarchyPanel/SHHierarchyPanel.cpp @@ -84,34 +84,32 @@ namespace SHADE editor->selectedEntities.clear(); } ImGui::SeparatorEx(ImGuiSeparatorFlags_Horizontal); - if (ImGui::IsWindowFocused()) + + if (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && ImGui::IsKeyReleased(ImGuiKey_A)) { - if (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && ImGui::IsKeyReleased(ImGuiKey_A)) + SelectAllEntities(); + } + if (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && ImGui::IsKeyReleased(ImGuiKey_C)) + { + CopySelectedEntities(); + } + if (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && !ImGui::IsKeyDown(ImGuiKey_LeftShift) && ImGui::IsKeyReleased(ImGuiKey_V)) + { + PasteEntities(); + } + if (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && ImGui::IsKeyDown(ImGuiKey_LeftShift) && ImGui::IsKeyReleased(ImGuiKey_V)) + { + const auto editor = SHSystemManager::GetSystem(); + if (editor->selectedEntities.size() == 1) { - SelectAllEntities(); - } - if (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && ImGui::IsKeyReleased(ImGuiKey_C)) - { - CopySelectedEntities(); - } - if (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && !ImGui::IsKeyDown(ImGuiKey_LeftShift) && ImGui::IsKeyReleased(ImGuiKey_V)) - { - PasteEntities(); - } - if (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && ImGui::IsKeyDown(ImGuiKey_LeftShift) && ImGui::IsKeyReleased(ImGuiKey_V)) - { - const auto editor = SHSystemManager::GetSystem(); - if (editor->selectedEntities.size() == 1) - { - PasteEntities(editor->selectedEntities.back()); - } - } - if(ImGui::IsKeyReleased(ImGuiKey_Delete)) - { - DeleteSelectedEntities(); + PasteEntities(editor->selectedEntities.back()); } } - + if (ImGui::IsKeyReleased(ImGuiKey_Delete)) + { + DeleteSelectedEntities(); + } + } if(ImGui::IsWindowHovered() && !ImGui::IsAnyItemHovered() && ImGui::IsMouseReleased(ImGuiMouseButton_Left)) { diff --git a/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorComponentView.hpp b/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorComponentView.hpp index 16961fe0..ed6b7bd4 100644 --- a/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorComponentView.hpp +++ b/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHEditorComponentView.hpp @@ -18,6 +18,9 @@ #include "Physics/Interface/SHColliderComponent.h" #include "Reflection/SHReflectionMetadata.h" #include "Resource/SHResourceManager.h" +#include "Serialization/SHSerializationHelper.hpp" +#include "Tools/Utilities/SHClipboardUtilities.h" +#include "SHInspectorCommands.h" #include "Physics/Collision/CollisionTags/SHCollisionTagMatrix.h" namespace SHADE { @@ -46,11 +49,12 @@ namespace SHADE if (ImGui::Selectable(std::format("{} Copy {}", ICON_MD_CONTENT_COPY, componentName.data()).data())) { - //SHClipboardUtil::WriteStringToClipboard(SHClipboardUtil::CFNAME::CFCOMPONENT, SHComponentToString(component)); + SHClipboardUtilities::WriteToClipboard(SHSerializationHelper::SerializeComponentToString(component->GetEID())); } if (ImGui::Selectable(std::format("{} Paste {}", ICON_MD_CONTENT_PASTE, componentName.data()).data())) { - //SHStringToComponent(component, SHClipboardUtil::ReadStringFromClipboard(SHClipboardUtil::CFNAME::CFCOMPONENT)); + //SHSerializationHelper::DeserializeComponentFromString(SHClipboardUtilities::GetDataFromClipboard(), component->GetEID()); + SHCommandManager::PerformCommand(std::reinterpret_pointer_cast( std::make_shared>(component->GetEID(), SHClipboardUtilities::GetDataFromClipboard()))); } if (ImGui::Selectable(std::format("{} Delete {}", ICON_MD_DELETE, componentName.data()).data())) { diff --git a/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHInspectorCommands.h b/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHInspectorCommands.h new file mode 100644 index 00000000..72e2a2e3 --- /dev/null +++ b/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHInspectorCommands.h @@ -0,0 +1,27 @@ +#pragma once +#include "Editor/Command/SHCommand.hpp" + +namespace SHADE +{ + template + class SHPasteComponentCommand final : SHBaseCommand + { + public: + struct Data + { + EntityID eid; + std::string oldComponentData; + std::string newComponentData; + }; + + SHPasteComponentCommand(EntityID eid, std::string const& newComponentData); + + void Execute() override; + void Undo() override; + + private: + Data data; + }; +} + +#include "SHInspectorCommands.hpp" \ No newline at end of file diff --git a/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHInspectorCommands.hpp b/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHInspectorCommands.hpp new file mode 100644 index 00000000..da006218 --- /dev/null +++ b/SHADE_Engine/src/Editor/EditorWindow/Inspector/SHInspectorCommands.hpp @@ -0,0 +1,26 @@ +#pragma once +#include "SHInspectorCommands.h" + +namespace SHADE +{ + template + SHPasteComponentCommand::SHPasteComponentCommand(EntityID eid, std::string const& newComponentData) + :data(eid, {}, newComponentData) + { + data.oldComponentData = SHSerializationHelper::SerializeComponentToString(eid); + } + + template + void SHPasteComponentCommand::Execute() + { + bool result = SHSerializationHelper::DeserializeComponentFromString(data.newComponentData, data.eid); + if(!result) + SHCommandManager::failedExecution = true; + } + + template + void SHPasteComponentCommand::Undo() + { + SHSerializationHelper::DeserializeComponentFromString(data.oldComponentData, data.eid); + } +} \ No newline at end of file diff --git a/SHADE_Engine/src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.cpp b/SHADE_Engine/src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.cpp index 2e40e92e..5f9bf4d7 100644 --- a/SHADE_Engine/src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.cpp +++ b/SHADE_Engine/src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.cpp @@ -82,155 +82,19 @@ namespace SHADE if (ImGui::BeginMainMenuBar()) { - if (ImGui::BeginMenu("File")) - { - if(ImGui::Selectable("New Scene")) - { - SHSystemManager::GetSystem()->NewScene(); - } - if(ImGui::Selectable("Save")) - { - SHSystemManager::GetSystem()->SaveScene(); - } - if(ImGui::Selectable("Load")) - { - //SHSystemManager::GetSystem()->LoadScene() - } - ImGui::EndMenu(); - } - if(ImGui::BeginMenu("Edit")) - { - ImGui::BeginDisabled(!SHCommandManager::GetUndoStackSize()); - if(ImGui::Button(std::format("{} Undo", ICON_MD_UNDO).data())) - { - SHCommandManager::UndoCommand(); - } - ImGui::EndDisabled(); - ImGui::BeginDisabled(!SHCommandManager::GetRedoStackSize()); - if(ImGui::Button(std::format("{} Redo", ICON_MD_REDO).data())) - { - SHCommandManager::RedoCommand(); - } - ImGui::EndDisabled(); - ImGui::EndMenu(); - } - if (ImGui::BeginMenu("Scripts")) - { - if (ImGui::Selectable("Generate Visual Studio Project")) - { - auto* scriptEngine = static_cast(SHSystemManager::GetSystem()); - scriptEngine->GenerateScriptsCsProjFile(); - } - if (ImGui::Selectable("Open Visual Studio Project")) - { - auto* scriptEngine = static_cast(SHSystemManager::GetSystem()); - scriptEngine->OpenSolution(); - } - ImGui::BeginDisabled(SHSystemManager::GetSystem()->editorState != SHEditor::State::STOP); - if (ImGui::Selectable("Build Scripts - Debug")) - { - auto* scriptEngine = static_cast(SHSystemManager::GetSystem()); - SHSerialization::SerializeSceneToFile(SHSceneManager::GetCurrentSceneAssetID()); - scriptEngine->BuildScriptAssembly(true, true); - SHSceneManager::RestartScene(SHSceneManager::GetCurrentSceneAssetID()); - } - if (ImGui::Selectable("Build Scripts - Release")) - { - auto* scriptEngine = static_cast(SHSystemManager::GetSystem()); - SHSerialization::SerializeSceneToFile(SHSceneManager::GetCurrentSceneAssetID()); - scriptEngine->BuildScriptAssembly(false, true); - SHSceneManager::RestartScene(SHSceneManager::GetCurrentSceneAssetID()); - } - ImGui::EndDisabled(); - ImGui::EndMenu(); - } + DrawFileMenu(); + DrawEditMenu(); + DrawScriptsMenu(); + DrawWindowMenu(); + DrawThemeMenu(); + DrawLayoutMenu(); + DrawApplicationConfig(); + DrawPhysicsSettings(); - if (ImGui::BeginMenu("Window")) - { - for (const auto& window : SHEditorWindowManager::editorWindows | std::views::values) - { - if (window.get() != this) - ImGui::Checkbox(window->windowName.data(), &window->isOpen); - } - ImGui::EndMenu(); - } - if (ImGui::BeginMenu("Theme")) - { - const auto styles = rttr::type::get().get_enumeration(); - auto values = styles.get_values(); - for (auto style : values) - { - if (ImGui::Selectable(style.to_string().c_str())) - { - if (auto editor = SHSystemManager::GetSystem()) - editor->SetStyle(style.convert()); - } - } - ImGui::EndMenu(); - } - if(ImGui::BeginMenu("Layout")) - { - for(auto const& entry : layoutPaths) - { - if(ImGui::Selectable(entry.stem().string().c_str())) - { - ImGui::LoadIniSettingsFromDisk(entry.string().c_str()); - } - } - ImGui::EndMenu(); - } - - if (ImGui::BeginMenu("Application Config")) - { - auto& appConfig = SHConfigurationManager::applicationConfig; - ImGui::InputText("Window Title", &appConfig.windowTitle); - ImGui::Checkbox("Start in Fullscreen", &appConfig.startInFullScreen); - SHEditorWidgets::DragN("Window Size", { "Width", "Height" }, { &appConfig.windowSize.x, &appConfig.windowSize.y }); - //ImGui::InputScalar("Starting Scene", ImGuiDataType_U32, &appConfig.startingSceneID); - auto sceneAsset = SHAssetManager::GetData(appConfig.startingSceneID); - - if(ImGui::BeginCombo("Starting Scne", sceneAsset ? sceneAsset->name.data() : "")) - { - auto scenes = SHAssetManager::GetAllRecordOfType(AssetType::SCENE); - for(auto const& scene : scenes) - { - if(ImGui::Selectable(scene.name.data())) - { - appConfig.startingSceneID = scene.id; - } - } - ImGui::EndCombo(); - } - if (ImGui::Button("Save")) - { - SHConfigurationManager::SaveApplicationConfig(); - } - ImGui::EndMenu(); - } - - if (ImGui::BeginMenu("Physics Settings")) - { - if (auto* physicsDebugDraw = SHSystemManager::GetSystem()) - { - bool drawColliders = physicsDebugDraw->GetFlagState(SHPhysicsDebugDrawSystem::DebugDrawFlags::COLLIDERS); - if (ImGui::Checkbox("Draw Colliders", &drawColliders)) - physicsDebugDraw->SetFlagState(SHPhysicsDebugDrawSystem::DebugDrawFlags::COLLIDERS, drawColliders); - - bool drawContactPoints = physicsDebugDraw->GetFlagState(SHPhysicsDebugDrawSystem::DebugDrawFlags::CONTACTS); - if (ImGui::Checkbox("Draw Contact Points", &drawContactPoints)) - physicsDebugDraw->SetFlagState(SHPhysicsDebugDrawSystem::DebugDrawFlags::CONTACTS, drawContactPoints); - - bool drawRays = physicsDebugDraw->GetFlagState(SHPhysicsDebugDrawSystem::DebugDrawFlags::RAYCASTS); - if (ImGui::Checkbox("Draw Rays", &drawRays)) - physicsDebugDraw->SetFlagState(SHPhysicsDebugDrawSystem::DebugDrawFlags::RAYCASTS, drawRays); - - bool drawBroadphase = physicsDebugDraw->GetFlagState(SHPhysicsDebugDrawSystem::DebugDrawFlags::BROADPHASE); - if (ImGui::Checkbox("Draw Broadphase", &drawBroadphase)) - physicsDebugDraw->SetFlagState(SHPhysicsDebugDrawSystem::DebugDrawFlags::BROADPHASE, drawBroadphase); - } - - ImGui::EndMenu(); - } + std::string const sceneName{std::format("Current Scene: {}",SHSceneManager::GetSceneName().data())}; + auto const size = ImGui::CalcTextSize(sceneName.data()); + ImGui::SetCursorPosX(ImGui::GetWindowWidth() - size.x - ImGui::GetStyle().FramePadding.x); + ImGui::Text("%s", sceneName.data()); ImGui::EndMainMenuBar(); } @@ -297,4 +161,176 @@ namespace SHADE ImGui::PopStyleVar(3); } + void SHEditorMenuBar::DrawFileMenu() noexcept + { + if (ImGui::BeginMenu("File")) + { + if (ImGui::Selectable("New Scene")) + { + SHSystemManager::GetSystem()->NewScene(); + } + if (ImGui::Selectable("Save")) + { + SHSystemManager::GetSystem()->SaveScene(); + } + if (ImGui::Selectable("Load")) + { + //SHSystemManager::GetSystem()->LoadScene() + } + ImGui::EndMenu(); + } + } + void SHEditorMenuBar::DrawEditMenu() noexcept + { + if (ImGui::BeginMenu("Edit")) + { + ImGui::BeginDisabled(!SHCommandManager::GetUndoStackSize()); + if (ImGui::Button(std::format("{} Undo", ICON_MD_UNDO).data())) + { + SHCommandManager::UndoCommand(); + } + ImGui::EndDisabled(); + ImGui::BeginDisabled(!SHCommandManager::GetRedoStackSize()); + if (ImGui::Button(std::format("{} Redo", ICON_MD_REDO).data())) + { + SHCommandManager::RedoCommand(); + } + ImGui::EndDisabled(); + ImGui::EndMenu(); + } + } + void SHEditorMenuBar::DrawScriptsMenu() noexcept + { + if (ImGui::BeginMenu("Scripts")) + { + if (ImGui::Selectable("Generate Visual Studio Project")) + { + auto* scriptEngine = static_cast(SHSystemManager::GetSystem()); + scriptEngine->GenerateScriptsCsProjFile(); + } + if (ImGui::Selectable("Open Visual Studio Project")) + { + auto* scriptEngine = static_cast(SHSystemManager::GetSystem()); + scriptEngine->OpenSolution(); + } + ImGui::BeginDisabled(SHSystemManager::GetSystem()->editorState != SHEditor::State::STOP); + if (ImGui::Selectable("Build Scripts - Debug")) + { + auto* scriptEngine = static_cast(SHSystemManager::GetSystem()); + SHSerialization::SerializeSceneToFile(SHSceneManager::GetCurrentSceneAssetID()); + scriptEngine->BuildScriptAssembly(true, true); + SHSceneManager::RestartScene(SHSceneManager::GetCurrentSceneAssetID()); + } + if (ImGui::Selectable("Build Scripts - Release")) + { + auto* scriptEngine = static_cast(SHSystemManager::GetSystem()); + SHSerialization::SerializeSceneToFile(SHSceneManager::GetCurrentSceneAssetID()); + scriptEngine->BuildScriptAssembly(false, true); + SHSceneManager::RestartScene(SHSceneManager::GetCurrentSceneAssetID()); + } + ImGui::EndDisabled(); + ImGui::EndMenu(); + } + } + void SHEditorMenuBar::DrawWindowMenu() noexcept + { + if (ImGui::BeginMenu("Window")) + { + for (const auto& window : SHEditorWindowManager::editorWindows | std::views::values) + { + if (window.get() != this) + ImGui::Checkbox(window->windowName.data(), &window->isOpen); + } + ImGui::EndMenu(); + } + } + void SHEditorMenuBar::DrawThemeMenu() noexcept + { + if (ImGui::BeginMenu("Theme")) + { + const auto styles = rttr::type::get().get_enumeration(); + auto values = styles.get_values(); + for (auto style : values) + { + if (ImGui::Selectable(style.to_string().c_str())) + { + if (auto editor = SHSystemManager::GetSystem()) + editor->SetStyle(style.convert()); + } + } + ImGui::EndMenu(); + } + } + void SHEditorMenuBar::DrawLayoutMenu() noexcept + { + if (ImGui::BeginMenu("Layout")) + { + for (auto const& entry : layoutPaths) + { + if (ImGui::Selectable(entry.stem().string().c_str())) + { + ImGui::LoadIniSettingsFromDisk(entry.string().c_str()); + } + } + ImGui::EndMenu(); + } + } + void SHEditorMenuBar::DrawApplicationConfig() noexcept + { + if (ImGui::BeginMenu("Application Config")) + { + auto& appConfig = SHConfigurationManager::applicationConfig; + ImGui::InputText("Window Title", &appConfig.windowTitle); + ImGui::Checkbox("Start in Fullscreen", &appConfig.startInFullScreen); + SHEditorWidgets::DragN("Window Size", { "Width", "Height" }, { &appConfig.windowSize.x, &appConfig.windowSize.y }); + //ImGui::InputScalar("Starting Scene", ImGuiDataType_U32, &appConfig.startingSceneID); + auto sceneAsset = SHAssetManager::GetData(appConfig.startingSceneID); + + if (ImGui::BeginCombo("Starting Scene", sceneAsset ? sceneAsset->name.data() : "")) + { + auto scenes = SHAssetManager::GetAllRecordOfType(AssetType::SCENE); + for (auto const& scene : scenes) + { + if (ImGui::Selectable(scene.name.data())) + { + appConfig.startingSceneID = scene.id; + } + } + ImGui::EndCombo(); + } + if (ImGui::Button("Save")) + { + SHConfigurationManager::SaveApplicationConfig(); + } + ImGui::EndMenu(); + } + } + + void SHEditorMenuBar::DrawPhysicsSettings() noexcept + { + if (ImGui::BeginMenu("Physics Settings")) + { + if (auto* physicsDebugDraw = SHSystemManager::GetSystem()) + { + bool drawColliders = physicsDebugDraw->GetFlagState(SHPhysicsDebugDrawSystem::DebugDrawFlags::COLLIDERS); + if (ImGui::Checkbox("Draw Colliders", &drawColliders)) + physicsDebugDraw->SetFlagState(SHPhysicsDebugDrawSystem::DebugDrawFlags::COLLIDERS, drawColliders); + + bool drawContactPoints = physicsDebugDraw->GetFlagState(SHPhysicsDebugDrawSystem::DebugDrawFlags::CONTACTS); + if (ImGui::Checkbox("Draw Contact Points", &drawContactPoints)) + physicsDebugDraw->SetFlagState(SHPhysicsDebugDrawSystem::DebugDrawFlags::CONTACTS, drawContactPoints); + + bool drawRays = physicsDebugDraw->GetFlagState(SHPhysicsDebugDrawSystem::DebugDrawFlags::RAYCASTS); + if (ImGui::Checkbox("Draw Rays", &drawRays)) + physicsDebugDraw->SetFlagState(SHPhysicsDebugDrawSystem::DebugDrawFlags::RAYCASTS, drawRays); + + bool drawBroadphase = physicsDebugDraw->GetFlagState(SHPhysicsDebugDrawSystem::DebugDrawFlags::BROADPHASE); + if (ImGui::Checkbox("Draw Broadphase", &drawBroadphase)) + physicsDebugDraw->SetFlagState(SHPhysicsDebugDrawSystem::DebugDrawFlags::BROADPHASE, drawBroadphase); + } + + ImGui::EndMenu(); + } + } + }//namespace SHADE diff --git a/SHADE_Engine/src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.h b/SHADE_Engine/src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.h index e4f1d20b..4891dc5b 100644 --- a/SHADE_Engine/src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.h +++ b/SHADE_Engine/src/Editor/EditorWindow/MenuBar/SHEditorMenuBar.h @@ -17,6 +17,16 @@ namespace SHADE void DrawMainMenuBar() noexcept; void DrawSecondaryBar() const noexcept; void DrawStatusBar() const noexcept; + + void DrawFileMenu() noexcept; + void DrawEditMenu() noexcept; + void DrawScriptsMenu() noexcept; + void DrawWindowMenu() noexcept; + void DrawThemeMenu() noexcept; + void DrawLayoutMenu() noexcept; + void DrawApplicationConfig() noexcept; + void DrawPhysicsSettings() noexcept; + float menuBarHeight = 20.0f; std::vector layoutPaths; };//class SHEditorMenuBar diff --git a/SHADE_Engine/src/Editor/SHEditor.cpp b/SHADE_Engine/src/Editor/SHEditor.cpp index 93b42418..2b8ddbb5 100644 --- a/SHADE_Engine/src/Editor/SHEditor.cpp +++ b/SHADE_Engine/src/Editor/SHEditor.cpp @@ -93,6 +93,8 @@ namespace SHADE SHLOG_CRITICAL("Failed to create ImGui Context") } } + + editorConfig = &SHConfigurationManager::LoadEditorConfig(); //Add editor windows SHEditorWindowManager::CreateEditorWindow(); @@ -122,7 +124,7 @@ namespace SHADE InitBackend(); - SetStyle(Style::SHADE); + SetStyle(static_cast