GUI: finally re-organize the GB env UI

This commit is contained in:
tildearrow 2022-08-17 18:29:40 -05:00
parent 89eace2472
commit 55d12e1ada

View file

@ -2969,13 +2969,42 @@ void FurnaceGUI::drawInsEdit() {
P(ImGui::Checkbox("Initialize envelope on every note",&ins->gb.alwaysInit)); P(ImGui::Checkbox("Initialize envelope on every note",&ins->gb.alwaysInit));
ImGui::BeginDisabled(ins->gb.softEnv); ImGui::BeginDisabled(ins->gb.softEnv);
P(CWSliderScalar("Volume",ImGuiDataType_U8,&ins->gb.envVol,&_ZERO,&_FIFTEEN)); rightClickable if (ImGui::BeginTable("GBParams",2)) {
P(CWSliderScalar("Envelope Length",ImGuiDataType_U8,&ins->gb.envLen,&_ZERO,&_SEVEN)); rightClickable ImGui::TableSetupColumn("c0",ImGuiTableColumnFlags_WidthStretch,0.6f);
P(CWSliderScalar("Sound Length",ImGuiDataType_U8,&ins->gb.soundLen,&_ZERO,&_SIXTY_FOUR,ins->gb.soundLen>63?"Infinity":"%d")); rightClickable ImGui::TableSetupColumn("c1",ImGuiTableColumnFlags_WidthStretch,0.4f);
ImGui::Text("Envelope Direction:");
ImGui::TableNextRow();
ImGui::TableNextColumn();
if (ImGui::BeginTable("GBParamsI",2)) {
ImGui::TableSetupColumn("ci0",ImGuiTableColumnFlags_WidthFixed);
ImGui::TableSetupColumn("ci1",ImGuiTableColumnFlags_WidthStretch);
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("Volume");
ImGui::TableNextColumn();
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
P(CWSliderScalar("##GBVolume",ImGuiDataType_U8,&ins->gb.envVol,&_ZERO,&_FIFTEEN)); rightClickable
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("Length");
ImGui::TableNextColumn();
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
P(CWSliderScalar("##GBEnvLen",ImGuiDataType_U8,&ins->gb.envLen,&_ZERO,&_SEVEN)); rightClickable
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("Sound Length");
ImGui::TableNextColumn();
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
P(CWSliderScalar("##GBSoundLen",ImGuiDataType_U8,&ins->gb.soundLen,&_ZERO,&_SIXTY_FOUR,ins->gb.soundLen>63?"Infinity":"%d")); rightClickable
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("Direction");
ImGui::TableNextColumn();
bool goesUp=ins->gb.envDir; bool goesUp=ins->gb.envDir;
ImGui::SameLine();
if (ImGui::RadioButton("Up",goesUp)) { PARAMETER if (ImGui::RadioButton("Up",goesUp)) { PARAMETER
goesUp=true; goesUp=true;
ins->gb.envDir=goesUp; ins->gb.envDir=goesUp;
@ -2986,8 +3015,15 @@ void FurnaceGUI::drawInsEdit() {
ins->gb.envDir=goesUp; ins->gb.envDir=goesUp;
} }
ImGui::EndTable();
}
ImGui::TableNextColumn();
drawGBEnv(ins->gb.envVol,ins->gb.envLen,ins->gb.soundLen,ins->gb.envDir,ImVec2(ImGui::GetContentRegionAvail().x,100.0f*dpiScale)); drawGBEnv(ins->gb.envVol,ins->gb.envLen,ins->gb.soundLen,ins->gb.envDir,ImVec2(ImGui::GetContentRegionAvail().x,100.0f*dpiScale));
ImGui::EndTable();
}
if (ImGui::BeginChild("HWSeq",ImGui::GetContentRegionAvail(),true,ImGuiWindowFlags_MenuBar)) { if (ImGui::BeginChild("HWSeq",ImGui::GetContentRegionAvail(),true,ImGuiWindowFlags_MenuBar)) {
ImGui::BeginMenuBar(); ImGui::BeginMenuBar();
ImGui::Text("Hardware Sequence"); ImGui::Text("Hardware Sequence");