From 1ff82119667872c99d564bd965abacc6e77e4423 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 18 Mar 2023 19:21:11 +0100 Subject: editor: add deleting scenery to context menu --- editor/imgui.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'editor') diff --git a/editor/imgui.cpp b/editor/imgui.cpp index 6904f0f5..d4bb7f65 100644 --- a/editor/imgui.cpp +++ b/editor/imgui.cpp @@ -146,18 +146,19 @@ void app::do_popup_menu() { fm_assert(target != popup_target_type::none && sc != nullptr); + ImGui::SeparatorText("Setup"); const auto i = sc->index(); if (ImGui::MenuItem("Activate", nullptr, false, sc->can_activate(i))) sc->activate(i); - if (auto next_rot = sc->atlas->next_rotation_from(sc->r); - next_rot != sc->r && ImGui::MenuItem("Rotate", nullptr, false, next_rot != sc->r)) - sc->rotate(i, next_rot); - - ImGui::Separator(); - if (bool b_ins = sc && !check_inspector_exists(_popup_target); ImGui::MenuItem("Inspect", nullptr, false, b_ins)) inspectors.push_back(std::exchange(_popup_target, {})); + ImGui::SeparatorText("Modify"); + if (auto next_rot = sc->atlas->next_rotation_from(sc->r); + next_rot != sc->r && ImGui::MenuItem("Rotate", nullptr, false, next_rot != sc->r)) + sc->rotate(i, next_rot); + if (ImGui::MenuItem("Delete", nullptr, false)) + sc->chunk().remove_entity(sc->index()); } } -- cgit v1.2.3