GUI: add option to show ins type menu when adding

This commit is contained in:
tildearrow 2023-08-08 00:03:56 -05:00
parent 3af2f8d2a4
commit cc8b5d28a8
3 changed files with 18 additions and 0 deletions

View file

@ -609,6 +609,14 @@ void FurnaceGUI::doAction(int what) {
break; break;
case GUI_ACTION_INS_LIST_ADD: case GUI_ACTION_INS_LIST_ADD:
if (settings.insTypeMenu) {
makeInsTypeList=e->getPossibleInsTypes();
if (makeInsTypeList.size()>1) {
displayInsTypeList=true;
displayInsTypeListMakeInsSample=-1;
break;
}
}
curIns=e->addInstrument(cursor.xCoarse); curIns=e->addInstrument(cursor.xCoarse);
if (curIns==-1) { if (curIns==-1) {
showError("too many instruments!"); showError("too many instruments!");

View file

@ -1548,6 +1548,7 @@ class FurnaceGUI {
int removeInsOff; int removeInsOff;
int removeVolOff; int removeVolOff;
int playOnLoad; int playOnLoad;
int insTypeMenu;
unsigned int maxUndoSteps; unsigned int maxUndoSteps;
String mainFontPath; String mainFontPath;
String headFontPath; String headFontPath;
@ -1710,6 +1711,7 @@ class FurnaceGUI {
removeInsOff(0), removeInsOff(0),
removeVolOff(0), removeVolOff(0),
playOnLoad(0), playOnLoad(0),
insTypeMenu(1),
maxUndoSteps(100), maxUndoSteps(100),
mainFontPath(""), mainFontPath(""),
headFontPath(""), headFontPath(""),

View file

@ -2282,6 +2282,11 @@ void FurnaceGUI::drawSettings() {
settings.insEditColorize=insEditColorizeB; settings.insEditColorize=insEditColorizeB;
} }
bool insTypeMenuB=settings.insTypeMenu;
if (ImGui::Checkbox("Display instrument type menu when adding instrument",&insTypeMenuB)) {
settings.insTypeMenu=insTypeMenuB;
}
// SUBSECTION MACRO EDITOR // SUBSECTION MACRO EDITOR
CONFIG_SUBSECTION("Macro Editor"); CONFIG_SUBSECTION("Macro Editor");
ImGui::Text("Macro editor layout:"); ImGui::Text("Macro editor layout:");
@ -3018,6 +3023,7 @@ void FurnaceGUI::syncSettings() {
settings.removeInsOff=e->getConfInt("removeInsOff",0); settings.removeInsOff=e->getConfInt("removeInsOff",0);
settings.removeVolOff=e->getConfInt("removeVolOff",0); settings.removeVolOff=e->getConfInt("removeVolOff",0);
settings.playOnLoad=e->getConfInt("playOnLoad",0); settings.playOnLoad=e->getConfInt("playOnLoad",0);
settings.insTypeMenu=e->getConfInt("insTypeMenu",1);
clampSetting(settings.mainFontSize,2,96); clampSetting(settings.mainFontSize,2,96);
clampSetting(settings.headFontSize,2,96); clampSetting(settings.headFontSize,2,96);
@ -3152,6 +3158,7 @@ void FurnaceGUI::syncSettings() {
clampSetting(settings.removeInsOff,0,1); clampSetting(settings.removeInsOff,0,1);
clampSetting(settings.removeVolOff,0,1); clampSetting(settings.removeVolOff,0,1);
clampSetting(settings.playOnLoad,0,2); clampSetting(settings.playOnLoad,0,2);
clampSetting(settings.insTypeMenu,0,1);
if (settings.exportLoops<0.0) settings.exportLoops=0.0; if (settings.exportLoops<0.0) settings.exportLoops=0.0;
if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0; if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0;
@ -3386,6 +3393,7 @@ void FurnaceGUI::commitSettings() {
e->setConf("removeInsOff",settings.removeInsOff); e->setConf("removeInsOff",settings.removeInsOff);
e->setConf("removeVolOff",settings.removeVolOff); e->setConf("removeVolOff",settings.removeVolOff);
e->setConf("playOnLoad",settings.playOnLoad); e->setConf("playOnLoad",settings.playOnLoad);
e->setConf("insTypeMenu",settings.insTypeMenu);
// colors // colors
for (int i=0; i<GUI_COLOR_MAX; i++) { for (int i=0; i<GUI_COLOR_MAX; i++) {