GUI: add single-digit effects for 00-0F setting

This commit is contained in:
tildearrow 2023-01-17 02:07:29 -05:00
parent 2cfed1336a
commit c60aceec8b
3 changed files with 15 additions and 1 deletions

View file

@ -1295,6 +1295,7 @@ class FurnaceGUI {
double exportFadeOut; double exportFadeOut;
int macroLayout; int macroLayout;
float doubleClickTime; float doubleClickTime;
int oneDigitEffects;
unsigned int maxUndoSteps; unsigned int maxUndoSteps;
String mainFontPath; String mainFontPath;
String patFontPath; String patFontPath;
@ -1430,6 +1431,7 @@ class FurnaceGUI {
exportFadeOut(0.0), exportFadeOut(0.0),
macroLayout(0), macroLayout(0),
doubleClickTime(0.3f), doubleClickTime(0.3f),
oneDigitEffects(0),
maxUndoSteps(100), maxUndoSteps(100),
mainFontPath(""), mainFontPath(""),
patFontPath(""), patFontPath(""),

View file

@ -287,10 +287,14 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int
if (pat->data[i][index]>0xff) { if (pat->data[i][index]>0xff) {
snprintf(id,63,"??##PE%d_%d_%d",k,i,j); snprintf(id,63,"??##PE%d_%d_%d",k,i,j);
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_EFFECT_INVALID]); ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_EFFECT_INVALID]);
} else { } else if (pat->data[i][index]>0x10 || settings.oneDigitEffects==0) {
const unsigned char data=pat->data[i][index]; const unsigned char data=pat->data[i][index];
snprintf(id,63,"%.2X##PE%d_%d_%d",data,k,i,j); snprintf(id,63,"%.2X##PE%d_%d_%d",data,k,i,j);
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[fxColors[data]]); ImGui::PushStyleColor(ImGuiCol_Text,uiColors[fxColors[data]]);
} else {
const unsigned char data=pat->data[i][index];
snprintf(id,63," %.1X##PE%d_%d_%d",data,k,i,j);
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[fxColors[data]]);
} }
} }
ImGui::SameLine(0.0f,0.0f); ImGui::SameLine(0.0f,0.0f);

View file

@ -1602,6 +1602,11 @@ void FurnaceGUI::drawSettings() {
settings.germanNotation=germanNotationB; settings.germanNotation=germanNotationB;
} }
bool oneDigitEffectsB=settings.oneDigitEffects;
if (ImGui::Checkbox("Single-digit effects for 00-0F",&oneDigitEffectsB)) {
settings.oneDigitEffects=oneDigitEffectsB;
}
bool centerPatternB=settings.centerPattern; bool centerPatternB=settings.centerPattern;
if (ImGui::Checkbox("Center pattern view",&centerPatternB)) { if (ImGui::Checkbox("Center pattern view",&centerPatternB)) {
settings.centerPattern=centerPatternB; settings.centerPattern=centerPatternB;
@ -2565,6 +2570,7 @@ void FurnaceGUI::syncSettings() {
settings.exportFadeOut=e->getConfDouble("exportFadeOut",0.0); settings.exportFadeOut=e->getConfDouble("exportFadeOut",0.0);
settings.macroLayout=e->getConfInt("macroLayout",0); settings.macroLayout=e->getConfInt("macroLayout",0);
settings.doubleClickTime=e->getConfFloat("doubleClickTime",0.3f); settings.doubleClickTime=e->getConfFloat("doubleClickTime",0.3f);
settings.oneDigitEffects=e->getConfInt("oneDigitEffects",0);
clampSetting(settings.mainFontSize,2,96); clampSetting(settings.mainFontSize,2,96);
clampSetting(settings.patFontSize,2,96); clampSetting(settings.patFontSize,2,96);
@ -2676,6 +2682,7 @@ void FurnaceGUI::syncSettings() {
clampSetting(settings.persistFadeOut,0,1); clampSetting(settings.persistFadeOut,0,1);
clampSetting(settings.macroLayout,0,4); clampSetting(settings.macroLayout,0,4);
clampSetting(settings.doubleClickTime,0.02,1.0); clampSetting(settings.doubleClickTime,0.02,1.0);
clampSetting(settings.oneDigitEffects,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;
@ -2880,6 +2887,7 @@ void FurnaceGUI::commitSettings() {
e->setConf("exportFadeOut",settings.exportFadeOut); e->setConf("exportFadeOut",settings.exportFadeOut);
e->setConf("macroLayout",settings.macroLayout); e->setConf("macroLayout",settings.macroLayout);
e->setConf("doubleClickTime",settings.doubleClickTime); e->setConf("doubleClickTime",settings.doubleClickTime);
e->setConf("oneDigitEffects",settings.oneDigitEffects);
// colors // colors
for (int i=0; i<GUI_COLOR_MAX; i++) { for (int i=0; i<GUI_COLOR_MAX; i++) {