mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-23 06:35:33 -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) {
|
void DrawRandoEditor(bool& open) {
|
||||||
|
if (generated) {
|
||||||
|
generated = 0;
|
||||||
|
randoThread.join();
|
||||||
|
}
|
||||||
|
|
||||||
if (!open) {
|
if (!open) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2088,13 +2093,11 @@ void DrawRandoEditor(bool& open) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::Button("Generate")) {
|
if (ImGui::Button("Generate")) {
|
||||||
GenerateRandomizerImgui();
|
if (CVar_GetS32("gRandoGenerating", 0) == 0) {
|
||||||
|
randoThread = std::thread(&GenerateRandomizerImgui);
|
||||||
|
}
|
||||||
|
// GenerateRandomizerImgui();
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (generated) {
|
|
||||||
// generated = 0;
|
|
||||||
// randoThread.join();
|
|
||||||
// }
|
|
||||||
|
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue