Moved debug level selector to a cvar

This commit is contained in:
KiritoDv
2023-10-08 00:16:03 -06:00
parent d1928be97d
commit ebc18605c0
4 changed files with 44 additions and 3 deletions
+2 -1
View File
@@ -63,11 +63,12 @@ extern struct SPTask *gActiveSPTask;
extern u32 gNumVblanks;
extern s8 gResetTimer;
extern s8 gNmiResetBarsTimer;
extern s8 gDebugLevelSelect;
extern s8 D_8032C650;
extern s8 gShowProfiler;
extern s8 gShowDebugText;
#define gDebugLevelSelect (CVarGetInteger("gEnableDebugMode", 0) == 1)
void exec_display_list(struct SPTask *spTask);
#endif // MAIN_H
+1 -1
View File
@@ -143,7 +143,7 @@ s16 intro_level_select(void) {
// ... the level select quit combo is being pressed, which uses START. If this
// is the case, quit the menu instead.
if (gPlayer1Controller->buttonDown == QUIT_LEVEL_SELECT_COMBO) {
gDebugLevelSelect = FALSE;
// CVarSetInteger("gEnableDebugMode", 0);
return -1;
}
play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource);
-1
View File
@@ -15,7 +15,6 @@ u64 osClockRate = 62500000;
s8 gShowProfiler = FALSE;
s8 gShowDebugText = FALSE;
s8 gDebugLevelSelect = FALSE;
OSIoMesg gDmaIoMesg;
OSMesg gMainReceivedMesg;
+41
View File
@@ -305,6 +305,44 @@ void DrawEnhancementsMenu() {
}
}
void DrawDebugMenu() {
if (ImGui::BeginMenu("Developer")) {
UIWidgets::PaddedEnhancementCheckbox("Enable level selector", "gEnableDebugMode", true, false);
UIWidgets::Tooltip("Enable the level selector in the main menu");
UIWidgets::Spacer(0);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(12.0f, 6.0f));
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0, 0));
ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f);
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.22f, 0.38f, 0.56f, 1.0f));
if (GameUI::mStatsWindow) {
if (ImGui::Button(
GameUI::GetWindowButtonText("Stats", CVarGetInteger("gStatsEnabled", 0)).c_str(),
ImVec2(-1.0f, 0.0f))) {
GameUI::mStatsWindow->ToggleVisibility();
}
UIWidgets::Tooltip("Shows the stats window, with your FPS and frametimes, and the OS "
"you're playing on");
}
if (GameUI::mConsoleWindow) {
if (ImGui::Button(
GameUI::GetWindowButtonText("Console", CVarGetInteger("gConsoleEnabled", 0))
.c_str(),
ImVec2(-1.0f, 0.0f))) {
GameUI::mConsoleWindow->ToggleVisibility();
}
UIWidgets::Tooltip("Enables the console window, allowing you to input commands, type "
"help for some examples");
}
ImGui::PopStyleVar(3);
ImGui::PopStyleColor(1);
ImGui::EndMenu();
}
}
void GameMenuBar::DrawElement() {
if(ImGui::BeginMenuBar()){
DrawMenuBarIcon();
@@ -323,6 +361,9 @@ void GameMenuBar::DrawElement() {
DrawEnhancementsMenu();
ImGui::SetCursorPosY(0.0f);
DrawDebugMenu();
ImGui::PopStyleVar(1);
ImGui::EndMenuBar();
}