From 59a25fad7039df03c3b19d87ada69f94a934c1f7 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sat, 30 Mar 2024 13:21:56 -0500 Subject: [PATCH] stuff --- src/gui/gui.cpp | 3 ++- src/gui/gui.h | 3 +++ src/gui/presets.cpp | 20 +++++++++++++++++--- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 75d660366..f61de8b4c 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -7841,7 +7841,8 @@ FurnaceGUI::FurnaceGUI(): curTutorialStep(0), audioExportType(0), dmfExportVersion(0), - curExportType(GUI_EXPORT_NONE) { + curExportType(GUI_EXPORT_NONE), + selectedUserPreset(-1) { // value keys valueKeys[SDLK_0]=0; valueKeys[SDLK_1]=1; diff --git a/src/gui/gui.h b/src/gui/gui.h index 5c39105df..43eedc9e8 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -2476,6 +2476,9 @@ class FurnaceGUI { int dmfExportVersion; FurnaceGUIExportTypes curExportType; + // user presets window + int selectedUserPreset; + void drawExportAudio(bool onWindow=false); void drawExportVGM(bool onWindow=false); void drawExportZSM(bool onWindow=false); diff --git a/src/gui/presets.cpp b/src/gui/presets.cpp index c114c26ea..a0bda5b73 100644 --- a/src/gui/presets.cpp +++ b/src/gui/presets.cpp @@ -3404,12 +3404,26 @@ void FurnaceGUI::drawUserPresets() { } if (!userPresetsOpen) return; if (ImGui::Begin("User Presets",&userPresetsOpen,globalWinFlags)) { - if (ImGui::BeginTable("UserPresets",2,ImGuiTableFlags_BordersInnerV)) { + FurnaceGUISysCategory* userCategory=NULL; + for (FurnaceGUISysCategory& i: sysCategories) { + if (strcmp(i.name,"User")==0) { + userCategory=&i; + break; + } + } + + if (userCategory==NULL) { + ImGui::Text("Error! User category does not exist!"); + } else if (ImGui::BeginTable("UserPresets",2,ImGuiTableFlags_BordersInnerV)) { ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGui::Text("Presets..."); ImGui::TableNextColumn(); - ImGui::Text("Edit..."); + if (selectedUserPreset<0 || selectedUserPreset>=(int)userCategory->systems.size()) { + ImGui::Text("select a preset"); + } else { + ImGui::Text("Edit..."); + } ImGui::EndTable(); } @@ -3423,4 +3437,4 @@ void FurnaceGUI::drawUserPresets() { } if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_USER_PRESETS; ImGui::End(); -} \ No newline at end of file +}