GUI: improve wavetable tab in ins edit

This commit is contained in:
tildearrow 2023-08-23 02:19:36 -05:00
parent f22910d8e2
commit 5c71b64195
1 changed files with 190 additions and 171 deletions

View File

@ -5275,6 +5275,7 @@ void FurnaceGUI::drawInsEdit() {
if (ImGui::Checkbox("Enable synthesizer",&ins->ws.enabled)) {
wavePreviewInit=true;
}
if (ins->ws.enabled) {
ImGui::SameLine();
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
if (ins->ws.effect&0x80) {
@ -5362,8 +5363,18 @@ void FurnaceGUI::drawInsEdit() {
ImGui::TableNextRow();
ImGui::TableNextColumn();
if (ins->std.waveMacro.len>0) {
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_WARNING]);
ImGui::AlignTextToFramePadding();
ImGui::Text("Wave 1 " ICON_FA_EXCLAMATION_TRIANGLE);
ImGui::PopStyleColor();
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("waveform macro is controlling wave 1!\nthis value will be ineffective.");
}
} else {
ImGui::AlignTextToFramePadding();
ImGui::Text("Wave 1");
}
ImGui::SameLine();
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x);
if (ImGui::InputInt("##SelWave1",&ins->ws.wave1,1,4)) {
@ -5371,6 +5382,11 @@ void FurnaceGUI::drawInsEdit() {
if (ins->ws.wave1>=(int)e->song.wave.size()) ins->ws.wave1=e->song.wave.size()-1;
wavePreviewInit=true;
}
if (ins->std.waveMacro.len>0) {
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("waveform macro is controlling wave 1!\nthis value will be ineffective.");
}
}
if (isSingleWaveFX) {
ImGui::TableNextColumn();
ImGui::AlignTextToFramePadding();
@ -5450,6 +5466,9 @@ void FurnaceGUI::drawInsEdit() {
if (ImGui::Checkbox("Global",&ins->ws.global)) {
wavePreviewInit=true;
}
} else {
ImGui::TextWrapped("wavetable synthesizer disabled.\nuse the Waveform macro to set the wave for this instrument.");
}
ImGui::EndTabItem();
}