feat: Added full pattern path to hex editor hover tooltip
This commit is contained in:
parent
8a289d2e4f
commit
3049590b68
@ -1470,11 +1470,38 @@ namespace hex::plugin::builtin {
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGuiExt::TextFormatted("{} ", "Path");
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
std::string path;
|
||||
{
|
||||
std::vector<std::string> pathSegments;
|
||||
const pl::ptrn::Pattern *entry = pattern;
|
||||
while (entry != nullptr) {
|
||||
pathSegments.push_back(entry->getVariableName());
|
||||
entry = entry->getParent();
|
||||
}
|
||||
|
||||
for (const auto &segment : pathSegments | std::views::reverse) {
|
||||
if (!segment.starts_with('['))
|
||||
path += '.';
|
||||
|
||||
path += segment;
|
||||
}
|
||||
|
||||
if (path.starts_with('.'))
|
||||
path = path.substr(1);
|
||||
}
|
||||
|
||||
ImGuiExt::TextFormatted(" {}", path);
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGuiExt::TextFormatted("{} ", "hex.ui.common.type"_lang);
|
||||
ImGui::TableNextColumn();
|
||||
ImGuiExt::TextFormatted(" {}", pattern->getTypeName());
|
||||
ImGuiExt::TextFormatted(" {}", pattern->getFormattedName());
|
||||
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
|
Loading…
Reference in New Issue
Block a user