1
0
mirror of synced 2024-09-25 12:08:26 +02:00

patterns: Fixed static arrays showing same value for all entries

This commit is contained in:
WerWolv 2022-03-17 23:29:52 +01:00
parent 2d87d29fa0
commit a17b647e79
2 changed files with 5 additions and 0 deletions

View File

@ -240,6 +240,10 @@ namespace hex::pl {
return this->m_cachedDisplayValue.value();
}
void clearFormatCache() {
this->m_cachedDisplayValue.reset();
}
protected:
void createDefaultEntry(const std::string &value, Token::Literal &&literal) const {
ImGui::TableNextRow();

View File

@ -55,6 +55,7 @@ namespace hex::pl {
if (open) {
auto entry = this->m_template->clone();
for (u64 index = 0; index < this->m_entryCount; index++) {
entry->clearFormatCache();
entry->setVariableName(hex::format("[{0}]", index));
entry->setOffset(this->getOffset() + index * this->m_template->getSize());
entry->draw(provider);