add setting to disable scrollChangesOrder

it's kinda unreliable at the moment
This commit is contained in:
tildearrow 2022-04-14 01:25:21 -05:00
parent d6333af330
commit 0e2ecaf6be
3 changed files with 13 additions and 4 deletions

View file

@ -812,6 +812,7 @@ class FurnaceGUI {
int insEditColorize; int insEditColorize;
int metroVol; int metroVol;
int pushNibble; int pushNibble;
int scrollChangesOrder;
unsigned int maxUndoSteps; unsigned int maxUndoSteps;
String mainFontPath; String mainFontPath;
String patFontPath; String patFontPath;
@ -880,6 +881,7 @@ class FurnaceGUI {
insEditColorize(0), insEditColorize(0),
metroVol(100), metroVol(100),
pushNibble(0), pushNibble(0),
scrollChangesOrder(0),
maxUndoSteps(100), maxUndoSteps(100),
mainFontPath(""), mainFontPath(""),
patFontPath(""), patFontPath(""),

View file

@ -655,11 +655,11 @@ void FurnaceGUI::drawPattern() {
scrollX=ImGui::GetScrollX(); scrollX=ImGui::GetScrollX();
// overflow changes order // overflow changes order
if (!e->isPlaying()) { // TODO: this is very unreliable and sometimes it can warp you out of the song
if (settings.scrollChangesOrder && !e->isPlaying()) {
if (wheelY!=0) { if (wheelY!=0) {
if (wheelY>0) { if (wheelY>0) {
if (ImGui::GetScrollY()<=0) { if (ImGui::GetScrollY()<=0) {
logV("scroll %d",wheelY);
if (haveHitBounds) { if (haveHitBounds) {
if (e->getOrder()>0) { if (e->getOrder()>0) {
e->setOrder(e->getOrder()-1); e->setOrder(e->getOrder()-1);
@ -675,9 +675,8 @@ void FurnaceGUI::drawPattern() {
} }
} else { } else {
if (ImGui::GetScrollY()>=ImGui::GetScrollMaxY()) { if (ImGui::GetScrollY()>=ImGui::GetScrollMaxY()) {
logV("scroll %d",wheelY);
if (haveHitBounds) { if (haveHitBounds) {
if (e->getOrder()<e->song.ordersLen) { if (e->getOrder()<(e->song.ordersLen-1)) {
e->setOrder(e->getOrder()+1); e->setOrder(e->getOrder()+1);
ImGui::SetScrollY(0); ImGui::SetScrollY(0);
updateScroll(0); updateScroll(0);

View file

@ -256,6 +256,11 @@ void FurnaceGUI::drawSettings() {
settings.effectDeletionAltersValue=effectDeletionAltersValueB; settings.effectDeletionAltersValue=effectDeletionAltersValueB;
} }
bool scrollChangesOrderB=settings.scrollChangesOrder;
if (ImGui::Checkbox("Change order when scrolling outside of pattern bounds",&scrollChangesOrderB)) {
settings.scrollChangesOrder=scrollChangesOrderB;
}
bool stepOnInsertB=settings.stepOnInsert; bool stepOnInsertB=settings.stepOnInsert;
if (ImGui::Checkbox("Move cursor by edit step on insert (push)",&stepOnInsertB)) { if (ImGui::Checkbox("Move cursor by edit step on insert (push)",&stepOnInsertB)) {
settings.stepOnInsert=stepOnInsertB; settings.stepOnInsert=stepOnInsertB;
@ -1574,6 +1579,7 @@ void FurnaceGUI::syncSettings() {
settings.insEditColorize=e->getConfInt("insEditColorize",0); settings.insEditColorize=e->getConfInt("insEditColorize",0);
settings.metroVol=e->getConfInt("metroVol",100); settings.metroVol=e->getConfInt("metroVol",100);
settings.pushNibble=e->getConfInt("pushNibble",0); settings.pushNibble=e->getConfInt("pushNibble",0);
settings.scrollChangesOrder=e->getConfInt("scrollChangesOrder",0);
clampSetting(settings.mainFontSize,2,96); clampSetting(settings.mainFontSize,2,96);
clampSetting(settings.patFontSize,2,96); clampSetting(settings.patFontSize,2,96);
@ -1631,6 +1637,7 @@ void FurnaceGUI::syncSettings() {
clampSetting(settings.insEditColorize,0,1); clampSetting(settings.insEditColorize,0,1);
clampSetting(settings.metroVol,0,200); clampSetting(settings.metroVol,0,200);
clampSetting(settings.pushNibble,0,1); clampSetting(settings.pushNibble,0,1);
clampSetting(settings.scrollChangesOrder,0,1);
// keybinds // keybinds
for (int i=0; i<GUI_ACTION_MAX; i++) { for (int i=0; i<GUI_ACTION_MAX; i++) {
@ -1715,6 +1722,7 @@ void FurnaceGUI::commitSettings() {
e->setConf("insEditColorize",settings.insEditColorize); e->setConf("insEditColorize",settings.insEditColorize);
e->setConf("metroVol",settings.metroVol); e->setConf("metroVol",settings.metroVol);
e->setConf("pushNibble",settings.pushNibble); e->setConf("pushNibble",settings.pushNibble);
e->setConf("scrollChangesOrder",settings.scrollChangesOrder);
// colors // colors
for (int i=0; i<GUI_COLOR_MAX; i++) { for (int i=0; i<GUI_COLOR_MAX; i++) {