diff --git a/lib/libimhex/include/hex/pattern_language/pattern_data.hpp b/lib/libimhex/include/hex/pattern_language/pattern_data.hpp index 11f6ab60a..35372d5a6 100644 --- a/lib/libimhex/include/hex/pattern_language/pattern_data.hpp +++ b/lib/libimhex/include/hex/pattern_language/pattern_data.hpp @@ -1145,8 +1145,10 @@ namespace hex::pl { void setColor(u32 color) override { PatternData::setColor(color); - for (auto &member : this->m_members) - member->setColor(color); + for (auto &member : this->m_members) { + if (!member->hasOverriddenColor()) + member->setColor(color); + } } void sort(ImGuiTableSortSpecs *sortSpecs, prv::Provider *provider) override { @@ -1291,8 +1293,10 @@ namespace hex::pl { void setColor(u32 color) override { PatternData::setColor(color); - for (auto &member : this->m_members) - member->setColor(color); + for (auto &member : this->m_members) { + if (!member->hasOverriddenColor()) + member->setColor(color); + } } void sort(ImGuiTableSortSpecs *sortSpecs, prv::Provider *provider) override { diff --git a/lib/libimhex/source/pattern_language/parser.cpp b/lib/libimhex/source/pattern_language/parser.cpp index 0aec12b67..781fbb3a4 100644 --- a/lib/libimhex/source/pattern_language/parser.cpp +++ b/lib/libimhex/source/pattern_language/parser.cpp @@ -880,7 +880,7 @@ namespace hex::pl { if (!isFunction) { auto type = parseType(); - if (MATCHES(sequence(IDENTIFIER, SEPARATOR_SQUAREBRACKETOPEN)) && sequence(SEPARATOR_SQUAREBRACKETOPEN)) + if (MATCHES(sequence(IDENTIFIER, SEPARATOR_SQUAREBRACKETOPEN) && sequence(SEPARATOR_SQUAREBRACKETOPEN))) member = parseMemberArrayVariable(type); else if (MATCHES(sequence(IDENTIFIER))) member = parseMemberVariable(type);