Skip to content

Commit

Permalink
Merge pull request #2 from Eiyeron/debug_crash_quickfix
Browse files Browse the repository at this point in the history
Prevent launching debug jobs if no rule was found.
  • Loading branch information
jlaumon authored Jun 26, 2024
2 parents f4f0cbf + a895451 commit 51fa35f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/UI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,8 @@ void gDrawDebugWindow()
return;
}

bool no_command_found = gCookingSystem.mCommands.Size() == 0;
ImGui::BeginDisabled(no_command_found);
if (ImGui::Button("Cook 100"))
{
int num_commands = gCookingSystem.mCommands.Size();
Expand All @@ -1147,6 +1149,13 @@ void gDrawDebugWindow()
gCookingSystem.ForceCook(gCookingSystem.mCommands[i].mID);
}
}
if (no_command_found)
{
ImGui::SameLine();
ImGui::AlignTextToFramePadding();
ImGui::Text("No commands found");
}
ImGui::EndDisabled();

ImGui::Checkbox("Slow mode", &gCookingSystem.mSlowMode);
ImGui::Checkbox("Cause random Cooking errors", &gDebugFailCookingRandomly);
Expand Down

0 comments on commit 51fa35f

Please sign in to comment.