editor: undo/redo improvements; also added cut to Ctrl+X;

This commit is contained in:
Turánszki János
2022-02-13 00:28:17 +01:00
parent ab75435c41
commit e599f40664
12 changed files with 177 additions and 76 deletions
+9
View File
@@ -70,8 +70,17 @@ void SoundWindow::Create(EditorComponent* editor)
wi::helper::FileDialog(params, [=](std::string fileName) {
wi::eventhandler::Subscribe_Once(wi::eventhandler::EVENT_THREAD_SAFE_POINT, [=](uint64_t userdata) {
Entity entity = GetScene().Entity_CreateSound("editorSound", fileName);
wi::Archive& archive = editor->AdvanceHistory();
archive << EditorComponent::HISTORYOP_ADD;
editor->RecordSelection(archive);
editor->ClearSelected();
editor->AddSelected(entity);
editor->RecordSelection(archive);
editor->RecordAddedEntity(archive, entity);
editor->RefreshSceneGraphView();
SetEntity(entity);
});