1
0
mirror of synced 2024-11-28 17:40:51 +01:00

patterns: Updated pattern language

This commit is contained in:
WerWolv 2022-08-18 23:51:50 +02:00
parent 6a88c7cbaa
commit 491ee6aa2f
3 changed files with 4 additions and 4 deletions

@ -1 +1 @@
Subproject commit 4e9492ee72a7d518de3bcad6308ea4e53148a365 Subproject commit ed11c37fdfa6b6b0dcb90614bf88dbe49ece191f

View File

@ -741,12 +741,12 @@ namespace hex::plugin::builtin {
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::TextFormatted("{}", pattern->getEndian() == std::endian::little ? "hex.builtin.common.little"_lang : "hex.builtin.common.big"_lang); ImGui::TextFormatted("{}", pattern->getEndian() == std::endian::little ? "hex.builtin.common.little"_lang : "hex.builtin.common.big"_lang);
if (const auto &comment = pattern->getComment(); comment.has_value()) { if (const auto &comment = pattern->getComment(); comment != nullptr) {
ImGui::TableNextRow(); ImGui::TableNextRow();
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::TextFormatted("{}: ", "hex.builtin.common.comment"_lang); ImGui::TextFormatted("{}: ", "hex.builtin.common.comment"_lang);
ImGui::TableNextColumn(); ImGui::TableNextColumn();
ImGui::TextWrapped("\"%s\"", pattern->getComment()->c_str()); ImGui::TextWrapped("\"%s\"", comment->c_str());
} }
ImGui::EndTable(); ImGui::EndTable();

View File

@ -277,7 +277,7 @@ namespace hex {
void PatternDrawer::drawCommentTooltip(const pl::ptrn::Pattern &pattern) const { void PatternDrawer::drawCommentTooltip(const pl::ptrn::Pattern &pattern) const {
if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem) && pattern.getComment().has_value()) { if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem) && pattern.getComment() != nullptr) {
ImGui::BeginTooltip(); ImGui::BeginTooltip();
ImGui::TextUnformatted(pattern.getComment()->c_str()); ImGui::TextUnformatted(pattern.getComment()->c_str());
ImGui::EndTooltip(); ImGui::EndTooltip();