move it to a thread

This commit is contained in:
briaguya 2022-06-03 02:55:45 -04:00
commit f07ad0c117

View file

@ -2071,6 +2071,11 @@ void GenerateRandomizerImgui() {
}
void DrawRandoEditor(bool& open) {
if (generated) {
generated = 0;
randoThread.join();
}
if (!open) {
return;
}
@ -2088,13 +2093,11 @@ void DrawRandoEditor(bool& open) {
}
if (ImGui::Button("Generate")) {
GenerateRandomizerImgui();
if (CVar_GetS32("gRandoGenerating", 0) == 0) {
randoThread = std::thread(&GenerateRandomizerImgui);
}
// GenerateRandomizerImgui();
}
// if (generated) {
// generated = 0;
// randoThread.join();
// }
ImGui::End();
}