ui: Run pattern language runtime asynchronously, added compile button

This commit is contained in:
WerWolv
2021-02-20 22:38:31 +01:00
parent 305b4d0ac0
commit 9b9c040d2d
4 changed files with 56 additions and 14 deletions

View File

@@ -12,4 +12,5 @@ namespace ImGui {
void UnderlinedText(const char* label, ImColor color, const ImVec2& size_arg = ImVec2(0, 0));
void Disabled(std::function<void()> widgets, bool disabled);
}

View File

@@ -141,4 +141,16 @@ namespace ImGui {
PopStyleColor();
}
void Disabled(std::function<void()> widgets, bool disabled) {
if (disabled) {
ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5F);
widgets();
ImGui::PopStyleVar();
ImGui::PopItemFlag();
} else {
widgets();
}
}
}