From a061639f4b1f260ab60859b4d84eb9e434c58c19 Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Thu, 10 Oct 2024 23:17:52 +0400 Subject: [PATCH 1/2] proper setting name, fix overflow by making smaller, ay is psg, sid3 case im done please --- src/gui/guiConst.cpp | 1 + src/gui/guiConst.h | 1 + src/gui/newSong.cpp | 2 ++ src/gui/settings.cpp | 2 +- src/gui/sysManager.cpp | 1 + src/gui/sysMiscInfo.cpp | 15 +++++++++++++-- src/gui/sysPicker.cpp | 1 + 7 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/gui/guiConst.cpp b/src/gui/guiConst.cpp index 2c5e67898..4a52cc0e1 100644 --- a/src/gui/guiConst.cpp +++ b/src/gui/guiConst.cpp @@ -252,6 +252,7 @@ const char* chanNames[CHANNEL_TYPE_MAX+1]={ _N("Drums"), _N("Slope"), // PowerNoise _N("Wave"), // not wavetable (VERA, 5E01) + _N("PSG"), _N("Channel"), // if neither _N("Channels") // in case this makes l10n easier diff --git a/src/gui/guiConst.h b/src/gui/guiConst.h index 85b5ce126..c88729ca8 100644 --- a/src/gui/guiConst.h +++ b/src/gui/guiConst.h @@ -35,6 +35,7 @@ enum FurnaceGUIChanTypes { CHANNEL_TYPE_DRUMS, CHANNEL_TYPE_SLOPE, CHANNEL_TYPE_WAVE, + CHANNEL_TYPE_PSG, CHANNEL_TYPE_OTHER, CHANNEL_TYPE_MAX diff --git a/src/gui/newSong.cpp b/src/gui/newSong.cpp index 226e5e021..52c63394c 100644 --- a/src/gui/newSong.cpp +++ b/src/gui/newSong.cpp @@ -21,6 +21,7 @@ #include "misc/cpp/imgui_stdlib.h" #include #include +#include String sysDefID; @@ -81,6 +82,7 @@ void FurnaceGUI::drawSysDefs(std::vector& category, bool& acce ImGui::PushTextWrapPos(MIN(scrW*dpiScale,400.0f*dpiScale)); ImGui::Text("%s (x%d): ",sysDef->name,chipCounts[chip]); ImGui::Text("%s",sysDef->description); + ImGui::Separator(); if (settings.sysTooltipChanInfoStyle&1) drawSystemChannelInfoText(sysDef); if (settings.sysTooltipChanInfoStyle&2) drawSystemChannelInfo(sysDef); ImGui::PopTextWrapPos(); diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index c9b99e7a6..57b13977d 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -3331,7 +3331,7 @@ void FurnaceGUI::drawSettings() { settings.sysTooltipChanInfoStyle=1; settingsChanged=true; } - if (ImGui::RadioButton("Color... things?##stciCO",settings.sysTooltipChanInfoStyle==2)) { + if (ImGui::RadioButton("Color tiles##stciCO",settings.sysTooltipChanInfoStyle==2)) { settings.sysTooltipChanInfoStyle=2; // retext!!! settingsChanged=true; } diff --git a/src/gui/sysManager.cpp b/src/gui/sysManager.cpp index 845e32a87..a9e343a2a 100644 --- a/src/gui/sysManager.cpp +++ b/src/gui/sysManager.cpp @@ -94,6 +94,7 @@ void FurnaceGUI::drawSysManager() { if (ImGui::BeginTooltip()) { ImGui::PushTextWrapPos(420.0f*dpiScale); // arbitrary constant ImGui::TextWrapped("%s",sysDef->description); + ImGui::Separator(); if (settings.sysTooltipChanInfoStyle&1) drawSystemChannelInfoText(sysDef); if (settings.sysTooltipChanInfoStyle&2) drawSystemChannelInfo(sysDef); ImGui::PopTextWrapPos(); diff --git a/src/gui/sysMiscInfo.cpp b/src/gui/sysMiscInfo.cpp index 75a115c55..335055db2 100644 --- a/src/gui/sysMiscInfo.cpp +++ b/src/gui/sysMiscInfo.cpp @@ -300,8 +300,8 @@ void FurnaceGUI::drawSystemChannelInfo(const DivSysDef* whichDef) { float scaler=5.0f*dpiScale; float x=p.x+dpiScale; for (int i=0; ichannels; i++) { - dl->AddRectFilled(ImVec2(x,p.y),ImVec2(x+2.0f*scaler,p.y+4.0f*scaler),ImGui::GetColorU32(uiColors[whichDef->chanTypes[i]+GUI_COLOR_CHANNEL_FM]),scaler); - x+=3.0f*scaler; + dl->AddRectFilled(ImVec2(x,p.y),ImVec2(x+1.5f*scaler,p.y+3.0f*scaler),ImGui::GetColorU32(uiColors[whichDef->chanTypes[i]+GUI_COLOR_CHANNEL_FM]),scaler); + x+=2.0f*scaler; } ImGui::Dummy(ImVec2(0,4*scaler)); } @@ -342,6 +342,10 @@ void FurnaceGUI::drawSystemChannelInfoText(const DivSysDef* whichDef) { chanCount[whichDef->chanTypes[i]]++; } break; + case DIV_INS_AY: + case DIV_INS_AY8930: + chanCount[CHANNEL_TYPE_PSG]++; + break; case DIV_INS_OPL_DRUMS: case DIV_INS_OPL: case DIV_INS_OPLL: @@ -403,6 +407,13 @@ void FurnaceGUI::drawSystemChannelInfoText(const DivSysDef* whichDef) { } chanCount[whichDef->chanTypes[i]]++; break; + case DIV_INS_SID3: + if (whichDef->chanTypes[i]!=DIV_CH_WAVE) { + chanCount[CHANNEL_TYPE_OTHER]++; + } else { + chanCount[CHANNEL_TYPE_WAVE]++; + } + break; case DIV_INS_C64: // uncategorizable (by me) case DIV_INS_TIA: case DIV_INS_PET: diff --git a/src/gui/sysPicker.cpp b/src/gui/sysPicker.cpp index b3fee8186..a003c89a3 100644 --- a/src/gui/sysPicker.cpp +++ b/src/gui/sysPicker.cpp @@ -92,6 +92,7 @@ DivSystem FurnaceGUI::systemPicker(bool fullWidth) { if (hoveredSys!=DIV_SYSTEM_NULL) { const DivSysDef* sysDef=e->getSystemDef(hoveredSys); ImGui::TextWrapped("%s",sysDef->description); + ImGui::Separator(); if (settings.sysTooltipChanInfoStyle&1) drawSystemChannelInfoText(sysDef); if (settings.sysTooltipChanInfoStyle&2) drawSystemChannelInfo(sysDef); } From 1d59696f414576fd143d4930d6c70672d9a6d20c Mon Sep 17 00:00:00 2001 From: Eknous-P Date: Thu, 10 Oct 2024 23:20:23 +0400 Subject: [PATCH 2/2] bad clangd extension! bad! --- src/gui/newSong.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/newSong.cpp b/src/gui/newSong.cpp index 52c63394c..78535f4db 100644 --- a/src/gui/newSong.cpp +++ b/src/gui/newSong.cpp @@ -21,7 +21,6 @@ #include "misc/cpp/imgui_stdlib.h" #include #include -#include String sysDefID;