fixup! Editor widget selection and creation

This commit is contained in:
2016-01-19 13:32:32 +01:00
parent 260203fa4d
commit 8854794cbc
6 changed files with 64 additions and 94 deletions
+5 -5
View File
@@ -126,6 +126,8 @@ void EditorSystem::setWidgetMode(EditorGUI::WidgetMode mode)
return;
}
m_WidgetMode = mode;
if (m_Widget.Valid()) {
m_Widget.World->DeleteEntity(m_Widget.ID);
m_Widget = EntityWrapper::Invalid;
@@ -137,17 +139,15 @@ void EditorSystem::setWidgetMode(EditorGUI::WidgetMode mode)
switch (mode) {
case EditorGUI::WidgetMode::Translate:
m_Widget = importEntity(EntityWrapper(m_World, EntityID_Invalid), "Schema/Entities/EditorWidgetTranslate.xml");
m_Widget = importEntity(EntityWrapper(m_EditorWorld, EntityID_Invalid), "Schema/Entities/EditorWidgetTranslate.xml");
break;
case EditorGUI::WidgetMode::Rotate:
m_Widget = importEntity(EntityWrapper(m_World, EntityID_Invalid), "Schema/Entities/EditorWidgetRotate.xml");
m_Widget = importEntity(EntityWrapper(m_EditorWorld, EntityID_Invalid), "Schema/Entities/EditorWidgetRotate.xml");
break;
case EditorGUI::WidgetMode::Scale:
m_Widget = importEntity(EntityWrapper(m_World, EntityID_Invalid), "Schema/Entities/EditorWidgetScale.xml");
m_Widget = importEntity(EntityWrapper(m_EditorWorld, EntityID_Invalid), "Schema/Entities/EditorWidgetScale.xml");
break;
}
m_Widget["Transform"]["Position"] = Transform::AbsolutePosition(m_CurrentSelection.World, m_CurrentSelection.ID);
m_WidgetMode = mode;
}