mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-24 05:25:12 +00:00
GUI: add operator copy
This commit is contained in:
parent
a08ae8cce7
commit
d19c6fc236
1 changed files with 18 additions and 6 deletions
|
@ -1564,20 +1564,32 @@ void FurnaceGUI::drawMacros(std::vector<FurnaceGUIMacroDesc>& macros) {
|
||||||
opToMove=i; \
|
opToMove=i; \
|
||||||
ImGui::SetDragDropPayload("FUR_OP",NULL,0,ImGuiCond_Once); \
|
ImGui::SetDragDropPayload("FUR_OP",NULL,0,ImGuiCond_Once); \
|
||||||
ImGui::Button(ICON_FA_ARROWS "##SysDrag"); \
|
ImGui::Button(ICON_FA_ARROWS "##SysDrag"); \
|
||||||
|
ImGui::SameLine(); \
|
||||||
|
if (ImGui::IsKeyDown(ImGuiKey_LeftShift) || ImGui::IsKeyDown(ImGuiKey_RightShift)) { \
|
||||||
|
ImGui::Text("(copying)"); \
|
||||||
|
} else { \
|
||||||
|
ImGui::Text("(swapping)"); \
|
||||||
|
} \
|
||||||
ImGui::EndDragDropSource(); \
|
ImGui::EndDragDropSource(); \
|
||||||
} else if (ImGui::IsItemHovered()) { \
|
} else if (ImGui::IsItemHovered()) { \
|
||||||
ImGui::SetTooltip("(drag to swap operators)"); \
|
ImGui::SetTooltip("- drag to swap operator\n- shift-drag to copy operator"); \
|
||||||
} \
|
} \
|
||||||
if (ImGui::BeginDragDropTarget()) { \
|
if (ImGui::BeginDragDropTarget()) { \
|
||||||
const ImGuiPayload* dragItem=ImGui::AcceptDragDropPayload("FUR_OP"); \
|
const ImGuiPayload* dragItem=ImGui::AcceptDragDropPayload("FUR_OP"); \
|
||||||
if (dragItem!=NULL) { \
|
if (dragItem!=NULL) { \
|
||||||
if (dragItem->IsDataType("FUR_OP")) { \
|
if (dragItem->IsDataType("FUR_OP")) { \
|
||||||
if (opToMove!=i && opToMove>=0) { \
|
if (opToMove!=i && opToMove>=0) { \
|
||||||
|
if (ImGui::IsKeyDown(ImGuiKey_LeftShift) || ImGui::IsKeyDown(ImGuiKey_RightShift)) { \
|
||||||
|
e->lockEngine([this,ins,i]() { \
|
||||||
|
ins->fm.op[orderedOps[i]]=ins->fm.op[orderedOps[opToMove]]; \
|
||||||
|
}); \
|
||||||
|
} else { \
|
||||||
e->lockEngine([this,ins,i]() { \
|
e->lockEngine([this,ins,i]() { \
|
||||||
DivInstrumentFM::Operator origOp=ins->fm.op[orderedOps[opToMove]]; \
|
DivInstrumentFM::Operator origOp=ins->fm.op[orderedOps[opToMove]]; \
|
||||||
ins->fm.op[orderedOps[opToMove]]=ins->fm.op[orderedOps[i]]; \
|
ins->fm.op[orderedOps[opToMove]]=ins->fm.op[orderedOps[i]]; \
|
||||||
ins->fm.op[orderedOps[i]]=origOp; \
|
ins->fm.op[orderedOps[i]]=origOp; \
|
||||||
}); \
|
}); \
|
||||||
|
} \
|
||||||
PARAMETER; \
|
PARAMETER; \
|
||||||
} \
|
} \
|
||||||
opToMove=-1; \
|
opToMove=-1; \
|
||||||
|
|
Loading…
Reference in a new issue