mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-16 01:35:07 +00:00
GUI: fix mistakes in op macro editor
This commit is contained in:
parent
85e9add020
commit
1c361003c2
1 changed files with 16 additions and 4 deletions
|
@ -1527,7 +1527,11 @@ String macroHoverLoop(int id, float val) {
|
||||||
asFloat[j]=macro[j+macroDragScroll]; \
|
asFloat[j]=macro[j+macroDragScroll]; \
|
||||||
asInt[j]=macro[j+macroDragScroll]; \
|
asInt[j]=macro[j+macroDragScroll]; \
|
||||||
} \
|
} \
|
||||||
loopIndicator[j]=(macroLoop!=-1 && (j+macroDragScroll)>=macroLoop); \
|
if (j+macroDragScroll>=macroLen) { \
|
||||||
|
loopIndicator[j]=0; \
|
||||||
|
} else { \
|
||||||
|
loopIndicator[j]=(macroLoop!=-1 && (j+macroDragScroll)>=macroLoop)|((macroRel!=-1 && (j+macroDragScroll)==macroRel)<<1); \
|
||||||
|
} \
|
||||||
} \
|
} \
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding,ImVec2(0.0f,0.0f)); \
|
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding,ImVec2(0.0f,0.0f)); \
|
||||||
\
|
\
|
||||||
|
@ -1552,18 +1556,26 @@ String macroHoverLoop(int id, float val) {
|
||||||
processDrags(ImGui::GetMousePos().x,ImGui::GetMousePos().y); \
|
processDrags(ImGui::GetMousePos().x,ImGui::GetMousePos().y); \
|
||||||
} \
|
} \
|
||||||
if (displayLoop) { \
|
if (displayLoop) { \
|
||||||
ImGui::PlotHistogram("##IOPMacroLoop_" #op macroName,loopIndicator,totalFit,0,NULL,0,1,ImVec2(availableWidth,8.0f*dpiScale)); \
|
PlotCustom("##IOPMacroLoop_" #op macroName,loopIndicator,totalFit,macroDragScroll,NULL,0,2,ImVec2(availableWidth,12.0f*dpiScale),sizeof(float),uiColors[GUI_COLOR_MACRO_OTHER],macroLen-macroDragScroll,¯oHoverLoop); \
|
||||||
if (ImGui::IsItemClicked(ImGuiMouseButton_Left)) { \
|
if (ImGui::IsItemClicked(ImGuiMouseButton_Left)) { \
|
||||||
macroLoopDragStart=ImGui::GetItemRectMin(); \
|
macroLoopDragStart=ImGui::GetItemRectMin(); \
|
||||||
macroLoopDragAreaSize=ImVec2(availableWidth,8.0f*dpiScale); \
|
macroLoopDragAreaSize=ImVec2(availableWidth,8.0f*dpiScale); \
|
||||||
macroLoopDragLen=totalFit; \
|
macroLoopDragLen=totalFit; \
|
||||||
|
if (ImGui::IsKeyDown(ImGuiKey_LeftShift) || ImGui::IsKeyDown(ImGuiKey_RightShift)) { \
|
||||||
|
macroLoopDragTarget=¯oRel; \
|
||||||
|
} else { \
|
||||||
macroLoopDragTarget=¯oLoop; \
|
macroLoopDragTarget=¯oLoop; \
|
||||||
|
} \
|
||||||
macroLoopDragActive=true; \
|
macroLoopDragActive=true; \
|
||||||
processDrags(ImGui::GetMousePos().x,ImGui::GetMousePos().y); \
|
processDrags(ImGui::GetMousePos().x,ImGui::GetMousePos().y); \
|
||||||
} \
|
} \
|
||||||
if (ImGui::IsItemClicked(ImGuiMouseButton_Right)) { \
|
if (ImGui::IsItemClicked(ImGuiMouseButton_Right)) { \
|
||||||
|
if (ImGui::IsKeyDown(ImGuiKey_LeftShift) || ImGui::IsKeyDown(ImGuiKey_RightShift)) { \
|
||||||
|
macroRel=-1; \
|
||||||
|
} else { \
|
||||||
macroLoop=-1; \
|
macroLoop=-1; \
|
||||||
} \
|
} \
|
||||||
|
} \
|
||||||
ImGui::SetNextItemWidth(availableWidth); \
|
ImGui::SetNextItemWidth(availableWidth); \
|
||||||
if (ImGui::InputText("##IOPMacroMML_" macroName,&mmlStr)) { \
|
if (ImGui::InputText("##IOPMacroMML_" macroName,&mmlStr)) { \
|
||||||
decodeMMLStr(mmlStr,macro,macroLen,macroLoop,0,bitfield?((1<<macroHeight)-1):(macroHeight),macroRel); \
|
decodeMMLStr(mmlStr,macro,macroLen,macroLoop,0,bitfield?((1<<macroHeight)-1):(macroHeight),macroRel); \
|
||||||
|
|
Loading…
Reference in a new issue