Skip to content

Commit

Permalink
- bind delete to delete key
Browse files Browse the repository at this point in the history
  • Loading branch information
kaffeewolf committed Nov 9, 2024
1 parent 2d397b2 commit 46a89c4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions toolkit/editor/editor/ui/uimanager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include "dynui/imguicontext.h"
#include "io/filedialog.h"
#include "window.h"
#include "editor/tools/selectiontool.h"
#include "editor/cmds.h"

#include "frame/default.h"
#include "frame/editorframe.h"
Expand Down Expand Up @@ -85,6 +87,18 @@ OnActivate()
windowServer->RegisterCommand([](){ Presentation::WindowServer::Instance()->BroadcastSave(Presentation::BaseWindow::SaveMode::SaveAll); }, "Save All", "Ctrl+Shift+S", "Edit");
windowServer->RegisterCommand([](){ Edit::CommandManager::Undo(); }, "Undo", "Ctrl+Z", "Edit");
windowServer->RegisterCommand([](){ Edit::CommandManager::Redo(); }, "Redo", "Ctrl+Shift+Z", "Edit");
windowServer->RegisterCommand([]()
{
auto selection = Tools::SelectionTool::Selection();
Edit::CommandManager::BeginMacro("Delete entities", false);
Util::Array<Editor::Entity> emptySelection;
Edit::SetSelection(emptySelection);
for (auto e : selection)
{
Edit::DeleteEntity(e);
}
Edit::CommandManager::EndMacro();
}, "Delete", "Delete", "Edit");
windowServer->RegisterCommand([](){
static Util::String localpath = IO::URI("export:levels").LocalPath();
Util::String path;
Expand Down

0 comments on commit 46a89c4

Please sign in to comment.