Skip to content

Commit

Permalink
chtooltip updates... again
Browse files Browse the repository at this point in the history
fix tile overflow
add psg to hierarchy
update hierarchy (ext.ops after fm)
  • Loading branch information
Eknous-P authored and tildearrow committed Oct 14, 2024
1 parent 721c3b5 commit 17da58c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
18 changes: 17 additions & 1 deletion src/gui/guiConst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,23 @@ const char* chanNames[CHANNEL_TYPE_MAX+1]={
_N("Channels") // in case this makes l10n easier
};

unsigned char chanNamesHierarchy[CHANNEL_TYPE_MAX+1]={0,5,1,3,6,7,2,10,11,9,4,8,12,13};
unsigned char chanNamesHierarchy[CHANNEL_TYPE_MAX+1]={
CHANNEL_TYPE_FM,
CHANNEL_TYPE_OPERATOR,
CHANNEL_TYPE_SQUARE,
CHANNEL_TYPE_PULSE,
CHANNEL_TYPE_PSG,
CHANNEL_TYPE_WAVETABLE,
CHANNEL_TYPE_TRIANGLE,
CHANNEL_TYPE_SAW,
CHANNEL_TYPE_NOISE,
CHANNEL_TYPE_SLOPE,
CHANNEL_TYPE_WAVE,
CHANNEL_TYPE_DRUMS,
CHANNEL_TYPE_SAMPLE,
CHANNEL_TYPE_OTHER,
CHANNEL_TYPE_MAX
};

const FurnaceGUIColors fxColors[256]={
GUI_COLOR_PATTERN_EFFECT_MISC, // 00
Expand Down
1 change: 1 addition & 0 deletions src/gui/newSong.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ void FurnaceGUI::drawSysDefs(std::vector<FurnaceGUISysDef>& category, bool& acce
if (isHovered && !alreadyHover) {
alreadyHover=true;
if (ImGui::BeginTooltip()) {
ImGui::Dummy(ImVec2(400.0f*dpiScale,0.0f));
std::map<DivSystem,int> chipCounts;
std::vector<DivSystem> chips;
for (FurnaceGUISysDefChip chip: i.orig) {
Expand Down
3 changes: 2 additions & 1 deletion src/gui/sysManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ void FurnaceGUI::drawSysManager() {
if (e->song.system[i]!=DIV_SYSTEM_NULL) {
const DivSysDef* sysDef=e->getSystemDef(e->song.system[i]);
if (ImGui::BeginTooltip()) {
ImGui::PushTextWrapPos(420.0f*dpiScale); // arbitrary constant
ImGui::Dummy(ImVec2(MIN(scrW*dpiScale,400.0f*dpiScale),0.0f));
ImGui::PushTextWrapPos(MIN(scrW*dpiScale,400.0f*dpiScale)); // arbitrary constant
ImGui::TextWrapped("%s",sysDef->description);
ImGui::Separator();
drawSystemChannelInfoText(sysDef);
Expand Down
11 changes: 8 additions & 3 deletions src/gui/sysMiscInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,17 @@ void FurnaceGUI::drawSystemChannelInfo(const DivSysDef* whichDef) {
ImDrawList* dl=ImGui::GetWindowDrawList();
const ImVec2 p=ImGui::GetCursorScreenPos();
float scaler=5.0f*dpiScale;
float x=p.x+dpiScale;
float x=p.x, y=p.y;
float tooltipWidth=MIN(scrW*dpiScale,400.0f*dpiScale);
for (int i=0; i<whichDef->channels; i++) {
dl->AddRectFilled(ImVec2(x,p.y),ImVec2(x+1.5f*scaler,p.y+1.0f*scaler),ImGui::GetColorU32(uiColors[whichDef->chanTypes[i]+GUI_COLOR_CHANNEL_FM]),scaler);
dl->AddRectFilled(ImVec2(x,y),ImVec2(x+1.5f*scaler,y+1.0f*scaler),ImGui::GetColorU32(uiColors[whichDef->chanTypes[i]+GUI_COLOR_CHANNEL_FM]),scaler);
x+=2.0f*scaler;
if ((x+1.5f*scaler)>tooltipWidth+p.x) {
x=p.x;
y+=1.5f*scaler;
}
}
ImGui::Dummy(ImVec2(0,4*scaler));
ImGui::Dummy(ImVec2(0,(y-p.y)+1.5f*scaler));
}

void FurnaceGUI::drawSystemChannelInfoText(const DivSysDef* whichDef) {
Expand Down

0 comments on commit 17da58c

Please sign in to comment.