From c473f94f0d6901d19017e6474ea7c8a4b0592f37 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 18 Aug 2022 18:21:51 -0500 Subject: [PATCH] remove delta mode it's unnecessary in my opinion unless I am missing something --- src/gui/gui.h | 7 +++---- src/gui/insEdit.cpp | 51 +++++++++++++++------------------------------ 2 files changed, 20 insertions(+), 38 deletions(-) diff --git a/src/gui/gui.h b/src/gui/gui.h index 3e70e121..3e340119 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -864,13 +864,13 @@ struct FurnaceGUIMacroDesc { float height; const char* displayName; const char** bitfieldBits; - const char** modeName; + const char* modeName; ImVec4 color; unsigned int bitOffset; - bool isBitfield, blockMode, useMacroMode; + bool isBitfield, blockMode; String (*hoverFunc)(int,float); - FurnaceGUIMacroDesc(const char* name, DivInstrumentMacro* m, int macroMin, int macroMax, float macroHeight, ImVec4 col=ImVec4(1.0f,1.0f,1.0f,1.0f), bool block=false, bool mMode=false, const char** mName={NULL}, String (*hf)(int,float)=NULL, bool bitfield=false, const char** bfVal=NULL, unsigned int bitOff=0): + FurnaceGUIMacroDesc(const char* name, DivInstrumentMacro* m, int macroMin, int macroMax, float macroHeight, ImVec4 col=ImVec4(1.0f,1.0f,1.0f,1.0f), bool block=false, const char* mName=NULL, String (*hf)(int,float)=NULL, bool bitfield=false, const char** bfVal=NULL, unsigned int bitOff=0): macro(m), height(macroHeight), displayName(name), @@ -880,7 +880,6 @@ struct FurnaceGUIMacroDesc { bitOffset(bitOff), isBitfield(bitfield), blockMode(block), - useMacroMode(mMode), hoverFunc(hf) { // MSVC -> hell this->min=macroMin; diff --git a/src/gui/insEdit.cpp b/src/gui/insEdit.cpp index 1b51e02a..9287f180 100644 --- a/src/gui/insEdit.cpp +++ b/src/gui/insEdit.cpp @@ -305,34 +305,15 @@ const char* gbHWSeqCmdTypes[6]={ "Loop until Release" }; -const char* macroAbsoluteMode[3]={ - "Relative", - "Absolute", - NULL -}; - -const char* macroRelativeMode[3]={ - "Absolute", - "Relative", - NULL -}; - -const char* macroQSoundMode[3]={ - "Independent", - "QSound", - NULL -}; - -const char* macroDummyMode[1]={ - NULL -}; - -const char* macroFilterMode[4]={ - "Relative", - "Absolute", - "Delta", - NULL -}; +// do not change these! +// anything other than a checkbox will look ugly! +// +// if you really need to, and have a good rationale (and by good I mean a VERY +// good one), please tell me and we'll sort it out. +const char* macroAbsoluteMode="Fixed"; +const char* macroRelativeMode="Relative"; +const char* macroQSoundMode="QSound"; +const char* macroDummyMode="Bug"; String macroHoverNote(int id, float val) { if (val<-60 || val>=120) return "???"; @@ -1259,12 +1240,14 @@ void FurnaceGUI::drawMacros(std::vector& macros) { if (ImGui::InputScalar("##IMacroLen",ImGuiDataType_U8,&i.macro->len,&_ONE,&_THREE)) { MARK_MODIFIED if (i.macro->len>128) i.macro->len=128; } - if (i.useMacroMode && i.modeName[0]!=NULL) { - for (int m=0; i.modeName[m]!=NULL; m++) { - String modeName=fmt::sprintf("%s##IMacroMode%d",i.modeName[m],m); - if (ImGui::RadioButton(modeName.c_str(),(int)i.macro->mode==m)) { - i.macro->mode=m; - } + // do not change this! + // anything other than a checkbox will look ugly! + // if you really need more than two macro modes please tell me. + if (i.modeName!=NULL) { + bool modeVal=i.macro->mode; + String modeName=fmt::sprintf("%s##IMacroMode",i.modeName); + if (ImGui::Checkbox(modeName.c_str(),&modeVal)) { + i.macro->mode=modeVal; } } }