diff --git a/src/app/editor/editor_manager.cc b/src/app/editor/editor_manager.cc index fe49c391..ee9e3e4b 100644 --- a/src/app/editor/editor_manager.cc +++ b/src/app/editor/editor_manager.cc @@ -121,6 +121,21 @@ void EditorManager::HideCurrentEditorCards() { card_manager.HideAllCardsInCategory(category); } +void EditorManager::ShowHexEditor() { + auto& card_manager = gui::EditorCardManager::Get(); + card_manager.ShowCard("memory.hex_editor"); +} + +#ifdef YAZE_WITH_GRPC +void EditorManager::ShowAIAgent() { + agent_editor_.set_active(true); +} + +void EditorManager::ShowChatHistory() { + agent_chat_history_popup_.Toggle(); +} +#endif + EditorManager::EditorManager() : blank_editor_set_(nullptr, &user_settings_), project_manager_(&toast_manager_), diff --git a/src/app/editor/editor_manager.h b/src/app/editor/editor_manager.h index 0aa006b9..b1e8ff48 100644 --- a/src/app/editor/editor_manager.h +++ b/src/app/editor/editor_manager.h @@ -241,6 +241,19 @@ class EditorManager { void ShowImGuiMetrics() { if (ui_coordinator_) ui_coordinator_->SetImGuiMetricsVisible(true); } + void ShowHexEditor(); + void ShowEmulator() { show_emulator_ = true; } + void ShowCardBrowser() { + if (ui_coordinator_) ui_coordinator_->ShowCardBrowser(); + } + void ShowWelcomeScreen() { + if (ui_coordinator_) ui_coordinator_->SetWelcomeScreenVisible(true); + } +#ifdef YAZE_WITH_GRPC + void ShowAIAgent(); + void ShowChatHistory(); + void ShowProposalDrawer() { proposal_drawer_.Show(); } +#endif // ROM and Project operations (public for MenuOrchestrator) absl::Status LoadRom(); diff --git a/src/app/editor/system/menu_orchestrator.cc b/src/app/editor/system/menu_orchestrator.cc index 66270c65..87ba766c 100644 --- a/src/app/editor/system/menu_orchestrator.cc +++ b/src/app/editor/system/menu_orchestrator.cc @@ -177,10 +177,34 @@ void MenuOrchestrator::AddViewMenuItems() { [this]() { OnSwitchToEditor(EditorType::kPalette); }, "Ctrl+7") .Item("Screens", ICON_MD_TV, [this]() { OnSwitchToEditor(EditorType::kScreen); }, "Ctrl+8") - .Item("Hex Editor", ICON_MD_DATA_ARRAY, - [this]() { OnSwitchToEditor(EditorType::kHex); }, "Ctrl+9") .Item("Assembly", ICON_MD_CODE, - [this]() { OnSwitchToEditor(EditorType::kAssembly); }, "Ctrl+0") + [this]() { OnSwitchToEditor(EditorType::kAssembly); }, "Ctrl+9") + .Item("Hex Editor", ICON_MD_DATA_ARRAY, + [this]() { OnShowHexEditor(); }, "Ctrl+0") + .Separator(); + + // Special Editors +#ifdef YAZE_WITH_GRPC + menu_builder_ + .Item("AI Agent", ICON_MD_SMART_TOY, + [this]() { OnShowAIAgent(); }, "Ctrl+Shift+A") + .Item("Chat History", ICON_MD_CHAT, + [this]() { OnShowChatHistory(); }, "Ctrl+H") + .Item("Proposal Drawer", ICON_MD_PREVIEW, + [this]() { OnShowProposalDrawer(); }, "Ctrl+P"); +#endif + + menu_builder_ + .Item("Emulator", ICON_MD_VIDEOGAME_ASSET, + [this]() { OnShowEmulator(); }, "Ctrl+Shift+E") + .Separator(); + + // Additional UI Elements + menu_builder_ + .Item("Card Browser", ICON_MD_DASHBOARD, + [this]() { OnShowCardBrowser(); }, "Ctrl+Shift+B") + .Item("Welcome Screen", ICON_MD_HOME, + [this]() { OnShowWelcomeScreen(); }) .Separator(); // Display Settings @@ -497,6 +521,51 @@ void MenuOrchestrator::OnShowDisplaySettings() { } } +void MenuOrchestrator::OnShowHexEditor() { + // Show hex editor card via EditorCardManager + if (editor_manager_) { + editor_manager_->ShowHexEditor(); + } +} + +void MenuOrchestrator::OnShowEmulator() { + if (editor_manager_) { + editor_manager_->ShowEmulator(); + } +} + +void MenuOrchestrator::OnShowCardBrowser() { + if (editor_manager_) { + editor_manager_->ShowCardBrowser(); + } +} + +void MenuOrchestrator::OnShowWelcomeScreen() { + if (editor_manager_) { + editor_manager_->ShowWelcomeScreen(); + } +} + +#ifdef YAZE_WITH_GRPC +void MenuOrchestrator::OnShowAIAgent() { + if (editor_manager_) { + editor_manager_->ShowAIAgent(); + } +} + +void MenuOrchestrator::OnShowChatHistory() { + if (editor_manager_) { + editor_manager_->ShowChatHistory(); + } +} + +void MenuOrchestrator::OnShowProposalDrawer() { + if (editor_manager_) { + editor_manager_->ShowProposalDrawer(); + } +} +#endif + // Session management menu actions void MenuOrchestrator::OnCreateNewSession() { session_coordinator_.CreateNewSession(); diff --git a/src/app/editor/system/menu_orchestrator.h b/src/app/editor/system/menu_orchestrator.h index 95a7210d..70d68118 100644 --- a/src/app/editor/system/menu_orchestrator.h +++ b/src/app/editor/system/menu_orchestrator.h @@ -87,6 +87,16 @@ class MenuOrchestrator { void OnSwitchToEditor(EditorType editor_type); void OnShowEditorSelection(); void OnShowDisplaySettings(); + void OnShowHexEditor(); + void OnShowEmulator(); + void OnShowCardBrowser(); + void OnShowWelcomeScreen(); + +#ifdef YAZE_WITH_GRPC + void OnShowAIAgent(); + void OnShowChatHistory(); + void OnShowProposalDrawer(); +#endif // Session management menu actions void OnCreateNewSession();