From 7beb1271ae0efcde3f8dae16aa4698bdb5fb0a4e Mon Sep 17 00:00:00 2001 From: tildearrow Date: Sat, 24 Jun 2023 18:55:55 -0500 Subject: [PATCH] GUI: add option to disable preset selector --- TODO.md | 1 - src/gui/gui.cpp | 19 ++++++++++++++++++- src/gui/gui.h | 2 ++ src/gui/settings.cpp | 11 +++++++++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index 3df1e22bf..20c54eb9a 100644 --- a/TODO.md +++ b/TODO.md @@ -3,7 +3,6 @@ - tutorial? - ease-of-use improvements... ideas: - preset compat flags - - setting to toggle the Choose a System screen on new project - maybe reduced set of presets for the sake of simplicity - a more preferable highlight/drag system - some speed/intuitive workflow improvements that go a long way diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 4edaeab23..eb8b9943c 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -5076,7 +5076,24 @@ bool FurnaceGUI::loop() { newSongQuery=""; newSongFirstFrame=true; displayNew=false; - ImGui::OpenPopup("New Song"); + if (settings.newSongBehavior==1) { + e->createNewFromDefaults(); + undoHist.clear(); + redoHist.clear(); + curFileName=""; + modified=false; + curNibble=false; + orderNibble=false; + orderCursor=-1; + samplePos=0; + updateSampleTex=true; + selStart=SelectionPoint(); + selEnd=SelectionPoint(); + cursor=SelectionPoint(); + updateWindowTitle(); + } else { + ImGui::OpenPopup("New Song"); + } } if (displayEditString) { diff --git a/src/gui/gui.h b/src/gui/gui.h index 77199a6cb..8eae6a531 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1508,6 +1508,7 @@ class FurnaceGUI { int renderClearPos; int insertBehavior; int pullDeleteRow; + int newSongBehavior; unsigned int maxUndoSteps; String mainFontPath; String patFontPath; @@ -1659,6 +1660,7 @@ class FurnaceGUI { renderClearPos(0), insertBehavior(1), pullDeleteRow(1), + newSongBehavior(0), maxUndoSteps(100), mainFontPath(""), patFontPath(""), diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index 33a6c5c6e..3da603169 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -508,6 +508,14 @@ void FurnaceGUI::drawSettings() { settings.alwaysPlayIntro=3; } + ImGui::Text("When creating new song:"); + if (ImGui::RadioButton("Display system preset selector##NSB0",settings.newSongBehavior==0)) { + settings.newSongBehavior=0; + } + if (ImGui::RadioButton("Start with initial system##NSB1",settings.newSongBehavior==1)) { + settings.newSongBehavior=1; + } + ImGui::Separator(); if (CWSliderFloat("Double-click time (seconds)",&settings.doubleClickTime,0.02,1.0,"%.2f")) { @@ -2757,6 +2765,7 @@ void FurnaceGUI::syncSettings() { settings.renderClearPos=e->getConfInt("renderClearPos",0); settings.insertBehavior=e->getConfInt("insertBehavior",1); settings.pullDeleteRow=e->getConfInt("pullDeleteRow",1); + settings.newSongBehavior=e->getConfInt("newSongBehavior",0); clampSetting(settings.mainFontSize,2,96); clampSetting(settings.patFontSize,2,96); @@ -2882,6 +2891,7 @@ void FurnaceGUI::syncSettings() { clampSetting(settings.renderClearPos,0,1); clampSetting(settings.insertBehavior,0,1); clampSetting(settings.pullDeleteRow,0,1); + clampSetting(settings.newSongBehavior,0,1); if (settings.exportLoops<0.0) settings.exportLoops=0.0; if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0; @@ -3103,6 +3113,7 @@ void FurnaceGUI::commitSettings() { e->setConf("renderClearPos",settings.renderClearPos); e->setConf("insertBehavior",settings.insertBehavior); e->setConf("pullDeleteRow",settings.pullDeleteRow); + e->setConf("newSongBehavior",settings.newSongBehavior); // colors for (int i=0; i