2022-04-19 23:44:05 +00:00
|
|
|
#include "gui.h"
|
|
|
|
#include "guiConst.h"
|
|
|
|
#include <imgui.h>
|
|
|
|
|
|
|
|
void FurnaceGUI::drawEffectList() {
|
|
|
|
if (nextWindow==GUI_WINDOW_EFFECT_LIST) {
|
|
|
|
effectListOpen=true;
|
|
|
|
ImGui::SetNextWindowFocus();
|
|
|
|
nextWindow=GUI_WINDOW_NOTHING;
|
|
|
|
}
|
|
|
|
if (!effectListOpen) return;
|
2022-10-20 07:34:14 +00:00
|
|
|
ImGui::SetNextWindowSizeConstraints(ImVec2(60.0f*dpiScale,20.0f*dpiScale),ImVec2(canvasW,canvasH));
|
2022-05-19 21:35:00 +00:00
|
|
|
if (ImGui::Begin("Effect List",&effectListOpen,globalWinFlags)) {
|
2022-08-20 22:04:57 +00:00
|
|
|
ImGui::Text("Chip at cursor: %s",e->getSystemName(e->sysOfChan[cursor.xCoarse]));
|
2023-07-29 09:11:52 +00:00
|
|
|
ImGui::SameLine();
|
2023-07-28 14:24:56 +00:00
|
|
|
if (ImGui::Button("Sort Effects")) ImGui::OpenPopup("effectSort");
|
2023-07-28 16:38:13 +00:00
|
|
|
if (ImGui::BeginPopupContextItem("effectSort")) {
|
2023-07-29 07:07:20 +00:00
|
|
|
for (int i=0; i<9; i++) {
|
|
|
|
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[fxColorsSort[i]]);
|
|
|
|
ImGui::Checkbox(fxColorsNames[i],&effectsShow[i]);
|
|
|
|
ImGui::PopStyleColor();
|
2023-07-26 14:53:39 +00:00
|
|
|
}
|
2023-07-29 07:07:20 +00:00
|
|
|
|
|
|
|
if (ImGui::Button("All")) memset(effectsShow,1,sizeof(bool)*10);
|
2023-07-27 10:44:41 +00:00
|
|
|
ImGui::SameLine();
|
2023-07-29 07:07:20 +00:00
|
|
|
if (ImGui::Button("None")) memset(effectsShow,0,sizeof(bool)*10);
|
2023-07-28 14:39:40 +00:00
|
|
|
|
2023-07-28 14:24:56 +00:00
|
|
|
ImGui::EndPopup();
|
2023-07-26 14:41:17 +00:00
|
|
|
}
|
|
|
|
|
2022-04-19 23:44:05 +00:00
|
|
|
if (ImGui::BeginTable("effectList",2)) {
|
|
|
|
ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthFixed);
|
|
|
|
ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthStretch);
|
|
|
|
|
|
|
|
ImGui::TableNextRow(ImGuiTableRowFlags_Headers);
|
|
|
|
ImGui::TableNextColumn();
|
|
|
|
ImGui::Text("Name");
|
|
|
|
ImGui::TableNextColumn();
|
|
|
|
ImGui::Text("Description");
|
|
|
|
|
|
|
|
const char* prevName=NULL;
|
|
|
|
for (int i=0; i<256; i++) {
|
|
|
|
const char* name=e->getEffectDesc(i,cursor.xCoarse);
|
2023-07-26 14:41:17 +00:00
|
|
|
bool effectShow = true;
|
2023-07-28 14:39:40 +00:00
|
|
|
if (name==prevName) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
prevName=name;
|
2023-07-26 14:41:17 +00:00
|
|
|
switch (fxColors[i]) {
|
2023-07-29 07:07:20 +00:00
|
|
|
case GUI_COLOR_PATTERN_EFFECT_MISC: effectShow = effectsShow[8]; break;
|
|
|
|
case GUI_COLOR_PATTERN_EFFECT_SONG: effectShow = effectsShow[1]; break;
|
|
|
|
case GUI_COLOR_PATTERN_EFFECT_SPEED: effectShow = effectsShow[3]; break;
|
|
|
|
case GUI_COLOR_PATTERN_EFFECT_TIME: effectShow = effectsShow[2]; break;
|
|
|
|
case GUI_COLOR_PATTERN_EFFECT_PITCH: effectShow = effectsShow[0]; break;
|
|
|
|
case GUI_COLOR_PATTERN_EFFECT_PANNING: effectShow = effectsShow[4]; break;
|
|
|
|
case GUI_COLOR_PATTERN_EFFECT_VOLUME: effectShow = effectsShow[5]; break;
|
|
|
|
case GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY: effectShow = effectsShow[6]; break;
|
|
|
|
case GUI_COLOR_PATTERN_EFFECT_SYS_SECONDARY: effectShow = effectsShow[7]; break;
|
2023-07-26 14:41:17 +00:00
|
|
|
default: effectShow = true; break;
|
|
|
|
}
|
|
|
|
if (name!=NULL && effectShow) {
|
2022-04-19 23:44:05 +00:00
|
|
|
ImGui::TableNextRow();
|
|
|
|
ImGui::TableNextColumn();
|
|
|
|
ImGui::PushFont(patFont);
|
2022-04-30 04:41:14 +00:00
|
|
|
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[fxColors[i]]);
|
2022-04-19 23:44:05 +00:00
|
|
|
ImGui::Text("%c%c%c%c",name[0],name[1],name[2],name[3]);
|
|
|
|
ImGui::PopStyleColor();
|
|
|
|
ImGui::PopFont();
|
|
|
|
|
|
|
|
ImGui::TableNextColumn();
|
|
|
|
if (strlen(name)>6) {
|
|
|
|
ImGui::TextWrapped("%s",&name[6]);
|
|
|
|
} else {
|
|
|
|
ImGui::Text("ERROR");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ImGui::EndTable();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ImGui::IsWindowFocused(ImGuiFocusedFlags_ChildWindows)) curWindow=GUI_WINDOW_EFFECT_LIST;
|
|
|
|
ImGui::End();
|
2022-05-19 21:35:00 +00:00
|
|
|
}
|