GUI: add a hint when an ins cannot be previewed

This commit is contained in:
tildearrow 2023-10-15 17:02:25 -05:00
parent 256140bc32
commit 061b8e7aa1
8 changed files with 32 additions and 6 deletions

View file

@ -2886,6 +2886,14 @@ void FurnaceGUI::drawInsEdit() {
ins->type=(DivInstrumentType)insType;
}
*/
bool warnType=true;
for (DivInstrumentType i: e->getPossibleInsTypes()) {
if (i==insType) {
warnType=false;
}
}
pushWarningColor(warnType,warnType && failedNoteOn);
if (ImGui::BeginCombo("##Type",insTypes[insType][0])) {
std::vector<DivInstrumentType> insTypeList;
if (settings.displayAllInsTypes) {
@ -2943,7 +2951,12 @@ void FurnaceGUI::drawInsEdit() {
}
}
ImGui::EndCombo();
} else if (warnType) {
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("none of the currently present chips are able to play this instrument type!");
}
}
popWarningColor();
ImGui::EndTable();
}