mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-15 17:25:06 +00:00
GUI: more improvements to instrument loading
now with an "instrument load always replace" option
This commit is contained in:
parent
99a313b684
commit
c3e55ae117
4 changed files with 12 additions and 4 deletions
|
@ -45,7 +45,7 @@ void FurnaceGUI::drawInsList() {
|
|||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_FOLDER_OPEN "##InsLoad")) {
|
||||
doAction(GUI_ACTION_INS_LIST_OPEN);
|
||||
doAction((settings.insLoadAlwaysReplace && curIns>=0 && curIns<=(int)e->song.ins.size())?GUI_ACTION_INS_LIST_OPEN_REPLACE:GUI_ACTION_INS_LIST_OPEN);
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button(ICON_FA_FLOPPY_O "##InsSave")) {
|
||||
|
|
|
@ -2930,9 +2930,7 @@ bool FurnaceGUI::loop() {
|
|||
if ((curFileDialog==GUI_FILE_INS_OPEN || curFileDialog==GUI_FILE_INS_OPEN_REPLACE) && prevIns!=-3) {
|
||||
if (curFileDialog==GUI_FILE_INS_OPEN_REPLACE) {
|
||||
if (prevInsData!=NULL) {
|
||||
logI("try");
|
||||
if (prevIns>=0 && prevIns<(int)e->song.ins.size()) {
|
||||
logI("replace");
|
||||
*e->song.ins[prevIns]=*prevInsData;
|
||||
}
|
||||
}
|
||||
|
@ -3135,7 +3133,7 @@ bool FurnaceGUI::loop() {
|
|||
showWarning(e->getWarnings(),GUI_WARN_GENERIC);
|
||||
}
|
||||
if (curIns>=0 && curIns<(int)e->song.ins.size()) {
|
||||
*e->song.ins[0]=*instruments[0];
|
||||
*e->song.ins[curIns]=*instruments[curIns];
|
||||
} else {
|
||||
showError("...but you haven't selected an instrument!");
|
||||
}
|
||||
|
|
|
@ -857,6 +857,7 @@ class FurnaceGUI {
|
|||
int eventDelay;
|
||||
int moveWindowTitle;
|
||||
int hiddenSystems;
|
||||
int insLoadAlwaysReplace;
|
||||
unsigned int maxUndoSteps;
|
||||
String mainFontPath;
|
||||
String patFontPath;
|
||||
|
@ -939,6 +940,7 @@ class FurnaceGUI {
|
|||
eventDelay(0),
|
||||
moveWindowTitle(0),
|
||||
hiddenSystems(0),
|
||||
insLoadAlwaysReplace(1),
|
||||
maxUndoSteps(100),
|
||||
mainFontPath(""),
|
||||
patFontPath(""),
|
||||
|
|
|
@ -419,6 +419,11 @@ void FurnaceGUI::drawSettings() {
|
|||
settings.restartOnFlagChange=restartOnFlagChangeB;
|
||||
}
|
||||
|
||||
bool insLoadAlwaysReplaceB=settings.insLoadAlwaysReplace;
|
||||
if (ImGui::Checkbox("Always replace currently selected instrument when loading from instrument list",&insLoadAlwaysReplaceB)) {
|
||||
settings.insLoadAlwaysReplace=insLoadAlwaysReplaceB;
|
||||
}
|
||||
|
||||
bool sysFileDialogB=settings.sysFileDialog;
|
||||
if (ImGui::Checkbox("Use system file picker",&sysFileDialogB)) {
|
||||
settings.sysFileDialog=sysFileDialogB;
|
||||
|
@ -1831,6 +1836,7 @@ void FurnaceGUI::syncSettings() {
|
|||
settings.eventDelay=e->getConfInt("eventDelay",0);
|
||||
settings.moveWindowTitle=e->getConfInt("moveWindowTitle",0);
|
||||
settings.hiddenSystems=e->getConfInt("hiddenSystems",0);
|
||||
settings.insLoadAlwaysReplace=e->getConfInt("insLoadAlwaysReplace",1);
|
||||
|
||||
clampSetting(settings.mainFontSize,2,96);
|
||||
clampSetting(settings.patFontSize,2,96);
|
||||
|
@ -1901,6 +1907,7 @@ void FurnaceGUI::syncSettings() {
|
|||
clampSetting(settings.eventDelay,0,1);
|
||||
clampSetting(settings.moveWindowTitle,0,1);
|
||||
clampSetting(settings.hiddenSystems,0,1);
|
||||
clampSetting(settings.insLoadAlwaysReplace,0,1);
|
||||
|
||||
settings.initialSys=e->decodeSysDesc(e->getConfString("initialSys",""));
|
||||
if (settings.initialSys.size()<4) {
|
||||
|
@ -2012,6 +2019,7 @@ void FurnaceGUI::commitSettings() {
|
|||
e->setConf("moveWindowTitle",settings.moveWindowTitle);
|
||||
e->setConf("hiddenSystems",settings.hiddenSystems);
|
||||
e->setConf("initialSys",e->encodeSysDesc(settings.initialSys));
|
||||
e->setConf("insLoadAlwaysReplace",settings.insLoadAlwaysReplace);
|
||||
|
||||
// colors
|
||||
for (int i=0; i<GUI_COLOR_MAX; i++) {
|
||||
|
|
Loading…
Reference in a new issue