From afed13001a7c5a8a202627e80e49a11e2e651c93 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Wed, 20 Mar 2024 18:20:12 -0500 Subject: [PATCH] GUI: prepare for user presets --- src/gui/newSong.cpp | 17 ++++++++++++++--- src/gui/presets.cpp | 2 ++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/gui/newSong.cpp b/src/gui/newSong.cpp index 21e60166e..08b30d7ae 100644 --- a/src/gui/newSong.cpp +++ b/src/gui/newSong.cpp @@ -169,6 +169,7 @@ void FurnaceGUI::drawNewSong() { if (ImGui::IsItemHovered()) { ImGui::SetTooltip("%s",i.description); } + if (strcmp(i.name,"User")==0) ImGui::Separator(); index++; } } @@ -177,9 +178,19 @@ void FurnaceGUI::drawNewSong() { ImGui::TableNextColumn(); if (ImGui::BeginTable("Systems",1,ImGuiTableFlags_BordersInnerV|ImGuiTableFlags_ScrollY)) { std::vector& category=(newSongQuery.empty())?(sysCategories[newSongCategory].systems):(newSongSearchResults); - sysDefStack.push_back(newSongQuery.empty()?newSongCategory:-1); - drawSysDefs(category,accepted,sysDefStack); - sysDefStack.erase(sysDefStack.end()-1); + if (category.empty()) { + ImGui::TableNextRow(); + ImGui::TableNextColumn(); + if (newSongQuery.empty()) { + ImGui::Text("no systems here yet!"); + } else { + ImGui::Text("no results"); + } + } else { + sysDefStack.push_back(newSongQuery.empty()?newSongCategory:-1); + drawSysDefs(category,accepted,sysDefStack); + sysDefStack.erase(sysDefStack.end()-1); + } ImGui::EndTable(); } diff --git a/src/gui/presets.cpp b/src/gui/presets.cpp index c93781e86..c5c237e51 100644 --- a/src/gui/presets.cpp +++ b/src/gui/presets.cpp @@ -2428,6 +2428,8 @@ void FurnaceGUI::initSystemPresets() { ); CATEGORY_END; + CATEGORY_BEGIN("User","system presets that you have saved."); + CATEGORY_END; CATEGORY_BEGIN("FM","chips which use frequency modulation (FM) to generate sound.\nsome of these also pack more (like square and sample channels)."); ENTRY(