1
0
mirror of synced 2025-02-20 12:11:04 +01:00

patterns: Updated pattern language

This commit is contained in:
WerWolv 2023-05-13 15:43:37 +02:00
parent aa1bf0b764
commit 6709baa710
2 changed files with 9 additions and 7 deletions

@ -1 +1 @@
Subproject commit 9f868f9a362c9c4f64b8f85440033364e001b12d
Subproject commit b0980f39494de14cb3ee4acbf7d8b83eb5009c12

View File

@ -35,15 +35,17 @@ namespace hex::plugin::builtin {
if (ImGui::Begin(View::toWindowName("hex.builtin.view.pattern_data.name").c_str(), &this->getWindowOpenState(), ImGuiWindowFlags_NoCollapse)) {
if (ImHexApi::Provider::isValid()) {
auto &runtime = ContentRegistry::PatternLanguage::getRuntime();
if (TRY_LOCK(ContentRegistry::PatternLanguage::getRuntimeLock()) || !runtime.arePatternsValid()) {
if (!runtime.arePatternsValid()) {
this->m_patternDrawer.draw({});
} else {
if (this->m_shouldReset) {
this->m_patternDrawer.reset();
this->m_shouldReset = false;
}
if (TRY_LOCK(ContentRegistry::PatternLanguage::getRuntimeLock())) {
if (this->m_shouldReset) {
this->m_patternDrawer.reset();
this->m_shouldReset = false;
}
this->m_patternDrawer.draw(runtime.getPatterns());
this->m_patternDrawer.draw(runtime.getPatterns());
}
}
}
}