GUI: prepare for new chip picker

This commit is contained in:
tildearrow 2022-08-26 19:30:13 -05:00
parent be9385f701
commit daf176e197
7 changed files with 115 additions and 21 deletions

View file

@ -78,6 +78,14 @@ void FurnaceGUI::drawSysManager() {
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Change");
}
if (ImGui::BeginPopupContextItem("SysPickerC",ImGuiPopupFlags_MouseButtonLeft)) {
DivSystem picked=systemPicker();
if (picked!=DIV_SYSTEM_NULL) {
e->changeSystem(i,picked,preserveChanPos);
updateWindowTitle();
}
ImGui::EndPopup();
}
ImGui::SameLine();
ImGui::BeginDisabled(e->song.systemLen<=1);
if (ImGui::Button(ICON_FA_TIMES "##SysRemove")) {
@ -95,6 +103,16 @@ void FurnaceGUI::drawSysManager() {
ImGui::TableNextColumn();
ImGui::TableNextColumn();
ImGui::Button(ICON_FA_PLUS "##SysAdd");
if (ImGui::BeginPopupContextItem("SysPickerA",ImGuiPopupFlags_MouseButtonLeft)) {
DivSystem picked=systemPicker();
if (picked!=DIV_SYSTEM_NULL) {
if (!e->addSystem(picked)) {
showError("cannot add chip! ("+e->getLastError()+")");
}
updateWindowTitle();
}
ImGui::EndPopup();
}
}
ImGui::EndTable();
}