feat(editor): add hex editor and AI agent functionalities to MenuOrchestrator
- Implemented methods in EditorManager to show the hex editor, AI agent, and chat history, enhancing the editor's capabilities. - Updated MenuOrchestrator to include new menu items for accessing the hex editor, AI agent, chat history, and other UI elements. - Improved user interaction by providing quick access to essential features through keyboard shortcuts. Benefits: - Streamlines the user experience by integrating additional editor functionalities. - Enhances the overall architecture by clearly defining roles for UI and editor operations within the MenuOrchestrator.
This commit is contained in:
@@ -121,6 +121,21 @@ void EditorManager::HideCurrentEditorCards() {
|
|||||||
card_manager.HideAllCardsInCategory(category);
|
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()
|
EditorManager::EditorManager()
|
||||||
: blank_editor_set_(nullptr, &user_settings_),
|
: blank_editor_set_(nullptr, &user_settings_),
|
||||||
project_manager_(&toast_manager_),
|
project_manager_(&toast_manager_),
|
||||||
|
|||||||
@@ -241,6 +241,19 @@ class EditorManager {
|
|||||||
void ShowImGuiMetrics() {
|
void ShowImGuiMetrics() {
|
||||||
if (ui_coordinator_) ui_coordinator_->SetImGuiMetricsVisible(true);
|
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)
|
// ROM and Project operations (public for MenuOrchestrator)
|
||||||
absl::Status LoadRom();
|
absl::Status LoadRom();
|
||||||
|
|||||||
@@ -177,10 +177,34 @@ void MenuOrchestrator::AddViewMenuItems() {
|
|||||||
[this]() { OnSwitchToEditor(EditorType::kPalette); }, "Ctrl+7")
|
[this]() { OnSwitchToEditor(EditorType::kPalette); }, "Ctrl+7")
|
||||||
.Item("Screens", ICON_MD_TV,
|
.Item("Screens", ICON_MD_TV,
|
||||||
[this]() { OnSwitchToEditor(EditorType::kScreen); }, "Ctrl+8")
|
[this]() { OnSwitchToEditor(EditorType::kScreen); }, "Ctrl+8")
|
||||||
.Item("Hex Editor", ICON_MD_DATA_ARRAY,
|
|
||||||
[this]() { OnSwitchToEditor(EditorType::kHex); }, "Ctrl+9")
|
|
||||||
.Item("Assembly", ICON_MD_CODE,
|
.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();
|
.Separator();
|
||||||
|
|
||||||
// Display Settings
|
// 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
|
// Session management menu actions
|
||||||
void MenuOrchestrator::OnCreateNewSession() {
|
void MenuOrchestrator::OnCreateNewSession() {
|
||||||
session_coordinator_.CreateNewSession();
|
session_coordinator_.CreateNewSession();
|
||||||
|
|||||||
@@ -87,6 +87,16 @@ class MenuOrchestrator {
|
|||||||
void OnSwitchToEditor(EditorType editor_type);
|
void OnSwitchToEditor(EditorType editor_type);
|
||||||
void OnShowEditorSelection();
|
void OnShowEditorSelection();
|
||||||
void OnShowDisplaySettings();
|
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
|
// Session management menu actions
|
||||||
void OnCreateNewSession();
|
void OnCreateNewSession();
|
||||||
|
|||||||
Reference in New Issue
Block a user