1
0
mirror of synced 2024-11-12 18:20:52 +01:00

pattern: Fixed color overriding of struct members when struct has a color set already

Fixes #409
This commit is contained in:
WerWolv 2022-01-29 22:17:51 +01:00
parent 362413dbe7
commit bfa3538745
2 changed files with 9 additions and 5 deletions

View File

@ -1145,9 +1145,11 @@ namespace hex::pl {
void setColor(u32 color) override { void setColor(u32 color) override {
PatternData::setColor(color); PatternData::setColor(color);
for (auto &member : this->m_members) for (auto &member : this->m_members) {
if (!member->hasOverriddenColor())
member->setColor(color); member->setColor(color);
} }
}
void sort(ImGuiTableSortSpecs *sortSpecs, prv::Provider *provider) override { void sort(ImGuiTableSortSpecs *sortSpecs, prv::Provider *provider) override {
this->m_sortedMembers = this->m_members; this->m_sortedMembers = this->m_members;
@ -1291,9 +1293,11 @@ namespace hex::pl {
void setColor(u32 color) override { void setColor(u32 color) override {
PatternData::setColor(color); PatternData::setColor(color);
for (auto &member : this->m_members) for (auto &member : this->m_members) {
if (!member->hasOverriddenColor())
member->setColor(color); member->setColor(color);
} }
}
void sort(ImGuiTableSortSpecs *sortSpecs, prv::Provider *provider) override { void sort(ImGuiTableSortSpecs *sortSpecs, prv::Provider *provider) override {
this->m_sortedMembers = this->m_members; this->m_sortedMembers = this->m_members;

View File

@ -880,7 +880,7 @@ namespace hex::pl {
if (!isFunction) { if (!isFunction) {
auto type = parseType(); auto type = parseType();
if (MATCHES(sequence(IDENTIFIER, SEPARATOR_SQUAREBRACKETOPEN)) && sequence<Not>(SEPARATOR_SQUAREBRACKETOPEN)) if (MATCHES(sequence(IDENTIFIER, SEPARATOR_SQUAREBRACKETOPEN) && sequence<Not>(SEPARATOR_SQUAREBRACKETOPEN)))
member = parseMemberArrayVariable(type); member = parseMemberArrayVariable(type);
else if (MATCHES(sequence(IDENTIFIER))) else if (MATCHES(sequence(IDENTIFIER)))
member = parseMemberVariable(type); member = parseMemberVariable(type);