GUI: add an effect list window
This commit is contained in:
parent
b6026e76c5
commit
d4380e1524
11 changed files with 161 additions and 65 deletions
73
src/gui/effectList.cpp
Normal file
73
src/gui/effectList.cpp
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
#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;
|
||||
if (ImGui::Begin("Effect List",&effectListOpen)) {
|
||||
ImGui::Text("System at cursor: %s",e->getSystemName(e->sysOfChan[cursor.xCoarse]));
|
||||
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);
|
||||
if (name==prevName) {
|
||||
continue;
|
||||
}
|
||||
prevName=name;
|
||||
if (name!=NULL) {
|
||||
ImGui::TableNextRow();
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::PushFont(patFont);
|
||||
if (i<0x10) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[fxColors[i]]);
|
||||
} else if (i<0x20) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY]);
|
||||
} else if (i<0x30) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_EFFECT_SYS_SECONDARY]);
|
||||
} else if (i<0x48) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_EFFECT_SYS_PRIMARY]);
|
||||
} else if (i<0x90) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_EFFECT_INVALID]);
|
||||
} else if (i<0xa0) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_EFFECT_MISC]);
|
||||
} else if (i<0xc0) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_EFFECT_INVALID]);
|
||||
} else if (i<0xd0) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_EFFECT_SPEED]);
|
||||
} else if (i<0xe0) {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_PATTERN_EFFECT_INVALID]);
|
||||
} else {
|
||||
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[extFxColors[i-0xe0]]);
|
||||
}
|
||||
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();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue