diff --git a/src/app/editor/agent/agent_chat_widget.cc b/src/app/editor/agent/agent_chat_widget.cc index 396185b8..325b02f3 100644 --- a/src/app/editor/agent/agent_chat_widget.cc +++ b/src/app/editor/agent/agent_chat_widget.cc @@ -670,7 +670,8 @@ void AgentChatWidget::Draw() { ImGui::EndTabBar(); } - + + ImGui::PopStyleVar(4); // Pop the 4 style vars we pushed ImGui::End(); } diff --git a/src/app/editor/code/project_file_editor.cc b/src/app/editor/code/project_file_editor.cc index e2b1c2d1..286c43cb 100644 --- a/src/app/editor/code/project_file_editor.cc +++ b/src/app/editor/code/project_file_editor.cc @@ -25,7 +25,7 @@ void ProjectFileEditor::Draw() { ImGui::SetNextWindowSize(ImVec2(900, 700), ImGuiCond_FirstUseEver); if (!ImGui::Begin(absl::StrFormat("%s Project Editor###ProjectFileEditor", - ICON_MD_EDIT_DOCUMENT).c_str(), + ICON_MD_DESCRIPTION).c_str(), &active_)) { ImGui::End(); return; @@ -239,7 +239,7 @@ void ProjectFileEditor::ValidateContent() { for (const auto& line : lines) { line_num++; - std::string trimmed = absl::StripAsciiWhitespace(line); + std::string trimmed = std::string(absl::StripAsciiWhitespace(line)); // Skip empty lines and comments if (trimmed.empty() || trimmed[0] == '#') continue; diff --git a/src/app/editor/editor_library.cmake b/src/app/editor/editor_library.cmake index 4e888a12..d84ca553 100644 --- a/src/app/editor/editor_library.cmake +++ b/src/app/editor/editor_library.cmake @@ -20,6 +20,7 @@ set( app/editor/message/message_data.cc app/editor/message/message_preview.cc app/editor/code/assembly_editor.cc + app/editor/code/project_file_editor.cc app/editor/graphics/screen_editor.cc app/editor/graphics/graphics_editor.cc app/editor/graphics/palette_editor.cc diff --git a/src/app/editor/editor_manager.cc b/src/app/editor/editor_manager.cc index dc1f5eb9..7e3ce6d1 100644 --- a/src/app/editor/editor_manager.cc +++ b/src/app/editor/editor_manager.cc @@ -232,6 +232,9 @@ void EditorManager::Initialize(const std::string& filename) { // Set the popup manager in the context context_.popup_manager = popup_manager_.get(); + // Initialize project file editor + project_file_editor_.SetToastManager(&toast_manager_); + #ifdef YAZE_WITH_GRPC // Initialize the agent editor agent_editor_.Initialize(&toast_manager_, &proposal_drawer_); @@ -482,6 +485,19 @@ void EditorManager::Initialize(const std::string& filename) { project_menu_subitems.emplace_back( "Save Project", "", [this]() { status_ = SaveProject(); }, [this]() { return current_project_.project_opened(); }); + project_menu_subitems.emplace_back(gui::kSeparator, "", nullptr, []() { return true; }); + project_menu_subitems.emplace_back( + absl::StrCat(ICON_MD_EDIT, " Edit Project File"), "", + [this]() { + project_file_editor_.set_active(true); + if (current_project_.project_opened() && !current_project_.filepath.empty()) { + auto status = project_file_editor_.LoadFile(current_project_.filepath); + if (!status.ok()) { + toast_manager_.Show(std::string(status.message()), editor::ToastType::kError); + } + } + }, + [this]() { return current_project_.project_opened(); }); project_menu_subitems.emplace_back("Save Workspace Layout", "", [this]() { ImGuiID dockspace_id = ImGui::GetID("MyDockSpace"); ImGui::SaveIniSettingsToDisk("yaze_workspace.ini"); @@ -1249,6 +1265,9 @@ void EditorManager::DrawMenuBar() { if (show_asm_editor_ && current_editor_set_) { current_editor_set_->assembly_editor_.Update(show_asm_editor_); } + + // Project file editor + project_file_editor_.Draw(); if (show_performance_dashboard_) { gfx::PerformanceDashboard::Get().SetVisible(true); gfx::PerformanceDashboard::Get().Update(); diff --git a/src/app/editor/editor_manager.h b/src/app/editor/editor_manager.h index 199ba88f..9f771367 100644 --- a/src/app/editor/editor_manager.h +++ b/src/app/editor/editor_manager.h @@ -13,6 +13,7 @@ #include "app/core/project.h" #include "app/editor/code/assembly_editor.h" #include "app/editor/code/memory_editor.h" +#include "app/editor/code/project_file_editor.h" #include "app/editor/dungeon/dungeon_editor_v2.h" #include "app/editor/graphics/graphics_editor.h" #include "app/editor/graphics/palette_editor.h" @@ -184,6 +185,9 @@ class EditorManager { ProposalDrawer proposal_drawer_; bool show_proposal_drawer_ = false; + // Project file editor + ProjectFileEditor project_file_editor_; + #ifdef YAZE_WITH_GRPC // Agent editor - manages chat, collaboration, and network coordination AgentEditor agent_editor_;