This commit is contained in:
Eknous-P 2024-03-21 13:51:09 +04:00
parent 399c63a587
commit 0595bf174c
3 changed files with 24 additions and 2 deletions

View file

@ -1815,6 +1815,8 @@ class FurnaceGUI {
int playbackTime; int playbackTime;
int shaderOsc; int shaderOsc;
int cursorWheelStep; int cursorWheelStep;
int chipManagerTooltip;
int sysTooltipChannelColors;
unsigned int maxUndoSteps; unsigned int maxUndoSteps;
String mainFontPath; String mainFontPath;
String headFontPath; String headFontPath;
@ -2020,6 +2022,8 @@ class FurnaceGUI {
playbackTime(1), playbackTime(1),
shaderOsc(1), shaderOsc(1),
cursorWheelStep(0), cursorWheelStep(0),
chipManagerTooltip(1), // poll?
sysTooltipChannelColors(1), // poll?
maxUndoSteps(100), maxUndoSteps(100),
mainFontPath(""), mainFontPath(""),
headFontPath(""), headFontPath(""),

View file

@ -2754,6 +2754,18 @@ void FurnaceGUI::drawSettings() {
settingsChanged=true; settingsChanged=true;
} }
bool chipManagerTooltipB=settings.chipManagerTooltip;
if (ImGui::Checkbox("Show system tooltips in the chip manager",&chipManagerTooltipB)) {
settings.chipManagerTooltip=chipManagerTooltipB;
settingsChanged=true;
}
bool sysTooltipChannelColorsB=settings.sysTooltipChannelColors;
if (ImGui::Checkbox("Show channel count with colors in the system info tooltips",&sysTooltipChannelColorsB)) { // poor wording
settings.sysTooltipChannelColors=sysTooltipChannelColorsB;
settingsChanged=true;
}
// SUBSECTION ORDERS // SUBSECTION ORDERS
CONFIG_SUBSECTION("Orders"); CONFIG_SUBSECTION("Orders");
// sorry. temporarily disabled until ImGui has a way to add separators in tables arbitrarily. // sorry. temporarily disabled until ImGui has a way to add separators in tables arbitrarily.
@ -4119,6 +4131,8 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
settings.macroLayout=conf.getInt("macroLayout",0); settings.macroLayout=conf.getInt("macroLayout",0);
settings.controlLayout=conf.getInt("controlLayout",3); settings.controlLayout=conf.getInt("controlLayout",3);
settings.classicChipOptions=conf.getInt("classicChipOptions",0); settings.classicChipOptions=conf.getInt("classicChipOptions",0);
settings.chipManagerTooltip=conf.getInt("chipManagerTooltip",0);
settings.sysTooltipChannelColors=conf.getInt("sysTooltipChannelColors",0);
} }
if (groups&GUI_SETTINGS_COLOR) { if (groups&GUI_SETTINGS_COLOR) {
@ -4337,6 +4351,8 @@ void FurnaceGUI::readConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
clampSetting(settings.shaderOsc,0,1); clampSetting(settings.shaderOsc,0,1);
clampSetting(settings.oscLineSize,0.25f,16.0f); clampSetting(settings.oscLineSize,0.25f,16.0f);
clampSetting(settings.cursorWheelStep,0,1); clampSetting(settings.cursorWheelStep,0,1);
clampSetting(settings.chipManagerTooltip,0,1);
clampSetting(settings.sysTooltipChannelColors,0,1);
if (settings.exportLoops<0.0) settings.exportLoops=0.0; if (settings.exportLoops<0.0) settings.exportLoops=0.0;
if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0; if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0;
@ -4594,6 +4610,8 @@ void FurnaceGUI::writeConfig(DivConfig& conf, FurnaceGUISettingGroups groups) {
conf.set("macroLayout",settings.macroLayout); conf.set("macroLayout",settings.macroLayout);
conf.set("controlLayout",settings.controlLayout); conf.set("controlLayout",settings.controlLayout);
conf.set("classicChipOptions",settings.classicChipOptions); conf.set("classicChipOptions",settings.classicChipOptions);
conf.set("chipManagerTooltip",settings.chipManagerTooltip);
conf.set("sysTooltipChannelColors",settings.sysTooltipChannelColors);
} }
// color // color

View file

@ -97,14 +97,14 @@ void FurnaceGUI::drawSysManager() {
isNotCollapsed=false; isNotCollapsed=false;
ImGui::TreePop(); ImGui::TreePop();
} }
if (ImGui::IsItemHovered(ImGuiHoveredFlags_Stationary) && isNotCollapsed) { if (ImGui::IsItemHovered(ImGuiHoveredFlags_Stationary) && isNotCollapsed && settings.chipManagerTooltip) {
if (e->song.system[i]!=DIV_SYSTEM_NULL) { if (e->song.system[i]!=DIV_SYSTEM_NULL) {
const DivSysDef* sysDef=e->getSystemDef(e->song.system[i]); const DivSysDef* sysDef=e->getSystemDef(e->song.system[i]);
if (ImGui::BeginTooltip()) { // why not SetTooltip()? so i can wrap the text if (ImGui::BeginTooltip()) { // why not SetTooltip()? so i can wrap the text
ImGui::PushTextWrapPos(ImGui::GetCursorPos().x+420); // arbitrary constant ImGui::PushTextWrapPos(ImGui::GetCursorPos().x+420); // arbitrary constant
ImGui::TextWrapped("%s",sysDef->description); ImGui::TextWrapped("%s",sysDef->description);
ImGui::PopTextWrapPos(); ImGui::PopTextWrapPos();
drawSystemChannelInfo(sysDef); if (settings.sysTooltipChannelColors) drawSystemChannelInfo(sysDef);
ImGui::EndTooltip(); ImGui::EndTooltip();
} }
} }