GUI: new pattern cursor logic, part 3
This commit is contained in:
parent
3cb9fbefaa
commit
9646eb9028
|
@ -8846,6 +8846,10 @@ FurnaceGUI::FurnaceGUI():
|
|||
fadeMax(255),
|
||||
collapseAmount(2),
|
||||
randomizeEffectVal(0),
|
||||
topMostOrder(-1),
|
||||
topMostRow(-1),
|
||||
bottomMostOrder(-1),
|
||||
bottomMostRow(-1),
|
||||
playheadY(0.0f),
|
||||
scaleMax(100.0f),
|
||||
fadeMode(false),
|
||||
|
|
|
@ -2560,6 +2560,8 @@ class FurnaceGUI {
|
|||
SelectionPoint sel1, sel2;
|
||||
int dummyRows;
|
||||
int transposeAmount, randomizeMin, randomizeMax, fadeMin, fadeMax, collapseAmount, randomizeEffectVal;
|
||||
int topMostOrder, topMostRow;
|
||||
int bottomMostOrder, bottomMostRow;
|
||||
float playheadY;
|
||||
float scaleMax;
|
||||
bool fadeMode, randomMode, haveHitBounds, randomizeEffect;
|
||||
|
|
|
@ -94,6 +94,16 @@ inline void FurnaceGUI::patternRow(int i, bool isPlaying, float lineHeight, int
|
|||
if (i<0 || i>=e->curSubSong->patLen) {
|
||||
return;
|
||||
}
|
||||
// set the top-most and bottom-most Y positions
|
||||
if (topMostOrder==-1) {
|
||||
topMostOrder=ord;
|
||||
}
|
||||
if (topMostRow==-1) {
|
||||
topMostRow=i;
|
||||
}
|
||||
bottomMostOrder=ord;
|
||||
bottomMostRow=i;
|
||||
// stuff
|
||||
bool isPushing=false;
|
||||
ImVec4 activeColor=uiColors[GUI_COLOR_PATTERN_ACTIVE];
|
||||
ImVec4 inactiveColor=uiColors[GUI_COLOR_PATTERN_INACTIVE];
|
||||
|
@ -447,6 +457,13 @@ void FurnaceGUI::drawPattern() {
|
|||
sel2.xFine^=sel1.xFine;
|
||||
}
|
||||
|
||||
/*
|
||||
topMostOrder=-1;
|
||||
topMostRow=-1;
|
||||
bottomMostOrder=-1;
|
||||
bottomMostRow=-1;
|
||||
*/
|
||||
|
||||
ImVec2 origWinPadding=ImGui::GetStyle().WindowPadding;
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding,ImVec2(0.0f,0.0f));
|
||||
if (mobileUI) {
|
||||
|
@ -519,7 +536,7 @@ void FurnaceGUI::drawPattern() {
|
|||
|
||||
if (nextAddScroll!=0.0f) {
|
||||
float newScroll=ImGui::GetScrollY()+nextAddScroll;
|
||||
// wrap around and go to previous/next pattern if we're about to overflow
|
||||
// wrap around and go to previous/next pattern if we're about to go beyond the view
|
||||
if (newScroll<0.0f && curOrder>0) {
|
||||
ImGui::SetScrollY(ImGui::GetScrollMaxY()+newScroll);
|
||||
setOrder(curOrder-1);
|
||||
|
@ -529,6 +546,17 @@ void FurnaceGUI::drawPattern() {
|
|||
} else {
|
||||
ImGui::SetScrollY(newScroll);
|
||||
}
|
||||
|
||||
// select in empty space
|
||||
logV("T: %d,%d B: %d,%d",topMostOrder,topMostRow,bottomMostOrder,bottomMostRow);
|
||||
if (nextAddScroll>0.0f) {
|
||||
logW("DOWN");
|
||||
updateSelection(selEnd.xCoarse,selEnd.xFine,bottomMostRow,bottomMostOrder);
|
||||
} else {
|
||||
logW("UP");
|
||||
updateSelection(selEnd.xCoarse,selEnd.xFine,topMostRow,topMostOrder);
|
||||
}
|
||||
|
||||
nextScroll=-1.0f;
|
||||
nextAddScroll=0.0f;
|
||||
}
|
||||
|
@ -1186,6 +1214,9 @@ void FurnaceGUI::drawPattern() {
|
|||
|
||||
dummyRows=(ImGui::GetWindowSize().y/lineHeight)/2;
|
||||
|
||||
topMostOrder=-1;
|
||||
topMostRow=-1;
|
||||
|
||||
// オップナー2608 i owe you one more for this horrible code
|
||||
// previous pattern
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FrameShading,0.0f);
|
||||
|
|
Loading…
Reference in a new issue