mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-22 22:33:43 -07:00
move it to a thread
This commit is contained in:
parent
79e4200ddf
commit
f07ad0c117
1 changed files with 9 additions and 6 deletions
|
@ -2071,6 +2071,11 @@ void GenerateRandomizerImgui() {
|
|||
}
|
||||
|
||||
void DrawRandoEditor(bool& open) {
|
||||
if (generated) {
|
||||
generated = 0;
|
||||
randoThread.join();
|
||||
}
|
||||
|
||||
if (!open) {
|
||||
return;
|
||||
}
|
||||
|
@ -2088,14 +2093,12 @@ 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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue