diff --git a/src/gui/gui.h b/src/gui/gui.h index d54635fa3..17f12671e 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -2549,6 +2549,8 @@ class FurnaceGUI { void waveListItem(int index, float* wavePreview, int dir, int asset); void sampleListItem(int index, int dir, int asset); + void drawSysDefs(std::vector& category, bool& accepted); + void toggleMobileUI(bool enable, bool force=false); void pushToggleColors(bool status); diff --git a/src/gui/newSong.cpp b/src/gui/newSong.cpp index a22f5d444..e2eeecb90 100644 --- a/src/gui/newSong.cpp +++ b/src/gui/newSong.cpp @@ -22,6 +22,52 @@ #include #include +void FurnaceGUI::drawSysDefs(std::vector& category, bool& accepted) { + for (FurnaceGUISysDef& i: category) { + ImGui::TableNextRow(); + ImGui::TableNextColumn(); + if (!i.subDefs.empty()) { + if (ImGui::TreeNode("##TreeShit")) { + drawSysDefs(i.subDefs,accepted); + ImGui::TreePop(); + } + ImGui::SameLine(); + } + if (ImGui::Selectable(i.name,false,ImGuiSelectableFlags_DontClosePopups)) { + nextDesc=i.definition; + nextDescName=i.name; + accepted=true; + } + if (ImGui::IsItemHovered()) { + if (ImGui::BeginTooltip()) { + std::map chipCounts; + std::vector chips; + for (FurnaceGUISysDefChip chip: i.orig) { + if (chipCounts.find(chip.sys)==chipCounts.end()) { + chipCounts[chip.sys]=1; + chips.push_back(chip.sys); + } else { + chipCounts[chip.sys]+=1; + } + } + for (size_t chipIndex=0; chipIndexgetSystemDef(chip); + ImGui::PushTextWrapPos(MIN(scrW*dpiScale,400.0f*dpiScale)); + ImGui::Text("%s (x%d): ",sysDef->name,chipCounts[chip]); + ImGui::Text("%s",sysDef->description); + ImGui::PopTextWrapPos(); + if (chipIndex+1& category=(newSongQuery.empty())?(sysCategories[newSongCategory].systems):(newSongSearchResults); - for (FurnaceGUISysDef& i: category) { - ImGui::TableNextRow(); - ImGui::TableNextColumn(); - if (ImGui::Selectable(i.name,false,ImGuiSelectableFlags_DontClosePopups)) { - nextDesc=i.definition; - nextDescName=i.name; - accepted=true; - } - if (ImGui::IsItemHovered()) { - if (ImGui::BeginTooltip()) { - std::map chipCounts; - std::vector chips; - for (FurnaceGUISysDefChip chip: i.orig) { - if (chipCounts.find(chip.sys)==chipCounts.end()) { - chipCounts[chip.sys]=1; - chips.push_back(chip.sys); - } else { - chipCounts[chip.sys]+=1; - } - } - for (size_t chipIndex=0; chipIndexgetSystemDef(chip); - ImGui::PushTextWrapPos(MIN(scrW*dpiScale,400.0f*dpiScale)); - ImGui::Text("%s (x%d): ",sysDef->name,chipCounts[chip]); - ImGui::Text("%s",sysDef->description); - ImGui::PopTextWrapPos(); - if (chipIndex+1