'all' checkbox to 'all'/'none' buttons

This commit is contained in:
Eknous-P 2023-07-27 14:44:41 +04:00
parent 60006dc862
commit 620fc82247
3 changed files with 23 additions and 25 deletions

View File

@ -12,10 +12,17 @@ void FurnaceGUI::drawEffectList() {
ImGui::SetNextWindowSizeConstraints(ImVec2(60.0f*dpiScale,20.0f*dpiScale),ImVec2(canvasW,canvasH)); ImGui::SetNextWindowSizeConstraints(ImVec2(60.0f*dpiScale,20.0f*dpiScale),ImVec2(canvasW,canvasH));
if (ImGui::Begin("Effect List",&effectListOpen,globalWinFlags)) { if (ImGui::Begin("Effect List",&effectListOpen,globalWinFlags)) {
ImGui::Text("Chip at cursor: %s",e->getSystemName(e->sysOfChan[cursor.xCoarse])); ImGui::Text("Chip at cursor: %s",e->getSystemName(e->sysOfChan[cursor.xCoarse]));
// ImGui::Text("Sort Effects:");
if (ImGui::TreeNode("Sort Effects")) { if (ImGui::TreeNode("Sort Effects")) {
ImGui::Checkbox("All",&effectShowAll); ImGui::Checkbox("Pitch",&effectShowPitch);
if (effectShowAll) { ImGui::Checkbox("Song",&effectShowSong);
ImGui::Checkbox("Time",&effectShowTime);
ImGui::Checkbox("Speed",&effectShowSpeed);
ImGui::Checkbox("Panning",&effectShowPanning);
ImGui::Checkbox("Volume",&effectShowVolume);
ImGui::Checkbox("System (primary)",&effectShowSysPrimary);
ImGui::Checkbox("System (secondary)",&effectShowSysSecondary);
ImGui::Checkbox("Miscellaneous",&effectShowMisc);
if (ImGui::Button("All")) {
effectShowMisc = true; effectShowMisc = true;
effectShowPanning = true; effectShowPanning = true;
effectShowPitch = true; effectShowPitch = true;
@ -26,27 +33,20 @@ void FurnaceGUI::drawEffectList() {
effectShowSysPrimary = true; effectShowSysPrimary = true;
effectShowSysSecondary = true; effectShowSysSecondary = true;
} }
// ImGui::SameLine(); ImGui::SameLine();
ImGui::Checkbox("Pitch",&effectShowPitch); if (ImGui::Button("None")) {
// ImGui::SameLine(); effectShowMisc = false;
ImGui::Checkbox("Song",&effectShowSong); effectShowPanning = false;
// ImGui::SameLine(); effectShowPitch = false;
ImGui::Checkbox("Time",&effectShowTime); effectShowVolume = false;
// ImGui::SameLine(); effectShowSong = false;
ImGui::Checkbox("Speed",&effectShowSpeed); effectShowTime = false;
// ImGui::SameLine(); effectShowSpeed = false;
ImGui::Checkbox("Panning",&effectShowPanning); effectShowSysPrimary = false;
// ImGui::SameLine(); effectShowSysSecondary = false;
ImGui::Checkbox("Volume",&effectShowVolume); }
// ImGui::SameLine();
ImGui::Checkbox("System (primary)",&effectShowSysPrimary);
// ImGui::SameLine();
ImGui::Checkbox("System (secondary)",&effectShowSysSecondary);
// ImGui::SameLine();
ImGui::Checkbox("Miscellaneous",&effectShowMisc);
ImGui::TreePop(); ImGui::TreePop();
} }
effectShowAll = effectShowMisc && effectShowPanning && effectShowPitch && effectShowVolume && effectShowSong && effectShowTime && effectShowSpeed && effectShowSysPrimary && effectShowSysSecondary;
if (ImGui::BeginTable("effectList",2)) { if (ImGui::BeginTable("effectList",2)) {
ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthFixed); ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthFixed);
@ -74,7 +74,6 @@ void FurnaceGUI::drawEffectList() {
case GUI_COLOR_PATTERN_EFFECT_SYS_SECONDARY: effectShow = effectShowSysSecondary; break; case GUI_COLOR_PATTERN_EFFECT_SYS_SECONDARY: effectShow = effectShowSysSecondary; break;
default: effectShow = true; break; default: effectShow = true; break;
} }
// effectShow = effectShow && effectShowAll;
if (name==prevName) { if (name==prevName) {
continue; continue;
} }

View File

@ -7154,7 +7154,6 @@ FurnaceGUI::FurnaceGUI():
pianoInputPadMode(PIANO_INPUT_PAD_DISABLE), pianoInputPadMode(PIANO_INPUT_PAD_DISABLE),
#endif #endif
//effect sorting //effect sorting
effectShowAll(true),
effectShowPitch(true), effectShowPitch(true),
effectShowVolume(true), effectShowVolume(true),
effectShowPanning(true), effectShowPanning(true),

View File

@ -2034,7 +2034,7 @@ class FurnaceGUI {
int pianoView, pianoInputPadMode; int pianoView, pianoInputPadMode;
//effect sorting //effect sorting
bool effectShowAll, effectShowPitch, effectShowVolume, effectShowPanning, effectShowSong, effectShowTime, effectShowSpeed, effectShowSysPrimary, effectShowSysSecondary, effectShowMisc; bool effectShowPitch, effectShowVolume, effectShowPanning, effectShowSong, effectShowTime, effectShowSpeed, effectShowSysPrimary, effectShowSysSecondary, effectShowMisc;
// TX81Z // TX81Z
bool hasACED; bool hasACED;