From 9f6b8ed52113b66061035997ae701cdce45be9ce Mon Sep 17 00:00:00 2001 From: tildearrow Date: Wed, 19 Jan 2022 18:19:52 -0500 Subject: [PATCH] prepare for different order edit modes see issue #31 --- src/gui/gui.cpp | 26 ++++++++++++++++++++++++++ src/gui/gui.h | 4 ++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 78a3e29da..664b2418c 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -522,6 +522,31 @@ void FurnaceGUI::drawOrders() { // whether to change one or all orders in a row changeAllOrders=!changeAllOrders; } + const char* orderEditModeLabel="?##OrderEditMode"; + if (orderEditMode==3) { + orderEditModeLabel=ICON_FA_ARROWS_V "##OrderEditMode"; + } else if (orderEditMode==2) { + orderEditModeLabel=ICON_FA_ARROWS_H "##OrderEditMode"; + } else if (orderEditMode==1) { + orderEditModeLabel=ICON_FA_I_CURSOR "##OrderEditMode"; + } else { + orderEditModeLabel=ICON_FA_MOUSE_POINTER "##OrderEditMode"; + } + if (ImGui::Button(orderEditModeLabel)) { + orderEditMode++; + if (orderEditMode>3) orderEditMode=0; + } + if (ImGui::IsItemHovered()) { + if (orderEditMode==3) { + ImGui::SetTooltip("Order edit mode: Select and type (scroll vertically)"); + } else if (orderEditMode==2) { + ImGui::SetTooltip("Order edit mode: Select and type (scroll horizontally)"); + } else if (orderEditMode==1) { + ImGui::SetTooltip("Order edit mode: Select and type (don't scroll)"); + } else { + ImGui::SetTooltip("Order edit mode: Click to change"); + } + } ImGui::PopStyleVar(); } if (ImGui::IsWindowFocused()) curWindow=GUI_WINDOW_ORDERS; @@ -3798,6 +3823,7 @@ FurnaceGUI::FurnaceGUI(): oldOrder1(0), editStep(1), exportLoops(0), + orderEditMode(0), editControlsOpen(true), ordersOpen(true), insListOpen(true), diff --git a/src/gui/gui.h b/src/gui/gui.h index 34116e3db..c6a3a43bd 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -211,11 +211,11 @@ class FurnaceGUI { char finalLayoutPath[4096]; - int curIns, curWave, curSample, curOctave, oldRow, oldOrder, oldOrder1, editStep, exportLoops; + int curIns, curWave, curSample, curOctave, oldRow, oldOrder, oldOrder1, editStep, exportLoops, orderEditMode; bool editControlsOpen, ordersOpen, insListOpen, songInfoOpen, patternOpen, insEditOpen; bool waveListOpen, waveEditOpen, sampleListOpen, sampleEditOpen, aboutOpen, settingsOpen; bool mixerOpen; - SelectionPoint selStart, selEnd, cursor; + SelectionPoint selStart, selEnd, cursor, orderCursor; bool selecting, curNibble, extraChannelButtons, followOrders, followPattern, changeAllOrders; FurnaceGUIWindows curWindow;