Skip to content

Commit 7b2d3df

Browse files
committed
Add button in Items menu to select owner in entity tree
1 parent c596dc1 commit 7b2d3df

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Mods/Editor/Src/Components/Items.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,18 @@ void Editor::DrawItems(bool p_HasFocus) {
124124

125125
OnSelectEntity(s_Action->m_Object, true, std::nullopt);
126126
}
127+
128+
ImGui::BeginDisabled(!s_Item->m_pOwner);
129+
130+
if (ImGui::Button("Select Owner In Entity Tree")) {
131+
if (!m_CachedEntityTree || !m_CachedEntityTree->Entity) {
132+
UpdateEntities();
133+
}
134+
135+
OnSelectEntity(s_Item->m_pOwner, true, std::nullopt);
136+
}
137+
138+
ImGui::EndDisabled();
127139
}
128140

129141
if (ImGui::Button("Teleport Item To Player")) {

0 commit comments

Comments
 (0)