From 57868a2006c1fc1e9c4389e6d44a340a19b16619 Mon Sep 17 00:00:00 2001 From: allenyangcc Date: Sun, 31 Jul 2022 11:27:08 -0700 Subject: [PATCH 01/33] Update CMake Lists --- .../Core/Editor/Utils/ERS_Editor_LayoutManager/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/CMakeLists.txt b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/CMakeLists.txt index 575012f86f..08531a1fc8 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/CMakeLists.txt +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/CMakeLists.txt @@ -24,6 +24,9 @@ target_link_libraries(ERS_Editor_LayoutManager # Link Internal Libs target_link_libraries(ERS_Editor_LayoutManager + ERS_STRUCT_SystemUtils + + ERS_Editor_WindowManager ERS_CLASS_LoggingSystem ) From 39d42651e0494f987220f62e63bf74929e730977 Mon Sep 17 00:00:00 2001 From: allenyangcc Date: Sun, 31 Jul 2022 11:27:58 -0700 Subject: [PATCH 02/33] Update Layout Manager header file --- .../ERS_Editor_LayoutManager.h | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h index 87075b8313..d593780d87 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h @@ -13,28 +13,35 @@ // Internal Libraries (BG convention: use <> instead of "") #include +#include +#include struct ERS_STRUCT_EditorLayout { int index; std::string name; std::string IniString; + + std::vector WindowNames; + std::vector WindowStatus; }; /** * @brief Creates the user profile manager class. - * + * */ class ERS_CLASS_LayoutManager { private: + ERS_STRUCT_SystemUtils* SystemUtils_; /** LayoutFiles_; /** LayoutNames_; /** Date: Sun, 31 Jul 2022 11:28:27 -0700 Subject: [PATCH 03/33] Update Layout Manager cpp file --- .../ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp index ab502e3b80..093c2db042 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp @@ -13,7 +13,7 @@ ERS_CLASS_LayoutManager::ERS_CLASS_LayoutManager(ERS_CLASS_LoggingSystem* Logger LayoutDirectory_ = LayoutDirectory; Logger_->Log("Initializing Layout Manager", 5); - } +} ERS_CLASS_LayoutManager::~ERS_CLASS_LayoutManager() { @@ -32,7 +32,7 @@ void ERS_CLASS_LayoutManager::LoadLayouts() { // Load YAML::Node YAML::Node LayoutNode = YAML::LoadFile(FilePath.c_str()); - + // Build Temp Layout ERS_STRUCT_EditorLayout Layout; Layout.index = Index; From 840ed75345999ac60c57773ead8d91db3705faed Mon Sep 17 00:00:00 2001 From: datacrystals Date: Sun, 31 Jul 2022 18:33:05 +0000 Subject: [PATCH 04/33] Add Layout Manager To GUI Cmake --- Source/Core/Editor/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Core/Editor/CMakeLists.txt b/Source/Core/Editor/CMakeLists.txt index 3f7cfe554c..5ae73e94af 100644 --- a/Source/Core/Editor/CMakeLists.txt +++ b/Source/Core/Editor/CMakeLists.txt @@ -38,6 +38,7 @@ target_link_libraries(VisualEditor ERS_Editor_UserProfileManager ERS_Editor_3DCursor ERS_Editor_WindowManager + ERS_Editor_LayoutManager ERS_SceneManager From ce0fff0e76192f7af6c984bd10decc3678831188 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Sun, 31 Jul 2022 18:34:48 +0000 Subject: [PATCH 05/33] Add Layout Manager to GUI.h Co-authored-by: allenyangcc --- Source/Core/Editor/GUI.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Core/Editor/GUI.h b/Source/Core/Editor/GUI.h index 77aeab1223..eccc4bfdb3 100644 --- a/Source/Core/Editor/GUI.h +++ b/Source/Core/Editor/GUI.h @@ -22,6 +22,7 @@ // Internal Libraries (BG convention: use <> instead of "") #include #include +#include #include #include @@ -64,6 +65,7 @@ class GUISystem { std::unique_ptr FontManager_; /** UserProfileManager_; /** LayoutManager_; /** WindowManager_; /** Date: Sun, 31 Jul 2022 18:36:52 +0000 Subject: [PATCH 06/33] Add Layout Manager to GUI.h Co-authored-by: allenyangcc --- Source/Core/Editor/GUI.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Core/Editor/GUI.cpp b/Source/Core/Editor/GUI.cpp index 35073335aa..8920ca29cd 100644 --- a/Source/Core/Editor/GUI.cpp +++ b/Source/Core/Editor/GUI.cpp @@ -28,6 +28,7 @@ GUISystem::GUISystem(ERS_STRUCT_SystemUtils* SystemUtils, GLFWwindow* Window, Cu ThemeManager_ = std::make_unique(SystemUtils_->Logger_.get()); FontManager_ = std::make_unique(SystemUtils_->Logger_.get()); UserProfileManager_ = std::make_unique(SystemUtils_->Logger_.get()); + LayoutManager_ = std::make_unique(SystemUtils_, SystemUtils->LocalSystemConfiguration["LayoutDirectory"]) // Load User Profile ThemeManager_->ApplyThemes(UserProfileManager_->GetUserColorProfile().c_str()); From f83246d9f03176461fbafe7a4242e305e0d18154 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Sun, 31 Jul 2022 18:37:26 +0000 Subject: [PATCH 07/33] Add Layout Manager to GUI.h Co-authored-by: allenyangcc --- .../ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp | 4 +--- .../Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp index 093c2db042..c7fe3beb3b 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp @@ -3,9 +3,7 @@ //======================================================================// #include -#include -#include -#include + ERS_CLASS_LayoutManager::ERS_CLASS_LayoutManager(ERS_CLASS_LoggingSystem* Logger, const char* LayoutDirectory) { diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h index d593780d87..d9aa1e2b42 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h @@ -7,6 +7,9 @@ // Standard Libraries (BG convention: use <> instead of "") #include +#include +#include +#include // Third-Party Libraries (BG convention: use <> instead of "") #include @@ -16,6 +19,7 @@ #include #include + struct ERS_STRUCT_EditorLayout { int index; std::string name; From c966247e6fdfae00e6a5dbb15ab1114b8c25b809 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Sun, 31 Jul 2022 18:38:13 +0000 Subject: [PATCH 08/33] Add Layout Manager to GUI.h Co-authored-by: allenyangcc --- .../ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp | 5 +++-- .../ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp index c7fe3beb3b..3a57e7908f 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp @@ -5,9 +5,10 @@ #include -ERS_CLASS_LayoutManager::ERS_CLASS_LayoutManager(ERS_CLASS_LoggingSystem* Logger, const char* LayoutDirectory) { +ERS_CLASS_LayoutManager::ERS_CLASS_LayoutManager( ERS_STRUCT_SystemUtils* SystemUtils, const char* LayoutDirectory) { - Logger_ = Logger; + SystemUtils_ = SystemUtils; + Logger_ = SystemUtils_->Logger.get(); LayoutDirectory_ = LayoutDirectory; Logger_->Log("Initializing Layout Manager", 5); diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h index d9aa1e2b42..510167e748 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h @@ -56,7 +56,7 @@ class ERS_CLASS_LayoutManager { * * @param Logger */ - ERS_CLASS_LayoutManager(ERS_CLASS_LoggingSystem* Logger, const char* LayoutDirectory = "EditorAssets/Layouts/"); + ERS_CLASS_LayoutManager(ERS_STRUCT_SystemUtils* SystemUtils, const char* LayoutDirectory = "EditorAssets/Layouts/"); /** * @brief Destroy the Layout Manager object From 6692832c1464b639945b3740ed5ac9a763f036f2 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Sun, 31 Jul 2022 18:38:44 +0000 Subject: [PATCH 09/33] Add Layout Manager to GUI.h Co-authored-by: allenyangcc --- Source/Core/Editor/GUI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/GUI.cpp b/Source/Core/Editor/GUI.cpp index 8920ca29cd..9f0b50ea8d 100644 --- a/Source/Core/Editor/GUI.cpp +++ b/Source/Core/Editor/GUI.cpp @@ -28,7 +28,7 @@ GUISystem::GUISystem(ERS_STRUCT_SystemUtils* SystemUtils, GLFWwindow* Window, Cu ThemeManager_ = std::make_unique(SystemUtils_->Logger_.get()); FontManager_ = std::make_unique(SystemUtils_->Logger_.get()); UserProfileManager_ = std::make_unique(SystemUtils_->Logger_.get()); - LayoutManager_ = std::make_unique(SystemUtils_, SystemUtils->LocalSystemConfiguration["LayoutDirectory"]) + LayoutManager_ = std::make_unique(SystemUtils); // Load User Profile ThemeManager_->ApplyThemes(UserProfileManager_->GetUserColorProfile().c_str()); From a18ee20d02b364e9230c1b9eceef5905be149b47 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Sun, 31 Jul 2022 18:39:26 +0000 Subject: [PATCH 10/33] Add Layout Manager to GUI.h Co-authored-by: allenyangcc --- Source/Core/Editor/GUI.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/GUI.h b/Source/Core/Editor/GUI.h index eccc4bfdb3..14fe9dac5b 100644 --- a/Source/Core/Editor/GUI.h +++ b/Source/Core/Editor/GUI.h @@ -22,7 +22,6 @@ // Internal Libraries (BG convention: use <> instead of "") #include #include -#include #include #include @@ -33,6 +32,7 @@ #include #include #include +#include #include From 07b9962f3f79b57b979c579db8145cec5b76cccb Mon Sep 17 00:00:00 2001 From: datacrystals Date: Sun, 31 Jul 2022 18:39:50 +0000 Subject: [PATCH 11/33] Add Layout Manager to GUI.h Co-authored-by: allenyangcc --- .../Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp index 3a57e7908f..a020efcf53 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp @@ -8,7 +8,7 @@ ERS_CLASS_LayoutManager::ERS_CLASS_LayoutManager( ERS_STRUCT_SystemUtils* SystemUtils, const char* LayoutDirectory) { SystemUtils_ = SystemUtils; - Logger_ = SystemUtils_->Logger.get(); + Logger_ = SystemUtils_->Logger_.get(); LayoutDirectory_ = LayoutDirectory; Logger_->Log("Initializing Layout Manager", 5); From 16e1cb3f3f864196660100fb120c6d3c23da4c52 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Sun, 31 Jul 2022 18:44:50 +0000 Subject: [PATCH 12/33] Add Layout Manager to GUI.h Co-authored-by: allenyangcc --- .../ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp | 5 ++++- .../ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp index a020efcf53..9e14473be3 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp @@ -5,13 +5,16 @@ #include -ERS_CLASS_LayoutManager::ERS_CLASS_LayoutManager( ERS_STRUCT_SystemUtils* SystemUtils, const char* LayoutDirectory) { +ERS_CLASS_LayoutManager::ERS_CLASS_LayoutManager(ERS_STRUCT_SystemUtils* SystemUtils, ERS_CLASS_WindowManager* WindowManager, const char* LayoutDirectory) { SystemUtils_ = SystemUtils; Logger_ = SystemUtils_->Logger_.get(); LayoutDirectory_ = LayoutDirectory; + WindowManager_ = WindowManager; Logger_->Log("Initializing Layout Manager", 5); + + } diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h index 510167e748..764c3612bf 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h @@ -40,7 +40,7 @@ class ERS_CLASS_LayoutManager { ERS_STRUCT_SystemUtils* SystemUtils_; /** LayoutFiles_; /** Date: Sun, 31 Jul 2022 18:45:33 +0000 Subject: [PATCH 13/33] Add Layout Manager to GUI.h Co-authored-by: allenyangcc --- Source/Core/Editor/GUI.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Core/Editor/GUI.cpp b/Source/Core/Editor/GUI.cpp index 9f0b50ea8d..843234c6cc 100644 --- a/Source/Core/Editor/GUI.cpp +++ b/Source/Core/Editor/GUI.cpp @@ -28,7 +28,6 @@ GUISystem::GUISystem(ERS_STRUCT_SystemUtils* SystemUtils, GLFWwindow* Window, Cu ThemeManager_ = std::make_unique(SystemUtils_->Logger_.get()); FontManager_ = std::make_unique(SystemUtils_->Logger_.get()); UserProfileManager_ = std::make_unique(SystemUtils_->Logger_.get()); - LayoutManager_ = std::make_unique(SystemUtils); // Load User Profile ThemeManager_->ApplyThemes(UserProfileManager_->GetUserColorProfile().c_str()); @@ -43,6 +42,9 @@ GUISystem::GUISystem(ERS_STRUCT_SystemUtils* SystemUtils, GLFWwindow* Window, Cu WindowManager_ = std::make_unique(SystemUtils_); WindowManager_->GenerateWindowStruct(ProjectUtils_, HIDUtils_, VisualRenderer_, ThemeManager_.get(), Cursors3D_, SceneManager_); + + LayoutManager_ = std::make_unique(SystemUtils, WindowManager_); + // Initialize Windows SystemUtils_->Logger_->Log("Initializing Editor Menu", 5); From 6417a31e88a9d105a2cd58b9c43111a82540ceec Mon Sep 17 00:00:00 2001 From: datacrystals Date: Sun, 31 Jul 2022 18:46:04 +0000 Subject: [PATCH 14/33] Add Layout Manager to GUI.h Co-authored-by: allenyangcc --- .../Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h index 764c3612bf..60050593cd 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h @@ -40,7 +40,7 @@ class ERS_CLASS_LayoutManager { ERS_STRUCT_SystemUtils* SystemUtils_; /** LayoutFiles_; /** Date: Sun, 31 Jul 2022 18:47:03 +0000 Subject: [PATCH 15/33] Add Layout Manager to GUI.h Co-authored-by: allenyangcc --- Source/Core/Editor/GUI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/GUI.cpp b/Source/Core/Editor/GUI.cpp index 843234c6cc..5b549d0c29 100644 --- a/Source/Core/Editor/GUI.cpp +++ b/Source/Core/Editor/GUI.cpp @@ -43,7 +43,7 @@ GUISystem::GUISystem(ERS_STRUCT_SystemUtils* SystemUtils, GLFWwindow* Window, Cu WindowManager_->GenerateWindowStruct(ProjectUtils_, HIDUtils_, VisualRenderer_, ThemeManager_.get(), Cursors3D_, SceneManager_); - LayoutManager_ = std::make_unique(SystemUtils, WindowManager_); + LayoutManager_ = std::make_unique(SystemUtils, WindowManager_.get()); // Initialize Windows From e81cbddbb9efd1dbe9fca3fbd46a5f2d8ce8be1b Mon Sep 17 00:00:00 2001 From: datacrystals Date: Sun, 31 Jul 2022 18:56:37 +0000 Subject: [PATCH 16/33] Add Layout Manager to GUI.h Co-authored-by: allenyangcc --- .../GUI_Menu_Settings/GUI_Menu_Settings.cpp | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp b/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp index 12dddd9b88..28e13edcdb 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp +++ b/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp @@ -28,6 +28,38 @@ void GUI_Menu_Settings::Draw() { // File Menu if (ImGui::BeginMenu("Settings")) { + // Layout Menu + if (ImGui::BeginMenu("Editor Layout")) { + + + // Create Submenu with layouts which the user can select from + if (ImGui::BeginMenu("Select Layouts")) { + + + + ImGui::EndMenu(); + } + + // Normal buttons that the user can select + if (ImGui::MenuItem("Save Active Layout")) { + + } + + if (ImGui::MenuItem("Create New Layout")) { + + } + + if (ImGui::MenuItem("Rename Active Layout")) { + + } + + if (ImGui::MenuItem("Re-Detect Layouts")) { + + } + + ImGui::EndMenu(); + } + // Controller Settings if (ImGui::BeginMenu("Game Controllers")) { From 8dd048756f5b93b8042072cf2b2bf8ef59b4f6e2 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Sun, 31 Jul 2022 18:58:45 +0000 Subject: [PATCH 17/33] Add Layout Manager to GUI.h Co-authored-by: allenyangcc --- Source/Core/Editor/Menus/GUI_Menu_Settings/CMakeLists.txt | 1 + .../Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp | 3 ++- .../Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.h | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Core/Editor/Menus/GUI_Menu_Settings/CMakeLists.txt b/Source/Core/Editor/Menus/GUI_Menu_Settings/CMakeLists.txt index e2d86af064..300f5aa358 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_Settings/CMakeLists.txt +++ b/Source/Core/Editor/Menus/GUI_Menu_Settings/CMakeLists.txt @@ -27,6 +27,7 @@ target_link_libraries(Menu_Settings ERS_STRUCT_ProjectUtils ERS_Editor_WindowManager + ERS_Editor_LayoutManager GUI_Window_ControllerSettings diff --git a/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp b/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp index 28e13edcdb..418b178ba7 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp +++ b/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp @@ -5,11 +5,12 @@ #include -GUI_Menu_Settings::GUI_Menu_Settings(ERS_STRUCT_SystemUtils* SystemUtils, ERS_STRUCT_HumanInputDeviceUtils* HIDUtils, ERS_STRUCT_Windows* Windows) { +GUI_Menu_Settings::GUI_Menu_Settings(ERS_STRUCT_SystemUtils* SystemUtils, ERS_STRUCT_HumanInputDeviceUtils* HIDUtils, ERS_STRUCT_Windows* Windows, ERS_Editor_LayoutManager* LayoutManager) { SystemUtils_ = SystemUtils; HIDUtils_ = HIDUtils; Windows_ = Windows; + LayoutManager_ = LayoutManager; SystemUtils_->Logger_->Log("Editor Setting Up Settings Menu", 4); diff --git a/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.h b/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.h index 3b68b83b04..156757841b 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.h +++ b/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.h @@ -21,6 +21,7 @@ #include #include +#include #include @@ -36,6 +37,7 @@ class GUI_Menu_Settings { ERS_STRUCT_SystemUtils* SystemUtils_; /** Date: Sun, 31 Jul 2022 19:04:16 +0000 Subject: [PATCH 18/33] Add Layout Manager to GUI.h Co-authored-by: allenyangcc --- .../GUI_Menu_Settings/GUI_Menu_Settings.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp b/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp index 418b178ba7..9129c3a6ca 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp +++ b/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp @@ -36,27 +36,31 @@ void GUI_Menu_Settings::Draw() { // Create Submenu with layouts which the user can select from if (ImGui::BeginMenu("Select Layouts")) { - + std::string ActiveLayoutName = LayoutManager_->GetActiveLayoutName(); + std::vector LayoutNames = LayoutManager_->GetLayoutNames(); + for (unsigned int i = 0; i < LayoutNames.size(); i++) { + if (ImGui::Selectable(LayoutNames[i].c_str(), (LayoutNames[i] == ActiveLayoutName))) { + LayoutManager_->ApplyLayout(LayoutNames[i]); + } + } ImGui::EndMenu(); } // Normal buttons that the user can select if (ImGui::MenuItem("Save Active Layout")) { - + std::string ActiveLayoutName = LayoutManager_->GetActiveLayoutName(); + LayoutManager_->SaveLayout(ActiveLayoutName); } if (ImGui::MenuItem("Create New Layout")) { - + LayoutManager_->CreateLayout(std::string("Untitled Layout")); } if (ImGui::MenuItem("Rename Active Layout")) { - + // Todo later - not part of layout manager } - if (ImGui::MenuItem("Re-Detect Layouts")) { - - } ImGui::EndMenu(); } From 2e8e8d556dfd673bb9e29b53bc4ae190ccdf755a Mon Sep 17 00:00:00 2001 From: datacrystals Date: Sun, 31 Jul 2022 19:07:40 +0000 Subject: [PATCH 19/33] Update Layout Manager Co-authored-by: allenyangcc --- .../ERS_Editor_LayoutManager.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h index 60050593cd..b8e51fc033 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h @@ -90,4 +90,19 @@ class ERS_CLASS_LayoutManager { * @param LayoutName */ void ApplyLayout(std::string LayoutName); + + /** + * @brief Returns the name of the active layout. + * + * @return std::string + */ + std::string GetActiveLayoutName(); + + /** + * @brief Returns a list of names for all layouts. + * + * @return std::vector + */ + std::vector GetLayoutNames(); + }; \ No newline at end of file From 21f30167e3c638e4e6b02f9049e9afc46aae1b14 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Sun, 31 Jul 2022 19:09:06 +0000 Subject: [PATCH 20/33] Update Layout Manager Co-authored-by: allenyangcc --- .../ERS_Editor_LayoutManager.cpp | 11 +++++++++++ .../ERS_Editor_LayoutManager.h | 1 + 2 files changed, 12 insertions(+) diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp index 9e14473be3..593ac175a3 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp @@ -139,3 +139,14 @@ void ERS_CLASS_LayoutManager::ApplyLayout(int LayoutID) { ImGui::LoadIniSettingsFromMemory(Layout.IniString.c_str()); } + + +std::string ERS_CLASS_LayoutManager::GetActiveLayoutName() { + +} + + +std::vector ERS_CLASS_LayoutManager::GetLayoutNames() { + return LayoutNames_; +} + diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h index b8e51fc033..152833a60f 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h @@ -42,6 +42,7 @@ class ERS_CLASS_LayoutManager { ERS_CLASS_LoggingSystem* Logger_; /** LayoutFiles_; /** Date: Sun, 31 Jul 2022 19:10:02 +0000 Subject: [PATCH 21/33] Update Layout Manager Co-authored-by: allenyangcc --- .../Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h index 152833a60f..2d0a29836c 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h @@ -42,7 +42,7 @@ class ERS_CLASS_LayoutManager { ERS_CLASS_LoggingSystem* Logger_; /** LayoutFiles_; /** Date: Sun, 31 Jul 2022 19:14:08 +0000 Subject: [PATCH 22/33] Update Layout Manager Co-authored-by: allenyangcc --- .../Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.h | 2 +- .../ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.h b/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.h index 156757841b..02f80583b3 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.h +++ b/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.h @@ -37,7 +37,7 @@ class GUI_Menu_Settings { ERS_STRUCT_SystemUtils* SystemUtils_; /** Date: Sun, 31 Jul 2022 19:14:42 +0000 Subject: [PATCH 23/33] Update Layout Manager Co-authored-by: allenyangcc --- .../Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp | 2 +- Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp b/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp index 9129c3a6ca..04514dc8df 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp +++ b/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp @@ -5,7 +5,7 @@ #include -GUI_Menu_Settings::GUI_Menu_Settings(ERS_STRUCT_SystemUtils* SystemUtils, ERS_STRUCT_HumanInputDeviceUtils* HIDUtils, ERS_STRUCT_Windows* Windows, ERS_Editor_LayoutManager* LayoutManager) { +GUI_Menu_Settings::GUI_Menu_Settings(ERS_STRUCT_SystemUtils* SystemUtils, ERS_STRUCT_HumanInputDeviceUtils* HIDUtils, ERS_STRUCT_Windows* Windows, ERS_CLASS_LayoutManager* LayoutManager) { SystemUtils_ = SystemUtils; HIDUtils_ = HIDUtils; diff --git a/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.h b/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.h index 02f80583b3..dffb6a755a 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.h +++ b/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.h @@ -49,7 +49,7 @@ class GUI_Menu_Settings { * * @param SystemUtils */ - GUI_Menu_Settings(ERS_STRUCT_SystemUtils* SystemUtils, ERS_STRUCT_HumanInputDeviceUtils* HIDUtils, ERS_STRUCT_Windows* Windows, ERS_Editor_LayoutManager* LayoutManager); + GUI_Menu_Settings(ERS_STRUCT_SystemUtils* SystemUtils, ERS_STRUCT_HumanInputDeviceUtils* HIDUtils, ERS_STRUCT_Windows* Windows, ERS_CLASS_LayoutManager* LayoutManager); /** From cd39c4bbc5d4d325078825cd599e5381aa9bc224 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Sun, 31 Jul 2022 19:16:56 +0000 Subject: [PATCH 24/33] Update Layout Manager Co-authored-by: allenyangcc --- .../ERS_Editor_LayoutManager.cpp | 12 ++++++++++++ .../ERS_Editor_LayoutManager.h | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp index 579bad885f..1d783121c9 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp @@ -153,3 +153,15 @@ std::vector ERS_CLASS_LayoutManager::GetLayoutNames() { return LayoutNames_; } +void ERS_CLASS_LayoutManager::CreateLayout(std::string Name) { + + // Add Name To Layouts List + LayoutNames_.push_back(Name); + + // Save Layout + SaveLayout(Name); + + + // This might not work - fixme! + +} \ No newline at end of file diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h index 2d0a29836c..128a1cc1ea 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h @@ -106,4 +106,11 @@ class ERS_CLASS_LayoutManager { */ std::vector GetLayoutNames(); + /** + * @brief Creates a new layout and adds it to the editor's layout choices. + * + * @param Name + */ + void CreateLayout(std::string Name); + }; \ No newline at end of file From 0b5e319d2f39328ca4f341294c870c787b6f7c88 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Sun, 31 Jul 2022 19:19:27 +0000 Subject: [PATCH 25/33] Update Layout Manager Co-authored-by: allenyangcc --- Source/Core/Editor/GUI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/GUI.cpp b/Source/Core/Editor/GUI.cpp index 5b549d0c29..34b5c424d4 100644 --- a/Source/Core/Editor/GUI.cpp +++ b/Source/Core/Editor/GUI.cpp @@ -52,7 +52,7 @@ GUISystem::GUISystem(ERS_STRUCT_SystemUtils* SystemUtils, GLFWwindow* Window, Cu Menu_View_ = std::make_unique(SystemUtils_, FontManager_.get(), WindowManager_->GetWindowsStruct()); Menu_Window_ = std::make_unique(SystemUtils_, WindowManager_->GetWindowsStruct(), VisualRenderer_); Menu_Debug_ = std::make_unique(SystemUtils_, WindowManager_->GetWindowsStruct(), WindowManager_.get()); - Menu_Settings_ = std::make_unique(SystemUtils_, HIDUtils_, WindowManager_->GetWindowsStruct()); + Menu_Settings_ = std::make_unique(SystemUtils_, HIDUtils_, WindowManager_->GetWindowsStruct(), LayoutManager_.get()); // Disable Dragging Except By Title Bar ImGuiIO& IO = ImGui::GetIO(); From b50d1975a29bb66ffbbf9a247002ca18617d4547 Mon Sep 17 00:00:00 2001 From: Thomas Liao Date: Sat, 6 Aug 2022 18:14:11 -0700 Subject: [PATCH 26/33] Update CMAKE Configuration --- CMakeSettings.json | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/CMakeSettings.json b/CMakeSettings.json index 5ee206866c..177229306f 100644 --- a/CMakeSettings.json +++ b/CMakeSettings.json @@ -1,16 +1,5 @@ { "configurations": [ - { - "name": "x64-Debug", - "generator": "Visual Studio 16 2019 Win64", - "configurationType": "Debug", - "inheritEnvironments": [ "msvc_x64_x64" ], - "buildRoot": "${projectDir}\\out\\build\\${name}", - "installRoot": "${projectDir}/Binaries/", - "cmakeCommandArgs": "", - "buildCommandArgs": "", - "ctestCommandArgs": "" - }, { "name": "x64-Release", "generator": "Visual Studio 16 2019 Win64", From 174dd56fde0a9f0fb679dfb7f9bf758626da1170 Mon Sep 17 00:00:00 2001 From: allenyangcc Date: Thu, 1 Sep 2022 20:09:11 -0700 Subject: [PATCH 27/33] Updated function to support WindowNames and WindowStatus --- .../ERS_Editor_LayoutManager.cpp | 32 ++++++++++++++++--- .../ERS_Editor_LayoutManager.h | 4 +-- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp index 1d783121c9..3827c3e9b2 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp @@ -49,6 +49,18 @@ void ERS_CLASS_LayoutManager::LoadLayouts() { IniStr = LayoutNode["ImGuiIni"].as(); Layout.IniString = IniStr; + // Load the Window names and status + std::vector WindowNames = WindowManager_->GetWindowNames(); + + for (auto i : WindowNames) { + if (LayoutNode[i].as() == "False") { + Layout.WindowNameStatus.insert(std::make_pair(i, false)); + } + else { + Layout.WindowNameStatus.insert(std::make_pair(i, true)); + } + } + // Add To Names and Layouts Vector LayoutNames_.push_back(LayoutName); Layouts_.push_back(Layout); @@ -86,6 +98,19 @@ void ERS_CLASS_LayoutManager::SaveLayout(std::string LayoutName) { Layout["ImGuiIni"] = IniStr; Layout["DisplayName"] = LayoutName; + // Load the Window names and status + std::vector WindowNames = WindowManager_->GetWindowNames(); + + for (auto i : WindowNames) { + bool status; + if (WindowManager_->GetWindowStatus(i, &status)) { + Layout[i] = "True"; + } + else { + Layout[i] = "False"; + } + } + // Export the YAML string YAML::Emitter LayoutYAML; LayoutYAML << YAML::BeginMap; @@ -141,6 +166,9 @@ void ERS_CLASS_LayoutManager::ApplyLayout(int LayoutID) { ImGui::LoadIniSettingsFromMemory(Layout.IniString.c_str()); + for (auto i : Layout.WindowNameStatus) { + WindowManager_->SetWindowStatus(i.first, i.second); + } } @@ -160,8 +188,4 @@ void ERS_CLASS_LayoutManager::CreateLayout(std::string Name) { // Save Layout SaveLayout(Name); - - - // This might not work - fixme! - } \ No newline at end of file diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h index 128a1cc1ea..3404bbc1d1 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h @@ -10,6 +10,7 @@ #include #include #include +#include // Third-Party Libraries (BG convention: use <> instead of "") #include @@ -25,8 +26,7 @@ struct ERS_STRUCT_EditorLayout { std::string name; std::string IniString; - std::vector WindowNames; - std::vector WindowStatus; + std::map WindowNameStatus; }; /** From 0a2139fc0a954aac0af655d39af7c3400a05d2d3 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 2 Sep 2022 19:51:55 +0000 Subject: [PATCH 28/33] Fix Comment Warnings --- .../Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h index 3404bbc1d1..0a46927223 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.h @@ -50,7 +50,7 @@ class ERS_CLASS_LayoutManager { public: std::vector LayoutNames_; /** Layouts_; /** Layouts_; /** Date: Fri, 2 Sep 2022 19:52:11 +0000 Subject: [PATCH 29/33] Remove Unused Variable --- Source/Core/Editor/GUI.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/Source/Core/Editor/GUI.cpp b/Source/Core/Editor/GUI.cpp index 34b5c424d4..b338c683ba 100644 --- a/Source/Core/Editor/GUI.cpp +++ b/Source/Core/Editor/GUI.cpp @@ -113,8 +113,6 @@ void GUISystem::UpdateGUI() { } - size_t settings_size = 0; - const char* settings = ImGui::SaveIniSettingsToMemory(&settings_size); // Updates all the windows, draws their content if enabled WindowManager_->UpdateAllWindows(); From 19186d82186ad6d7c3b106da77e0fa82e859cd4d Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 2 Sep 2022 20:23:34 +0000 Subject: [PATCH 30/33] Fix Menu Code --- .../Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp b/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp index 0a893146f8..f6ba981f39 100644 --- a/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp +++ b/Source/Core/Editor/Menus/GUI_Menu_Settings/GUI_Menu_Settings.cpp @@ -30,7 +30,17 @@ void GUI_Menu_Settings::Draw() { if (ImGui::BeginMenu("Settings")) { + + + + // Interface Config + ImGui::MenuItem("Color Theme", "", &Windows_->GUI_Window_ThemeSelector_->Enabled_); + ImGui::MenuItem("System Font", "", &Windows_->GUI_Window_FontSelector_->Enabled_); + + + // Layout Menu + ImGui::Separator(); if (ImGui::BeginMenu("Editor Layout")) { @@ -67,10 +77,6 @@ void GUI_Menu_Settings::Draw() { } - // Interface Config - ImGui::MenuItem("Color Theme", "", &Windows_->GUI_Window_ThemeSelector_->Enabled_); - ImGui::MenuItem("System Font", "", &Windows_->GUI_Window_FontSelector_->Enabled_); - ImGui::Separator(); if (ImGui::BeginMenu("Editor Settings")) { ImGui::MenuItem("Editor Camera Settings", "", &Windows_->GUI_Window_EditorCameraSettings_->Enabled_); From 208020a075662ecbf11c1da2c2b9263689213cb7 Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 2 Sep 2022 20:49:34 +0000 Subject: [PATCH 31/33] Add Error Handling --- .../ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp index 3827c3e9b2..d9cb3853ec 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp @@ -126,8 +126,11 @@ void ERS_CLASS_LayoutManager::SaveLayout(std::string LayoutName) { // Write the string into a YAML file in the directory std::ofstream file(std::string(LayoutDirectory_) + "/" + LayoutName + ".yaml"); - if (!file.fail()) + if (!file.fail()) { file << YAMLstring; + } else { + Logger_->Log("Failed To Open File, Is Layout Directory Valid?", 8); + } file.close(); From 3dfc93df4cce044122dacce5ebbe8a58eb16fd5e Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 2 Sep 2022 20:54:11 +0000 Subject: [PATCH 32/33] Add Default Layout YAML --- Source/EditorAssets/Layouts/DefaultLayout.yaml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Source/EditorAssets/Layouts/DefaultLayout.yaml diff --git a/Source/EditorAssets/Layouts/DefaultLayout.yaml b/Source/EditorAssets/Layouts/DefaultLayout.yaml new file mode 100644 index 0000000000..9b5d0452c2 --- /dev/null +++ b/Source/EditorAssets/Layouts/DefaultLayout.yaml @@ -0,0 +1,2 @@ +DisplayName: Default Layout +ImGuiIni: "[Window][Debug##Default]\nPos=60,60\nSize=400,400\nCollapsed=0\n\n[Window][System Controls]\nPos=0,598\nSize=502,200\nCollapsed=0\nDockId=0x00000004,0\n\n[Window][System Info]\nPos=0,800\nSize=502,372\nCollapsed=0\nDockId=0x00000006,0\n\n[Window][TestWindow]\nPos=562,19\nSize=679,1153\nCollapsed=0\nDockId=0x00000015,0\n\n[Window][Example: Console]\nPos=120,299\nSize=520,600\nCollapsed=1\n\n[Window][Dear ImGui Demo]\nPos=327,146\nSize=770,855\nCollapsed=0\n\n[Window][Dear ImGui Metrics/Debugger]\nPos=283,116\nSize=712,1037\nCollapsed=0\n\n[Window][Dear ImGui Style Editor]\nPos=107,164\nSize=750,1036\nCollapsed=0\n\n[Window][Example: Log]\nPos=60,60\nSize=634,400\nCollapsed=1\n\n[Window][DockSpace Demo]\nPos=0,19\nSize=1920,1153\nCollapsed=0\n\n[Window][Example: Custom rendering]\nPos=849,297\nSize=485,414\nCollapsed=0\n\n[Window][Example: Documents]\nPos=739,108\nSize=607,944\nCollapsed=0\n\n[Window][Eggplant]\nPos=747,204\nSize=591,840\nCollapsed=0\n\n[Window][Carrot]\nPos=747,204\nSize=591,840\nCollapsed=0\n\n[Window][Lettuce]\nPos=134,237\nSize=591,840\nCollapsed=0\n\n[Window][Tomato]\nPos=747,204\nSize=591,840\nCollapsed=0\n\n[Window][Some Document]\nPos=467,324\nSize=591,840\nCollapsed=0\n\n[Window][A Rather Long Title]\nPos=256,385\nSize=591,840\nCollapsed=0\n\n[Window][DockSpaceViewport_11111111]\nPos=0,20\nSize=1920,1060\nCollapsed=0\n\n[Window][TestWindow2]\nPos=1243,19\nSize=677,1153\nCollapsed=0\nDockId=0x00000008,0\n\n[Window][Viewport]\nPos=444,249\nSize=1073,661\nCollapsed=0\nDockId=0x00000017,0\n\n[Window][Viewport 2]\nPos=1141,249\nSize=779,440\nCollapsed=0\nDockId=0x00000017,0\n\n[Window][Framerate Counter]\nPos=601,249\nSize=698,283\nCollapsed=0\nDockId=0x00000001,2\n\n[Window][Rendering Settings]\nPos=0,249\nSize=459,279\nCollapsed=0\nDockId=0x00000001,1\n\n[Window][Framerate Graph]\nPos=0,20\nSize=1071,227\nCollapsed=0\nDockId=0x00000015,0\n\n[Window][Object Properties]\nPos=0,663\nSize=459,417\nCollapsed=0\nDockId=0x00000014,0\n\n[Window][Scene Tree]\nPos=0,249\nSize=459,206\nCollapsed=0\nDockId=0x00000001,0\n\n[Window][Font Selector]\nPos=283,196\nSize=316,498\nCollapsed=0\n\n[Window][System Log]\nPos=601,817\nSize=698,572\nCollapsed=0\nDockId=0x00000014,1\n\n[Window][Pick Color Theme]\nPos=60,60\nSize=266,318\nCollapsed=0\n\n[Window][Frame Latency Graph]\nPos=1073,20\nSize=847,227\nCollapsed=0\nDockId=0x00000016,0\n\n[Window][Viewport 1]\nPos=461,249\nSize=1459,831\nCollapsed=0\nDockId=0x00000017,0\n\n[Window][Viewport 3]\nPos=1141,691\nSize=779,437\nCollapsed=0\nDockId=0x0000001B,0\n\n[Window][Viewport 4]\nPos=444,691\nSize=695,437\nCollapsed=0\nDockId=0x00000009,0\n\n[Window][About Dear ImGui]\nPos=60,60\nSize=589,466\nCollapsed=0\n\n[Window][Asset Explorer]\nPos=0,457\nSize=459,204\nCollapsed=0\nDockId=0x00000002,0\n\n[Window][Shader Editor]\nPos=0,20\nSize=599,952\nCollapsed=0\nDockId=0x0000001F,0\n\n[Window][Shader Tools]\nPos=0,709\nSize=599,680\nCollapsed=0\nDockId=0x00000010,0\n\n[Window][RAM Graph]\nPos=0,20\nSize=599,249\nCollapsed=0\nDockId=0x00000018,0\n\n[Window][Script Editor]\nPos=0,20\nSize=426,580\nCollapsed=0\nDockId=0x0000001C,0\n\n[Window][Script Tools]\nPos=0,602\nSize=426,574\nCollapsed=0\nDockId=0x0000001D,0\n\n[Window][Import##ImportModel]\nPos=60,60\nSize=584,364\nCollapsed=0\n\n[Window][Import Model##Import Model]\nPos=60,60\nSize=435,273\nCollapsed=0\n\n[Window][Compiler Log]\nPos=0,974\nSize=599,400\nCollapsed=0\nDockId=0x00000020,0\n\n[Window][Asset Streaming Settings]\nPos=0,249\nSize=459,206\nCollapsed=0\nDockId=0x00000001,1\n\n[Table][0x0B04C00B,4]\nRefScale=14\nColumn 0 Sort=0v\n\n[Table][0xC04A86C3,4]\nRefScale=14\nColumn 0 Sort=0v\n\n[Table][0x78ED9FB7,4]\nRefScale=14\nColumn 0 Sort=0v\n\n[Table][0x84CB98C9,4]\nRefScale=14\nColumn 0 Sort=0v\n\n[Docking][Data]\nDockSpace ID=0x8B93E3BD Window=0xA787BDB4 Pos=0,20 Size=1920,1060 Split=X\n DockNode ID=0x0000001A Parent=0x8B93E3BD SizeRef=426,1156 Split=Y\n DockNode ID=0x0000001C Parent=0x0000001A SizeRef=600,200 Selected=0x02DF5741\n DockNode ID=0x0000001D Parent=0x0000001A SizeRef=600,198 Selected=0xA5B8BA00\n DockNode ID=0x0000001E Parent=0x8B93E3BD SizeRef=1492,1156 Split=X\n DockNode ID=0x0000000B Parent=0x0000001E SizeRef=599,982 Split=Y\n DockNode ID=0x0000000F Parent=0x0000000B SizeRef=600,200 Split=Y Selected=0x919FD48C\n DockNode ID=0x00000018 Parent=0x0000000F SizeRef=599,249 Selected=0x734C7367\n DockNode ID=0x00000019 Parent=0x0000000F SizeRef=599,436 Split=Y Selected=0x919FD48C\n DockNode ID=0x0000001F Parent=0x00000019 SizeRef=599,952 Selected=0x919FD48C\n DockNode ID=0x00000020 Parent=0x00000019 SizeRef=599,400 Selected=0x9B2665CA\n DockNode ID=0x00000010 Parent=0x0000000B SizeRef=600,198 Selected=0xECC4EA8D\n DockNode ID=0x00000011 Parent=0x0000001E SizeRef=1319,982 Split=Y\n DockNode ID=0x0000000C Parent=0x00000011 SizeRef=3440,227 Split=X Selected=0x31F26B5E\n DockNode ID=0x00000015 Parent=0x0000000C SizeRef=832,227 Selected=0x31F26B5E\n DockNode ID=0x00000016 Parent=0x0000000C SizeRef=658,227 Selected=0xE93F57AB\n DockNode ID=0x00000013 Parent=0x00000011 SizeRef=3440,1127 Split=X\n DockNode ID=0x00000003 Parent=0x00000013 SizeRef=502,1153 Split=Y Selected=0x8769D556\n DockNode ID=0x00000004 Parent=0x00000003 SizeRef=560,200 Selected=0xCDAE6D71\n DockNode ID=0x00000006 Parent=0x00000003 SizeRef=560,372 Selected=0x8769D556\n DockNode ID=0x00000005 Parent=0x00000013 SizeRef=1416,1153 Split=X Selected=0x42F3B5AC\n DockNode ID=0x00000007 Parent=0x00000005 SizeRef=679,1153 Split=X Selected=0x995B0CF8\n DockNode ID=0x0000000D Parent=0x00000007 SizeRef=459,901 Split=Y Selected=0xF8780F64\n DockNode ID=0x00000012 Parent=0x0000000D SizeRef=442,458 Split=Y Selected=0x3875EE28\n DockNode ID=0x00000001 Parent=0x00000012 SizeRef=442,283 Selected=0x889B4A2B\n DockNode ID=0x00000002 Parent=0x00000012 SizeRef=442,281 Selected=0x7E9CA0E4\n DockNode ID=0x00000014 Parent=0x0000000D SizeRef=442,463 Selected=0xF8780F64\n DockNode ID=0x0000000E Parent=0x00000007 SizeRef=1031,901 Split=X Selected=0x995B0CF8\n DockNode ID=0x00000009 Parent=0x0000000E SizeRef=695,617 Selected=0x505088A2\n DockNode ID=0x0000000A Parent=0x0000000E SizeRef=779,617 Split=Y Selected=0xC959D918\n DockNode ID=0x00000017 Parent=0x0000000A SizeRef=858,440 CentralNode=1 Selected=0x505088A2\n DockNode ID=0x0000001B Parent=0x0000000A SizeRef=858,437 Selected=0xBE5EE98E\n DockNode ID=0x00000008 Parent=0x00000005 SizeRef=677,1153 Selected=0xC5F7A27B\n\n" From 275a046619fbb316c08f722db81e38773ccc3cac Mon Sep 17 00:00:00 2001 From: datacrystals Date: Fri, 2 Sep 2022 21:00:00 +0000 Subject: [PATCH 33/33] Call LoadLayouts --- .../Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp index d9cb3853ec..ca04f2ff6b 100644 --- a/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp +++ b/Source/Core/Editor/Utils/ERS_Editor_LayoutManager/ERS_Editor_LayoutManager.cpp @@ -13,7 +13,7 @@ ERS_CLASS_LayoutManager::ERS_CLASS_LayoutManager(ERS_STRUCT_SystemUtils* SystemU WindowManager_ = WindowManager; Logger_->Log("Initializing Layout Manager", 5); - + LoadLayouts(); }