Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions Mods/Editor/Src/Components/EntityTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,21 +679,17 @@ void Editor::DrawEntityTree() {
ICON_MD_SEARCH " Search by type##EntityTypesPopup",
s_EntityTypeSearchInput,
sizeof(s_EntityTypeSearchInput),
(*Globals::TypeRegistry)->m_types,
[](auto& p_Pair) -> std::string {
return std::string(p_Pair.first.c_str(), p_Pair.first.size());
m_ClassNames,
[](const std::string& p_ClassName) -> const std::string& {
return p_ClassName;
},
[](auto& p_Pair) -> std::string {
return std::string(p_Pair.first.c_str(), p_Pair.first.size());
[](const std::string& p_ClassName) -> const std::string& {
return p_ClassName;
},
[&](const std::string& typeName, const std::string&, const auto&) {
[&](const std::string&, const std::string&, const auto&) {
m_EntityTypeSearchInput = s_EntityTypeSearchInput;

FilterEntityTree();
},
nullptr,
[](auto& p_Pair) {
return p_Pair.second->GetTypeInfo() && p_Pair.second->GetTypeInfo()->IsClass();
}
);

Expand Down
19 changes: 19 additions & 0 deletions Mods/Editor/Src/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,25 @@ void Editor::OnEngineInitialized() {
}
}
}

for (const auto& [s_TypeName, s_TypeID] : (*Globals::TypeRegistry)->m_types) {
if (s_TypeID->GetTypeInfo()->IsClass()) {
m_ClassNames.push_back(std::string(s_TypeName.c_str(), s_TypeName.size()));
}
}

std::sort(
m_ClassNames.begin(),
m_ClassNames.end(),
[](const std::string& a, const std::string& b) {
return std::lexicographical_compare(
a.begin(), a.end(),
b.begin(), b.end(),
[](char ac, char bc) {
return std::tolower(ac) < std::tolower(bc);
});
}
);
}

bool Editor::ImGuiCopyWidget(const std::string& p_Id) {
Expand Down
2 changes: 2 additions & 0 deletions Mods/Editor/Src/Editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,8 @@ class Editor : public IPluginInterface {
void* m_InputPinData = nullptr;
STypeID* m_OutputPinTypeID = nullptr;
void* m_OutputPinData = nullptr;

std::vector<std::string> m_ClassNames;
};

DECLARE_ZHM_PLUGIN(Editor)