Compare commits
1 Commits
37958449a2
...
11e8d343af
| Author | SHA256 | Date | |
|---|---|---|---|
| 11e8d343af |
@@ -34,6 +34,10 @@ namespace TSE
|
|||||||
objectEntries[id] = this;
|
objectEntries[id] = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Transformable::~Transformable()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
Vector3 Transformable::forward() const
|
Vector3 Transformable::forward() const
|
||||||
{
|
{
|
||||||
return Vector3::Normalize(GetGlobalMatrix() * Vector3::forward - GetGlobalMatrix() * Vector3::zero);
|
return Vector3::Normalize(GetGlobalMatrix() * Vector3::forward - GetGlobalMatrix() * Vector3::zero);
|
||||||
@@ -368,12 +372,15 @@ namespace TSE
|
|||||||
if(!onlyThis)
|
if(!onlyThis)
|
||||||
for(auto child : t->children)
|
for(auto child : t->children)
|
||||||
{
|
{
|
||||||
HardDelete(child);
|
HardDelete(child, onlyThis);
|
||||||
}
|
}
|
||||||
|
|
||||||
//deleting atteched scripts
|
//deleting atteched scripts
|
||||||
for (auto& [_, script] : t->components)
|
for (auto& [_, script] : t->components)
|
||||||
|
{
|
||||||
delete script;
|
delete script;
|
||||||
|
}
|
||||||
|
t->components.clear();
|
||||||
|
|
||||||
//deleting self
|
//deleting self
|
||||||
Delete(t);
|
Delete(t);
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace TSE
|
|||||||
Transformable(uuids::uuid id);
|
Transformable(uuids::uuid id);
|
||||||
Transformable(const string& name);
|
Transformable(const string& name);
|
||||||
Transformable(const string& name, uuids::uuid id);
|
Transformable(const string& name, uuids::uuid id);
|
||||||
~Transformable() = default;
|
~Transformable();
|
||||||
|
|
||||||
Vector3 forward() const;
|
Vector3 forward() const;
|
||||||
Vector3 right() const;
|
Vector3 right() const;
|
||||||
|
|||||||
@@ -123,6 +123,8 @@ void TSE::EDITOR::HirearchieView::MenuBar()
|
|||||||
ImGui::EndMenuBar();
|
ImGui::EndMenuBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool selectedFound = false;
|
||||||
|
|
||||||
void TSE::EDITOR::HirearchieView::DisplayLayer(Layer *l)
|
void TSE::EDITOR::HirearchieView::DisplayLayer(Layer *l)
|
||||||
{
|
{
|
||||||
ImGui::Indent(20.0f);
|
ImGui::Indent(20.0f);
|
||||||
@@ -180,10 +182,15 @@ void TSE::EDITOR::HirearchieView::DisplayLayer(Layer *l)
|
|||||||
}
|
}
|
||||||
if(collapseOpen)
|
if(collapseOpen)
|
||||||
{
|
{
|
||||||
|
selectedFound = false;
|
||||||
for(int i = 0; i < l->GetAllObjects().size(); i++)
|
for(int i = 0; i < l->GetAllObjects().size(); i++)
|
||||||
{
|
{
|
||||||
DisplayObj(l->GetAllObjects()[i], l);
|
DisplayObj(l->GetAllObjects()[i], l);
|
||||||
}
|
}
|
||||||
|
if(!selectedFound && PropertiesView::GetCurrentInspectableType() == InspectableType::Transformable)
|
||||||
|
{
|
||||||
|
PropertiesView::ForceClearInspectorElement();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ImGui::Unindent(20.0f);
|
ImGui::Unindent(20.0f);
|
||||||
}
|
}
|
||||||
@@ -198,8 +205,10 @@ void TSE::EDITOR::HirearchieView::DisplayObj(Transformable *t, Layer *l)
|
|||||||
if(selected == t->id)
|
if(selected == t->id)
|
||||||
{
|
{
|
||||||
flags |= ImGuiTreeNodeFlags_Selected;
|
flags |= ImGuiTreeNodeFlags_Selected;
|
||||||
|
selectedFound = true;
|
||||||
}
|
}
|
||||||
bool open = ImGui::TreeNodeEx((t->GetName() + "##" + to_string(t->id)).c_str(), flags);
|
string name = t->GetName() + "##" + to_string(t->id);
|
||||||
|
bool open = ImGui::TreeNodeEx((name).c_str(), flags);
|
||||||
if(ImGui::BeginPopupContextItem())
|
if(ImGui::BeginPopupContextItem())
|
||||||
{
|
{
|
||||||
bool disabled = false;
|
bool disabled = false;
|
||||||
|
|||||||
@@ -30,6 +30,11 @@ void TSE::EDITOR::PropertiesView::MenuBar()
|
|||||||
ImGui::EndMenuBar();
|
ImGui::EndMenuBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TSE::EDITOR::InspectableType TSE::EDITOR::PropertiesView::GetCurrentInspectableType()
|
||||||
|
{
|
||||||
|
return currentlyInspecting.type;
|
||||||
|
}
|
||||||
|
|
||||||
void TSE::EDITOR::PropertiesView::SetInspectorElement(InspectableType type, void *element)
|
void TSE::EDITOR::PropertiesView::SetInspectorElement(InspectableType type, void *element)
|
||||||
{
|
{
|
||||||
if(!locked)
|
if(!locked)
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ namespace TSE::EDITOR
|
|||||||
|
|
||||||
void Define() override;
|
void Define() override;
|
||||||
void MenuBar();
|
void MenuBar();
|
||||||
|
static InspectableType GetCurrentInspectableType();
|
||||||
static void SetInspectorElement(InspectableType type, void* element);
|
static void SetInspectorElement(InspectableType type, void* element);
|
||||||
static void ClearInspectorElement();
|
static void ClearInspectorElement();
|
||||||
static void ForceClearInspectorElement();
|
static void ForceClearInspectorElement();
|
||||||
|
|||||||
Reference in New Issue
Block a user