Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
AIEditorMenus.cpp
Go to the documentation of this file.
1/**
2 * @file AIEditorMenus.cpp
3 * @brief Implementation of AI Editor menus
4 * @author Olympe Engine
5 * @date 2026-02-18
6 */
7
8#include "AIEditorMenus.h"
9#include "AIEditorGUI.h"
10#include "../../Core/IconsFontAwesome6.h"
11#include "../../third_party/imgui/imgui.h"
12#include "../../system/system_utils.h"
13
14namespace Olympe {
15namespace AI {
16
17// ============================================================================
18// Menu Rendering
19// ============================================================================
20
22{
23 if (ImGui::BeginMenu(ICON_FA_FILE " File")) {
24 if (ImGui::MenuItem(ICON_FA_BRAIN " New Behavior Tree", "Ctrl+N")) {
25 editor->MenuAction_NewBT();
26 }
27 if (ImGui::MenuItem(ICON_FA_DIAGRAM_PROJECT " New HFSM", "Ctrl+Shift+N")) {
28 editor->MenuAction_NewHFSM();
29 }
30 ImGui::Separator();
31 if (ImGui::MenuItem(ICON_FA_FOLDER_OPEN " Open", "Ctrl+O")) {
32 editor->MenuAction_Open();
33 }
34 if (ImGui::MenuItem(ICON_FA_FLOPPY_DISK " Save", "Ctrl+S")) {
35 editor->MenuAction_Save();
36 }
37 if (ImGui::MenuItem(ICON_FA_FLOPPY_DISK " Save As", "Ctrl+Shift+S")) {
38 editor->MenuAction_SaveAs();
39 }
40 ImGui::Separator();
41 if (ImGui::MenuItem(ICON_FA_XMARK " Close", "Ctrl+W")) {
42 editor->MenuAction_Close();
43 }
44 ImGui::EndMenu();
45 }
46}
47
49{
50 if (ImGui::BeginMenu(ICON_FA_PEN_TO_SQUARE " Edit")) {
51 bool canUndo = editor->GetCommandStack().CanUndo();
52 bool canRedo = editor->GetCommandStack().CanRedo();
53
54 if (ImGui::MenuItem(ICON_FA_ROTATE_LEFT " Undo", "Ctrl+Z", false, canUndo)) {
55 editor->MenuAction_Undo();
56 }
57 if (ImGui::MenuItem(ICON_FA_ROTATE_RIGHT " Redo", "Ctrl+Y", false, canRedo)) {
58 editor->MenuAction_Redo();
59 }
60 ImGui::Separator();
61 if (ImGui::MenuItem(ICON_FA_SCISSORS " Cut", "Ctrl+X")) {
62 editor->MenuAction_Cut();
63 }
64 if (ImGui::MenuItem(ICON_FA_COPY " Copy", "Ctrl+C")) {
65 editor->MenuAction_Copy();
66 }
67 if (ImGui::MenuItem(ICON_FA_CLIPBOARD " Paste", "Ctrl+V")) {
68 editor->MenuAction_Paste();
69 }
70 if (ImGui::MenuItem(ICON_FA_TRASH_CAN " Delete", "Delete")) {
71 editor->MenuAction_Delete();
72 }
73 ImGui::Separator();
74 if (ImGui::MenuItem(ICON_FA_CHECK " Select All", "Ctrl+A")) {
75 editor->MenuAction_SelectAll();
76 }
77 ImGui::EndMenu();
78 }
79}
80
82{
83 if (ImGui::BeginMenu(ICON_FA_EYE " View")) {
84 if (ImGui::MenuItem(ICON_FA_CUBES " Show Node Palette")) {
85 editor->MenuAction_ShowNodePalette();
86 }
87 if (ImGui::MenuItem(ICON_FA_TABLE " Show Blackboard")) {
88 editor->MenuAction_ShowBlackboard();
89 }
90 if (ImGui::MenuItem(ICON_FA_MICROCHIP " Show Senses Panel")) {
91 editor->MenuAction_ShowSensesPanel();
92 }
93 if (ImGui::MenuItem(ICON_FA_BUG " Show Runtime Debug")) {
94 editor->MenuAction_ShowRuntimeDebug();
95 }
96 ImGui::Separator();
97 if (ImGui::MenuItem(ICON_FA_WINDOW_RESTORE " Reset Layout")) {
98 editor->MenuAction_ResetLayout();
99 }
100 ImGui::EndMenu();
101 }
102}
103
105{
106 if (ImGui::BeginMenu(ICON_FA_CIRCLE_QUESTION " Help")) {
107 if (ImGui::MenuItem(ICON_FA_CIRCLE_INFO " About")) {
108 editor->MenuAction_About();
109 }
110 ImGui::EndMenu();
111 }
112 (void)editor;
113}
114
115// ============================================================================
116// Dialogs
117// ============================================================================
118
120{
121 // TODO: Implement new BT dialog with templates
122 SYSTEM_LOG << "[AIEditorMenus] New BT dialog (not yet implemented)" << std::endl;
123 (void)editor;
124}
125
127{
128 // TODO: Implement file browser dialog
129 SYSTEM_LOG << "[AIEditorMenus] Open dialog (not yet implemented)" << std::endl;
130 (void)editor;
131}
132
134{
135 // TODO: Implement save as dialog
136 SYSTEM_LOG << "[AIEditorMenus] Save As dialog (not yet implemented)" << std::endl;
137 (void)editor;
138}
139
141{
142 ImGui::OpenPopup("About AI Editor");
143
144 if (ImGui::BeginPopupModal("About AI Editor", nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
145 ImGui::Text("AI Editor v1.0");
146 ImGui::Text("Phase 1.3 Implementation");
147 ImGui::Separator();
148 ImGui::Text("Olympe Engine");
149 ImGui::Text("(c) 2026");
150
151 ImGui::Separator();
152
153 if (ImGui::Button("Close")) {
154 ImGui::CloseCurrentPopup();
155 }
156
157 ImGui::EndPopup();
158 }
159}
160
161} // namespace AI
162} // namespace Olympe
Main GUI class for AI Editor (Phase 1.3)
Menu handlers for AI Editor.
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
#define ICON_FA_PEN_TO_SQUARE
#define ICON_FA_CUBES
#define ICON_FA_SCISSORS
#define ICON_FA_FILE
#define ICON_FA_DIAGRAM_PROJECT
#define ICON_FA_ROTATE_RIGHT
#define ICON_FA_TABLE
#define ICON_FA_EYE
#define ICON_FA_TRASH_CAN
#define ICON_FA_WINDOW_RESTORE
#define ICON_FA_CIRCLE_INFO
#define ICON_FA_MICROCHIP
#define ICON_FA_FOLDER_OPEN
#define ICON_FA_CIRCLE_QUESTION
#define ICON_FA_BRAIN
#define ICON_FA_XMARK
#define ICON_FA_FLOPPY_DISK
#define ICON_FA_ROTATE_LEFT
#define ICON_FA_COPY
#define ICON_FA_BUG
#define ICON_FA_CLIPBOARD
#define ICON_FA_CHECK
Main AI Editor GUI class.
Definition AIEditorGUI.h:41
static void ShowSaveAsDialog(AIEditorGUI *editor)
Show Save As dialog.
static void ShowNewBTDialog(AIEditorGUI *editor)
Show New BT dialog.
static void RenderViewMenu(AIEditorGUI *editor)
Render View menu.
static void ShowAboutDialog()
Show About dialog.
static void ShowOpenDialog(AIEditorGUI *editor)
Show Open dialog.
static void RenderEditMenu(AIEditorGUI *editor)
Render Edit menu.
static void RenderFileMenu(AIEditorGUI *editor)
Render File menu.
static void RenderHelpMenu(AIEditorGUI *editor)
Render Help menu.
< Provides AssetID and INVALID_ASSET_ID
#define SYSTEM_LOG