Skip to content

Commit 99a691b

Browse files
committed
CourseEdit: fix imgui warning, disable randomizer when editing is unavailable
Thanks to Zoukambada for reporting it
1 parent 239f5c3 commit 99a691b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/overlay/course_editor.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,10 @@ void Overlay_CourseEditor()
425425
CloseClipboard();
426426
}
427427
}
428+
429+
if (editor_disabled)
430+
ImGui::EndDisabled();
431+
428432
ImGui::TreePop();
429433
}
430434

@@ -446,6 +450,9 @@ void Overlay_CourseEditor()
446450
ImGui::Checkbox("OutRun2SP Reverse (15 tracks)", &or2sp_reverse);
447451
ImGui::Checkbox("Allow Duplicates", &allow_duplicates);
448452

453+
if (editor_disabled)
454+
ImGui::BeginDisabled();
455+
449456
if (ImGui::Button("Randomize"))
450457
{
451458
std::vector<GameStage> chosen;
@@ -488,13 +495,15 @@ void Overlay_CourseEditor()
488495
has_updated = true;
489496
}
490497
}
498+
499+
if (editor_disabled)
500+
ImGui::EndDisabled();
501+
491502
ImGui::TreePop();
492503
}
493504

494505
if (editor_disabled)
495506
{
496-
ImGui::EndDisabled();
497-
498507
if (Overlay::CourseReplacementEnabled && Game::is_in_game() && Game::pl_car()->is_in_bunki())
499508
ImGui::Text("(disabled during bunki)");
500509
}

0 commit comments

Comments
 (0)