patterns: Limit max number of patterns

Can be overriden with the pattern_limit pragma
Further improves situation with #313
This commit is contained in:
WerWolv
2021-10-02 15:22:38 +02:00
parent aef959854f
commit 12a8cadcfe
7 changed files with 204 additions and 75 deletions

View File

@@ -259,12 +259,23 @@ namespace hex {
ImGui::SameLine();
if (this->m_evaluatorRunning)
ImGui::TextSpinner("hex.view.pattern.evaluating"_lang);
else
else {
if (ImGui::Checkbox("hex.view.pattern.auto"_lang, &this->m_runAutomatically)) {
if (this->m_runAutomatically)
this->m_hasUnevaluatedChanges = true;
}
ImGui::SameLine();
ImGui::SeparatorEx(ImGuiSeparatorFlags_Vertical);
ImGui::SameLine();
ImGui::TextUnformatted(hex::format("{} / {}",
this->m_patternLanguageRuntime->getCreatedPatternCount(),
this->m_patternLanguageRuntime->getMaximumPatternCount()
).c_str()
);
}
if (this->m_textEditor.IsTextChanged()) {
ProjectFile::markDirty();