Added Copy/Paste of component values, scene name display, editor config #300
|
@ -84,34 +84,32 @@ namespace SHADE
|
|||
editor->selectedEntities.clear();
|
||||
}
|
||||
ImGui::SeparatorEx(ImGuiSeparatorFlags_Horizontal);
|
||||
if (ImGui::IsWindowFocused())
|
||||
|
||||
if (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && ImGui::IsKeyReleased(ImGuiKey_A))
|
||||
{
|
||||
if (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && ImGui::IsKeyReleased(ImGuiKey_A))
|
||||
SelectAllEntities();
|
||||
}
|
||||
if (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && ImGui::IsKeyReleased(ImGuiKey_C))
|
||||
{
|
||||
CopySelectedEntities();
|
||||
}
|
||||
if (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && !ImGui::IsKeyDown(ImGuiKey_LeftShift) && ImGui::IsKeyReleased(ImGuiKey_V))
|
||||
{
|
||||
PasteEntities();
|
||||
}
|
||||
if (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && ImGui::IsKeyDown(ImGuiKey_LeftShift) && ImGui::IsKeyReleased(ImGuiKey_V))
|
||||
{
|
||||
const auto editor = SHSystemManager::GetSystem<SHEditor>();
|
||||
if (editor->selectedEntities.size() == 1)
|
||||
{
|
||||
SelectAllEntities();
|
||||
}
|
||||
if (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && ImGui::IsKeyReleased(ImGuiKey_C))
|
||||
{
|
||||
CopySelectedEntities();
|
||||
}
|
||||
if (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && !ImGui::IsKeyDown(ImGuiKey_LeftShift) && ImGui::IsKeyReleased(ImGuiKey_V))
|
||||
{
|
||||
PasteEntities();
|
||||
}
|
||||
if (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && ImGui::IsKeyDown(ImGuiKey_LeftShift) && ImGui::IsKeyReleased(ImGuiKey_V))
|
||||
{
|
||||
const auto editor = SHSystemManager::GetSystem<SHEditor>();
|
||||
if (editor->selectedEntities.size() == 1)
|
||||
{
|
||||
PasteEntities(editor->selectedEntities.back());
|
||||
}
|
||||
}
|
||||
if(ImGui::IsKeyReleased(ImGuiKey_Delete))
|
||||
{
|
||||
DeleteSelectedEntities();
|
||||
PasteEntities(editor->selectedEntities.back());
|
||||
}
|
||||
}
|
||||
|
||||
if (ImGui::IsKeyReleased(ImGuiKey_Delete))
|
||||
{
|
||||
DeleteSelectedEntities();
|
||||
}
|
||||
|
||||
}
|
||||
if(ImGui::IsWindowHovered() && !ImGui::IsAnyItemHovered() && ImGui::IsMouseReleased(ImGuiMouseButton_Left))
|
||||
{
|
||||
|
|
|
@ -162,26 +162,7 @@ namespace SHADE
|
|||
RenderUnsavedChangesPrompt();
|
||||
//PollPicking();
|
||||
|
||||
if(ImGui::IsKeyDown(ImGuiKey_LeftShift) && ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && ImGui::IsKeyReleased(ImGuiKey_Z))
|
||||
{
|
||||
SHCommandManager::RedoCommand();
|
||||
}
|
||||
else if(ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && ImGui::IsKeyReleased(ImGuiKey_Z))
|
||||
{
|
||||
SHCommandManager::UndoCommand();
|
||||
}
|
||||
if(ImGui::IsKeyReleased(ImGuiKey_F5))
|
||||
{
|
||||
Play();
|
||||
}
|
||||
else if (ImGui::IsKeyReleased(ImGuiKey_F6))
|
||||
{
|
||||
Pause();
|
||||
}
|
||||
else if (ImGui::IsKeyReleased(ImGuiKey_F7))
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
ProcessShortcuts();
|
||||
|
||||
Render();
|
||||
}
|
||||
|
@ -669,6 +650,37 @@ namespace SHADE
|
|||
LoadScene(SHSceneManager::GetCurrentSceneAssetID());
|
||||
}
|
||||
|
||||
void SHEditor::ProcessShortcuts()
|
||||
{
|
||||
if(ImGui::IsKeyDown(ImGuiKey_LeftCtrl))
|
||||
{
|
||||
if(ImGui::IsKeyReleased(ImGuiKey_S))
|
||||
{
|
||||
SaveScene();
|
||||
}
|
||||
}
|
||||
if (ImGui::IsKeyDown(ImGuiKey_LeftShift) && ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && ImGui::IsKeyReleased(ImGuiKey_Z))
|
||||
{
|
||||
SHCommandManager::RedoCommand();
|
||||
}
|
||||
else if (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && ImGui::IsKeyReleased(ImGuiKey_Z))
|
||||
{
|
||||
SHCommandManager::UndoCommand();
|
||||
}
|
||||
if (ImGui::IsKeyReleased(ImGuiKey_F5))
|
||||
{
|
||||
Play();
|
||||
}
|
||||
else if (ImGui::IsKeyReleased(ImGuiKey_F6))
|
||||
{
|
||||
Pause();
|
||||
}
|
||||
else if (ImGui::IsKeyReleased(ImGuiKey_F7))
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
|
||||
void SHEditor::NewFrame()
|
||||
{
|
||||
SDL_Event event;
|
||||
|
|
|
@ -123,6 +123,8 @@ namespace SHADE
|
|||
void Pause();
|
||||
void Stop();
|
||||
|
||||
void ProcessShortcuts();
|
||||
|
||||
// List of selected entities
|
||||
std::vector<EntityID> selectedEntities;
|
||||
|
||||
|
|
|
@ -174,9 +174,9 @@ namespace SHADE
|
|||
YAML::Node node{};
|
||||
if (ComponentType* component = SHComponentManager::GetComponent_s<ComponentType>(eid))
|
||||
{
|
||||
node = SHSerializationHelper::SerializeComponentToNode(component);
|
||||
node = SHSerializationHelper::SerializeComponentToNode(component);
|
||||
componentsNode[rttr::type::get<ComponentType>().get_name().data()] = node;
|
||||
}
|
||||
componentsNode[rttr::type::get<ComponentType>().get_name().data()] = node;
|
||||
}
|
||||
|
||||
YAML::Node SHSerialization::SerializeEntityToNode(SHSceneNode* sceneNode)
|
||||
|
|
Loading…
Reference in New Issue