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

View File

@@ -741,12 +741,12 @@ namespace hex::plugin::builtin {
ImGui::TableNextColumn();
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::TableNextColumn();
ImGui::TextFormatted("{}: ", "hex.builtin.common.comment"_lang);
ImGui::TableNextColumn();
ImGui::TextWrapped("\"%s\"", pattern->getComment()->c_str());
ImGui::TextWrapped("\"%s\"", comment->c_str());
}
ImGui::EndTable();

View File

@@ -277,7 +277,7 @@ namespace hex {
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::TextUnformatted(pattern.getComment()->c_str());
ImGui::EndTooltip();