From e414056f2d82e355c68c7a20976e7dc2572b3284 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sun, 24 Apr 2022 16:57:58 -0500 Subject: [PATCH] prepare for a clear option --- src/gui/gui.cpp | 31 +++++++++++++++++++++++++++++-- src/gui/gui.h | 1 + 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index e87c1e8ea..1a9e537c3 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -2711,8 +2711,10 @@ bool FurnaceGUI::loop() { if (ImGui::MenuItem("redo",BIND_FOR(GUI_ACTION_REDO))) doRedo(); ImGui::Separator(); editOptions(true); - /*ImGui::Separator(); - ImGui::MenuItem("clear...");*/ + ImGui::Separator(); + if (ImGui::MenuItem("clear...")) { + showWarning("Are you sure you want to clear...",GUI_WARN_CLEAR); + } ImGui::EndMenu(); } if (ImGui::BeginMenu("settings")) { @@ -3370,6 +3372,31 @@ bool FurnaceGUI::loop() { ImGui::CloseCurrentPopup(); } break; + case GUI_WARN_CLEAR: + if (ImGui::Button("Song (orders and patterns)")) { + ImGui::CloseCurrentPopup(); + } + ImGui::SameLine(); + if (ImGui::Button("Pattern")) { + ImGui::CloseCurrentPopup(); + } + ImGui::SameLine(); + if (ImGui::Button("Instruments")) { + ImGui::CloseCurrentPopup(); + } + ImGui::SameLine(); + if (ImGui::Button("Wavetables")) { + ImGui::CloseCurrentPopup(); + } + ImGui::SameLine(); + if (ImGui::Button("Samples")) { + ImGui::CloseCurrentPopup(); + } + + if (ImGui::Button("Wait! What am I doing?")) { + ImGui::CloseCurrentPopup(); + } + break; case GUI_WARN_GENERIC: if (ImGui::Button("OK")) { ImGui::CloseCurrentPopup(); diff --git a/src/gui/gui.h b/src/gui/gui.h index 6c50a914a..8c850fd06 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -264,6 +264,7 @@ enum FurnaceGUIWarnings { GUI_WARN_RESET_COLORS, GUI_WARN_RESET_KEYBINDS, GUI_WARN_CLOSE_SETTINGS, + GUI_WARN_CLEAR, GUI_WARN_GENERIC };