MCPcopy Create free account
hub / github.com/antopilo/Nuake / DrawMenuBar

Method DrawMenuBar

Editor/Source/Editor/Windows/EditorInterface.cpp:2284–2459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2282 }
2283
2284 void EditorInterface::DrawMenuBar()
2285 {
2286 const ImRect menuBarRect = { ImGui::GetCursorPos(), { ImGui::GetContentRegionAvail().x + ImGui::GetCursorScreenPos().x, ImGui::GetFrameHeightWithSpacing() } };
2287 ImGui::BeginGroup();
2288
2289 if (BeginMenubar(menuBarRect))
2290 {
2291 if (ImGui::BeginMenu("File"))
2292 {
2293 if (ImGui::MenuItem("New project", "CTRL+N"))
2294 {
2295 NewProject();
2296
2297 Selection = EditorSelection();
2298 }
2299 if (ImGui::MenuItem("Open..."))
2300 {
2301 OpenProject();
2302
2303 Selection = EditorSelection();
2304 }
2305 if (ImGui::MenuItem("Save Project", "CTRL+S"))
2306 {
2307 PushCommand(SaveProjectCommand(Engine::GetProject()));
2308
2309 Selection = EditorSelection();
2310
2311 SetStatusMessage("Project saved.");
2312
2313 }
2314 if (ImGui::MenuItem("Save Project as...", "CTRL+SHIFT+S"))
2315 {
2316 std::string savePath = FileDialog::SaveFile("*.project");
2317 Engine::GetProject()->SaveAs(savePath);
2318
2319 Selection = EditorSelection();
2320 }
2321 ImGui::Separator();
2322 if (ImGui::MenuItem("Set Scene As Default"))
2323 {
2324 Engine::GetProject()->DefaultScene = Engine::GetCurrentScene();
2325 SetStatusMessage("Current scene set as project default.");
2326 }
2327 ImGui::Separator();
2328 if (ImGui::MenuItem("New Scene"))
2329 {
2330 Ref<Scene> newScene = Scene::New();
2331
2332 OpenSceneWindow(newScene);
2333
2334 Selection = EditorSelection();
2335 SetStatusMessage("New scene created.");
2336 }
2337 if (ImGui::MenuItem("Open Scene...", "CTRL+O"))
2338 {
2339 OpenScene();
2340 Selection = EditorSelection();
2341 }

Callers

nothing calls this directly

Calls 13

GetCursorPosFunction · 0.85
NewProjectFunction · 0.85
EditorSelectionClass · 0.85
OpenProjectFunction · 0.85
SaveProjectCommandClass · 0.85
OpenSceneFunction · 0.85
LogFunction · 0.85
GenerateSolutionMethod · 0.80
RecompileShadersMethod · 0.80
SaveAsMethod · 0.45

Tested by

no test coverage detected