From 6ae8f615d97a79fed44f8f4633d2628bbbb7f374 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 14 Aug 2023 20:02:10 -0500 Subject: [PATCH] we got custom icons --- CMakeLists.txt | 1 + res/make-iconfont.sh | 4 +- src/gui/dataList.cpp | 231 +++------------------------------------ src/gui/font_furicon.cpp | 5 +- src/gui/fonts.h | 2 + src/gui/furIcons.h | 2 +- src/gui/gui.cpp | 3 +- src/gui/gui.h | 3 + src/gui/guiConst.cpp | 121 ++++++++++---------- src/gui/guiConst.h | 2 +- src/gui/insEdit.cpp | 6 +- src/gui/settings.cpp | 22 ++++ 12 files changed, 123 insertions(+), 279 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 592cd5e1..85fa2b35 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -649,6 +649,7 @@ src/gui/font_proggyClean.cpp src/gui/font_ptMono.cpp src/gui/font_unifont.cpp src/gui/font_icon.cpp +src/gui/font_furicon.cpp src/gui/fonts.cpp src/gui/image_icon.cpp diff --git a/res/make-iconfont.sh b/res/make-iconfont.sh index 1e992fbd..4628bac4 100755 --- a/res/make-iconfont.sh +++ b/res/make-iconfont.sh @@ -1,9 +1,11 @@ #!/bin/bash # run after exporting to .ttf +# make sure you're running this on a Linux or Unix-like system with GCC if [ ! -e binary_to_compressed_c ]; then g++ -o binary_to_compressed_c ../extern/imgui_patched/misc/fonts/binary_to_compressed_c.cpp || exit 1 fi -./binary_to_compressed_c icons.ttf furIcons > ../src/gui/font_furicon.cpp +echo "#include \"fonts.h\"" > ../src/gui/font_furicon.cpp +./binary_to_compressed_c icons.ttf furIcons | sed "s/static //" >> ../src/gui/font_furicon.cpp #xxd -i -n "furIcons" icons.ttf | sed -r "s/^ +//g;s/, /,/g;s/ = /=/g;s/unsigned/const unsigned/g" > ../src/gui/font_furIcons.cpp diff --git a/src/gui/dataList.cpp b/src/gui/dataList.cpp index fcdc7bb9..4b2aee62 100644 --- a/src/gui/dataList.cpp +++ b/src/gui/dataList.cpp @@ -76,223 +76,26 @@ void FurnaceGUI::insListItem(int i, int dir, int asset) { const char* insType="Bug!"; if (i>=0 && isong.insLen) { DivInstrument* ins=e->song.ins[i]; - insType=(ins->type>DIV_INS_MAX)?"Unknown":insTypes[ins->type]; - switch (ins->type) { - case DIV_INS_FM: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_FM]); - name=fmt::sprintf(ICON_FA_AREA_CHART "##_INS%d",i); + insType=(ins->type>DIV_INS_MAX)?"Unknown":insTypes[ins->type][0]; + const char** insIcon=NULL; + + if (ins->type>=DIV_INS_MAX) { + ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_UNKNOWN]); + insIcon=insTypes[DIV_INS_MAX]; + } else { + ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_STD+ins->type]); + insIcon=insTypes[ins->type]; + } + + switch (settings.insIconsStyle) { + case 1: + name=fmt::sprintf("%s##_INS%d",insIcon[1],i); break; - case DIV_INS_STD: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_STD]); - name=fmt::sprintf(ICON_FA_BAR_CHART "##_INS%d",i); - break; - case DIV_INS_GB: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_GB]); - name=fmt::sprintf(ICON_FA_GAMEPAD "##_INS%d",i); - break; - case DIV_INS_C64: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_C64]); - name=fmt::sprintf(ICON_FA_KEYBOARD_O "##_INS%d",i); - break; - case DIV_INS_AMIGA: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_AMIGA]); - name=fmt::sprintf(ICON_FA_VOLUME_UP "##_INS%d",i); - break; - case DIV_INS_PCE: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_PCE]); - name=fmt::sprintf(ICON_FA_ID_BADGE "##_INS%d",i); - break; - case DIV_INS_AY: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_AY]); - name=fmt::sprintf(ICON_FA_BAR_CHART "##_INS%d",i); - break; - case DIV_INS_AY8930: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_AY8930]); - name=fmt::sprintf(ICON_FA_BAR_CHART "##_INS%d",i); - break; - case DIV_INS_TIA: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_TIA]); - name=fmt::sprintf(ICON_FA_BAR_CHART "##_INS%d",i); - break; - case DIV_INS_SAA1099: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_SAA1099]); - name=fmt::sprintf(ICON_FA_BAR_CHART "##_INS%d",i); - break; - case DIV_INS_VIC: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_VIC]); - name=fmt::sprintf(ICON_FA_BAR_CHART "##_INS%d",i); - break; - case DIV_INS_PET: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_PET]); - name=fmt::sprintf(ICON_FA_SQUARE "##_INS%d",i); - break; - case DIV_INS_VRC6: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_VRC6]); - name=fmt::sprintf(ICON_FA_BAR_CHART "##_INS%d",i); - break; - case DIV_INS_VRC6_SAW: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_VRC6_SAW]); - name=fmt::sprintf(ICON_FA_BAR_CHART "##_INS%d",i); - break; - case DIV_INS_OPLL: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_OPLL]); - name=fmt::sprintf(ICON_FA_AREA_CHART "##_INS%d",i); - break; - case DIV_INS_OPL: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_OPL]); - name=fmt::sprintf(ICON_FA_AREA_CHART "##_INS%d",i); - break; - case DIV_INS_FDS: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_FDS]); - name=fmt::sprintf(ICON_FA_FLOPPY_O "##_INS%d",i); - break; - case DIV_INS_VBOY: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_VBOY]); - name=fmt::sprintf(ICON_FA_BINOCULARS "##_INS%d",i); - break; - case DIV_INS_N163: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_N163]); - name=fmt::sprintf(ICON_FA_CALCULATOR "##_INS%d",i); - break; - case DIV_INS_SCC: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_SCC]); - name=fmt::sprintf(ICON_FA_CALCULATOR "##_INS%d",i); - break; - case DIV_INS_OPZ: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_OPZ]); - name=fmt::sprintf(ICON_FA_AREA_CHART "##_INS%d",i); - break; - case DIV_INS_POKEY: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_POKEY]); - name=fmt::sprintf(ICON_FA_BAR_CHART "##_INS%d",i); - break; - case DIV_INS_BEEPER: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_BEEPER]); - name=fmt::sprintf(ICON_FA_SQUARE "##_INS%d",i); - break; - case DIV_INS_SWAN: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_SWAN]); - name=fmt::sprintf(ICON_FA_GAMEPAD "##_INS%d",i); - break; - case DIV_INS_MIKEY: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_MIKEY]); - name=fmt::sprintf(ICON_FA_BAR_CHART "##_INS%d",i); - break; - case DIV_INS_VERA: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_VERA]); - name=fmt::sprintf(ICON_FA_KEYBOARD_O "##_INS%d",i); - break; - case DIV_INS_X1_010: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_X1_010]); - name=fmt::sprintf(ICON_FA_BAR_CHART "##_INS%d",i); - break; - case DIV_INS_ES5506: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_ES5506]); - name=fmt::sprintf(ICON_FA_VOLUME_UP "##_INS%d",i); - break; - case DIV_INS_MULTIPCM: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_MULTIPCM]); - name=fmt::sprintf(ICON_FA_VOLUME_UP "##_INS%d",i); - break; - case DIV_INS_SNES: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_SNES]); - name=fmt::sprintf(ICON_FA_VOLUME_UP "##_INS%d",i); - break; - case DIV_INS_SU: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_SU]); - name=fmt::sprintf(ICON_FA_MICROCHIP "##_INS%d",i); - break; - case DIV_INS_NAMCO: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_NAMCO]); - name=fmt::sprintf(ICON_FA_PIE_CHART "##_INS%d",i); - break; - case DIV_INS_OPL_DRUMS: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_OPL_DRUMS]); - name=fmt::sprintf(ICON_FA_COFFEE "##_INS%d",i); - break; - case DIV_INS_OPM: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_OPM]); - name=fmt::sprintf(ICON_FA_AREA_CHART "##_INS%d",i); - break; - case DIV_INS_NES: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_NES]); - name=fmt::sprintf(ICON_FA_GAMEPAD "##_INS%d",i); - break; - case DIV_INS_MSM6258: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_MSM6258]); - name=fmt::sprintf(ICON_FA_VOLUME_UP "##_INS%d",i); - break; - case DIV_INS_MSM6295: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_MSM6295]); - name=fmt::sprintf(ICON_FA_VOLUME_UP "##_INS%d",i); - break; - case DIV_INS_ADPCMA: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_ADPCMA]); - name=fmt::sprintf(ICON_FA_VOLUME_UP "##_INS%d",i); - break; - case DIV_INS_ADPCMB: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_ADPCMB]); - name=fmt::sprintf(ICON_FA_VOLUME_UP "##_INS%d",i); - break; - case DIV_INS_SEGAPCM: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_SEGAPCM]); - name=fmt::sprintf(ICON_FA_VOLUME_UP "##_INS%d",i); - break; - case DIV_INS_QSOUND: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_QSOUND]); - name=fmt::sprintf(ICON_FA_VOLUME_UP "##_INS%d",i); - break; - case DIV_INS_YMZ280B: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_YMZ280B]); - name=fmt::sprintf(ICON_FA_VOLUME_UP "##_INS%d",i); - break; - case DIV_INS_RF5C68: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_RF5C68]); - name=fmt::sprintf(ICON_FA_VOLUME_UP "##_INS%d",i); - break; - case DIV_INS_MSM5232: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_MSM5232]); - name=fmt::sprintf(ICON_FA_BAR_CHART "##_INS%d",i); - break; - case DIV_INS_T6W28: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_T6W28]); - name=fmt::sprintf(ICON_FA_BAR_CHART "##_INS%d",i); - break; - case DIV_INS_K007232: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_K007232]); - name=fmt::sprintf(ICON_FA_BAR_CHART "##_INS%d",i); - break; - case DIV_INS_GA20: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_GA20]); - name=fmt::sprintf(ICON_FA_BAR_CHART "##_INS%d",i); - break; - case DIV_INS_POKEMINI: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_POKEMINI]); - name=fmt::sprintf(ICON_FA_BAR_CHART "##_INS%d",i); - break; - case DIV_INS_SM8521: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_SM8521]); - name=fmt::sprintf(ICON_FA_GAMEPAD "##_INS%d",i); - break; - case DIV_INS_PV1000: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_PV1000]); - name=fmt::sprintf(ICON_FA_GAMEPAD "##_INS%d",i); - break; - case DIV_INS_K053260: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_K053260]); - name=fmt::sprintf(ICON_FA_BAR_CHART "##_INS%d",i); - break; - case DIV_INS_TED: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_TED]); - name=fmt::sprintf(ICON_FA_BAR_CHART "##_INS%d",i); - break; - case DIV_INS_C140: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_C140]); - name=fmt::sprintf(ICON_FA_VOLUME_UP "##_INS%d",i); + case 2: + name=fmt::sprintf("%s##_INS%d",insIcon[2],i); break; default: - ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_UNKNOWN]); - name=fmt::sprintf(ICON_FA_QUESTION "##_INS%d",i); + name=fmt::sprintf("##_INS%d",i); break; } } else { diff --git a/src/gui/font_furicon.cpp b/src/gui/font_furicon.cpp index 26e1de55..c0a72d9e 100644 --- a/src/gui/font_furicon.cpp +++ b/src/gui/font_furicon.cpp @@ -1,7 +1,8 @@ +#include "fonts.h" // File: 'icons.ttf' (25980 bytes) // Exported using binary_to_compressed_c.cpp -static const unsigned int furIcons_compressed_size = 12613; -static const unsigned int furIcons_compressed_data[12616/4] = +const unsigned int furIcons_compressed_size = 12613; +const unsigned int furIcons_compressed_data[12616/4] = { 0x0000bc57, 0x00000000, 0x7c650000, 0x00000400, 0x00010037, 0x000e0000, 0x00030080, 0x54464660, 0xd753a24d, 0x650000e9, 0x28158260, 0x4544471c, 0x00150046, 0x200f8214, 0x2b0f8344, 0x322f534f, 0x6952fa8c, 0x68010000, 0x562c0f82, 0x70616d63, 0xb9c7ffcb, 0x48020000, 0xc82c1382, 0x20747663, diff --git a/src/gui/fonts.h b/src/gui/fonts.h index baaf1e59..25e186c0 100644 --- a/src/gui/fonts.h +++ b/src/gui/fonts.h @@ -40,6 +40,8 @@ extern const unsigned int font_unifont_compressed_size; extern const unsigned int font_unifont_compressed_data[]; extern const unsigned int iconFont_compressed_size; extern const unsigned int iconFont_compressed_data[]; +extern const unsigned int furIcons_compressed_size; +extern const unsigned int furIcons_compressed_data[]; extern const unsigned int* builtinFont[]; extern const unsigned int builtinFontLen[]; diff --git a/src/gui/furIcons.h b/src/gui/furIcons.h index 5e46d46f..4d2c948e 100644 --- a/src/gui/furIcons.h +++ b/src/gui/furIcons.h @@ -62,7 +62,7 @@ #define ICON_FUR_INS_SM8521 u8"\ue130" #define ICON_FUR_INS_PV1000 u8"\ue131" #define ICON_FUR_INS_K053260 u8"\ue132" -#define ICON_FUR_INS_YMF292 u8"\ue133" +#define ICON_FUR_INS_SCSP u8"\ue133" #define ICON_FUR_INS_TED u8"\ue134" #define ICON_FUR_INS_C140 u8"\ue135" diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index f55a4903..3369381d 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -5633,7 +5633,7 @@ bool FurnaceGUI::loop() { if (ImGui::BeginPopup("InsTypeList",ImGuiWindowFlags_NoMove|ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings)) { char temp[1024]; for (DivInstrumentType& i: makeInsTypeList) { - strncpy(temp,insTypes[i],1023); + strncpy(temp,insTypes[i][0],1023); if (ImGui::MenuItem(temp)) { // create ins curIns=e->addInstrument(-1,i); @@ -6883,6 +6883,7 @@ FurnaceGUI::FurnaceGUI(): learning(-1), mainFont(NULL), iconFont(NULL), + furIconFont(NULL), patFont(NULL), bigFont(NULL), headFont(NULL), diff --git a/src/gui/gui.h b/src/gui/gui.h index 29d61768..c722bf14 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -1385,6 +1385,7 @@ class FurnaceGUI { ImFont* mainFont; ImFont* iconFont; + ImFont* furIconFont; ImFont* patFont; ImFont* bigFont; ImFont* headFont; @@ -1551,6 +1552,7 @@ class FurnaceGUI { int insTypeMenu; int capitalMenuBar; int centerPopup; + int insIconsStyle; unsigned int maxUndoSteps; String mainFontPath; String headFontPath; @@ -1715,6 +1717,7 @@ class FurnaceGUI { insTypeMenu(1), capitalMenuBar(0), centerPopup(1), + insIconsStyle(1), maxUndoSteps(100), mainFontPath(""), headFontPath(""), diff --git a/src/gui/guiConst.cpp b/src/gui/guiConst.cpp index b5369a6c..bc9f5ff7 100644 --- a/src/gui/guiConst.cpp +++ b/src/gui/guiConst.cpp @@ -21,6 +21,8 @@ #include "gui.h" #include "guiConst.h" #include "../engine/song.h" +#include "IconsFontAwesome4.h" +#include "furIcons.h" const int opOrder[4]={ 0, 2, 1, 3 @@ -116,62 +118,63 @@ const int vgmVersions[7]={ 0x172 }; -const char* insTypes[DIV_INS_MAX+1]={ - "SN76489/Sega PSG", - "FM (OPN)", - "Game Boy", - "C64", - "Generic Sample", - "PC Engine", - "AY-3-8910/SSG", - "AY8930", - "TIA", - "SAA1099", - "VIC", - "PET", - "VRC6", - "FM (OPLL)", - "FM (OPL)", - "FDS", - "Virtual Boy", - "Namco 163", - "Konami SCC/Bubble System WSG", - "FM (OPZ)", - "POKEY", - "Beeper", - "WonderSwan", - "Atari Lynx", - "VERA", - "X1-010", - "VRC6 (saw)", - "ES5506", - "MultiPCM", - "SNES", - "Sound Unit", - "Namco WSG", - "OPL (drums)", - "FM (OPM)", - "NES", - "MSM6258", - "MSM6295", - "ADPCM-A", - "ADPCM-B", - "SegaPCM", - "QSound", - "YMZ280B", - "RF5C68", - "MSM5232", - "T6W28", - "K007232", - "GA20", - "Pokémon Mini/QuadTone", - "SM8521", - "PV-1000", - "K053260", - "SCSP", - "TED", - "C140", - NULL +// name, icon, letter icon +const char* insTypes[DIV_INS_MAX+1][3]={ + {"SN76489/Sega PSG",ICON_FA_AREA_CHART,ICON_FUR_INS_STD}, + {"FM (OPN)",ICON_FA_BAR_CHART,ICON_FUR_INS_FM}, + {"Game Boy",ICON_FA_GAMEPAD,ICON_FUR_INS_GB}, + {"C64",ICON_FA_KEYBOARD_O,ICON_FUR_INS_C64}, + {"Generic Sample",ICON_FA_VOLUME_UP,ICON_FUR_INS_AMIGA}, + {"PC Engine",ICON_FA_ID_BADGE,ICON_FUR_INS_PCE}, + {"AY-3-8910/SSG",ICON_FA_BAR_CHART,ICON_FUR_INS_AY}, + {"AY8930",ICON_FA_BAR_CHART,ICON_FUR_INS_AY8930}, + {"TIA",ICON_FA_BAR_CHART,ICON_FUR_INS_TIA}, + {"SAA1099",ICON_FA_BAR_CHART,ICON_FUR_INS_SAA1099}, + {"VIC",ICON_FA_BAR_CHART,ICON_FUR_INS_VIC}, + {"PET",ICON_FA_SQUARE,ICON_FUR_INS_PET}, + {"VRC6",ICON_FA_BAR_CHART,ICON_FUR_INS_VRC6}, + {"FM (OPLL)",ICON_FA_AREA_CHART,ICON_FUR_INS_OPLL}, + {"FM (OPL)",ICON_FA_AREA_CHART,ICON_FUR_INS_OPL}, + {"FDS",ICON_FA_FLOPPY_O,ICON_FUR_INS_FDS}, + {"Virtual Boy",ICON_FA_BINOCULARS,ICON_FUR_INS_VBOY}, + {"Namco 163",ICON_FA_CALCULATOR,ICON_FUR_INS_N163}, + {"Konami SCC/Bubble System WSG",ICON_FA_CALCULATOR,ICON_FUR_INS_SCC}, + {"FM (OPZ)",ICON_FA_AREA_CHART,ICON_FUR_INS_OPZ}, + {"POKEY",ICON_FA_BAR_CHART,ICON_FUR_INS_POKEY}, + {"Beeper",ICON_FA_SQUARE,ICON_FUR_INS_BEEPER}, + {"WonderSwan",ICON_FA_GAMEPAD,ICON_FUR_INS_SWAN}, + {"Atari Lynx",ICON_FA_BAR_CHART,ICON_FUR_INS_MIKEY}, + {"VERA",ICON_FA_KEYBOARD_O,ICON_FUR_INS_VERA}, + {"X1-010",ICON_FA_BAR_CHART,ICON_FUR_INS_X1_010}, + {"VRC6 (saw)",ICON_FA_BAR_CHART,ICON_FUR_INS_VRC6_SAW}, + {"ES5506",ICON_FA_VOLUME_UP,ICON_FUR_INS_ES5506}, + {"MultiPCM",ICON_FA_VOLUME_UP,ICON_FUR_INS_MULTIPCM}, + {"SNES",ICON_FA_VOLUME_UP,ICON_FUR_INS_SNES}, + {"Sound Unit",ICON_FA_MICROCHIP,ICON_FUR_INS_SU}, + {"Namco WSG",ICON_FA_PIE_CHART,ICON_FUR_INS_NAMCO}, + {"OPL (drums)",ICON_FA_COFFEE,ICON_FUR_INS_OPL_DRUMS}, + {"FM (OPM)",ICON_FA_AREA_CHART,ICON_FUR_INS_OPM}, + {"NES",ICON_FA_GAMEPAD,ICON_FUR_INS_NES}, + {"MSM6258",ICON_FA_VOLUME_UP,ICON_FUR_INS_MSM6258}, + {"MSM6295",ICON_FA_VOLUME_UP,ICON_FUR_INS_MSM6295}, + {"ADPCM-A",ICON_FA_VOLUME_UP,ICON_FUR_INS_ADPCMA}, + {"ADPCM-B",ICON_FA_VOLUME_UP,ICON_FUR_INS_ADPCMB}, + {"SegaPCM",ICON_FA_VOLUME_UP,ICON_FUR_INS_SEGAPCM}, + {"QSound",ICON_FA_VOLUME_UP,ICON_FUR_INS_QSOUND}, + {"YMZ280B",ICON_FA_VOLUME_UP,ICON_FUR_INS_YMZ280B}, + {"RF5C68",ICON_FA_VOLUME_UP,ICON_FUR_INS_RF5C68}, + {"MSM5232",ICON_FA_BAR_CHART,ICON_FUR_INS_MSM5232}, + {"T6W28",ICON_FA_BAR_CHART,ICON_FUR_INS_T6W28}, + {"K007232",ICON_FA_BAR_CHART,ICON_FUR_INS_K007232}, + {"GA20",ICON_FA_BAR_CHART,ICON_FUR_INS_GA20}, + {"Pokémon Mini/QuadTone",ICON_FA_BAR_CHART,ICON_FUR_INS_POKEMINI}, + {"SM8521",ICON_FA_GAMEPAD,ICON_FUR_INS_SM8521}, + {"PV-1000",ICON_FA_GAMEPAD,ICON_FUR_INS_PV1000}, + {"K053260",ICON_FA_BAR_CHART,ICON_FUR_INS_K053260}, + {"SCSP",ICON_FA_QUESTION,ICON_FUR_INS_SCSP}, + {"TED",ICON_FA_BAR_CHART,ICON_FUR_INS_TED}, + {"C140",ICON_FA_VOLUME_UP,ICON_FUR_INS_C140}, + {NULL,ICON_FA_QUESTION,ICON_FA_QUESTION} }; const char* sampleLoopModes[DIV_SAMPLE_LOOP_MAX]={ @@ -1255,3 +1258,9 @@ const char* chipCategoryNames[]={ "Sample", NULL }; + +// NORMAL, LETTER, +const char* insIcons[]={ + ICON_FA_AREA_CHART, + +}; \ No newline at end of file diff --git a/src/gui/guiConst.h b/src/gui/guiConst.h index 616692de..0695a601 100644 --- a/src/gui/guiConst.h +++ b/src/gui/guiConst.h @@ -41,7 +41,7 @@ extern const char* noteNamesG[180]; extern const char* noteNamesF[180]; extern const char* noteNamesGF[180]; extern const char* pitchLabel[11]; -extern const char* insTypes[]; +extern const char* insTypes[][3]; extern const char* sampleLoopModes[]; extern const char* sampleDepths[]; extern const char* resampleStrats[]; diff --git a/src/gui/insEdit.cpp b/src/gui/insEdit.cpp index 3ddb0a85..e68a17dc 100644 --- a/src/gui/insEdit.cpp +++ b/src/gui/insEdit.cpp @@ -2306,17 +2306,17 @@ void FurnaceGUI::drawInsEdit() { ins->type=(DivInstrumentType)insType; } */ - if (ImGui::BeginCombo("##Type",insTypes[insType])) { + if (ImGui::BeginCombo("##Type",insTypes[insType][0])) { std::vector insTypeList; if (settings.displayAllInsTypes) { - for (int i=0; insTypes[i]; i++) { + for (int i=0; insTypes[i][0]; i++) { insTypeList.push_back((DivInstrumentType)i); } } else { insTypeList=e->getPossibleInsTypes(); } for (DivInstrumentType i: insTypeList) { - if (ImGui::Selectable(insTypes[i],insType==i)) { + if (ImGui::Selectable(insTypes[i][0],insType==i)) { ins->type=i; // reset macro zoom diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index afcd13f1..7091fab0 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -27,6 +27,7 @@ #include "intConst.h" #include "ImGuiFileDialog.h" #include "IconsFontAwesome4.h" +#include "furIcons.h" #include "misc/cpp/imgui_stdlib.h" #include #include @@ -2312,6 +2313,19 @@ void FurnaceGUI::drawSettings() { } ImGui::EndDisabled(); + ImGui::Text("Instrument list icon style:"); + ImGui::Indent(); + if (ImGui::RadioButton("None##iis0",settings.insIconsStyle==0)) { + settings.insIconsStyle=0; + } + if (ImGui::RadioButton("Graphical icons##iis1",settings.insIconsStyle==1)) { + settings.insIconsStyle=1; + } + if (ImGui::RadioButton("Letter icons##iis2",settings.insIconsStyle==2)) { + settings.insIconsStyle=2; + } + ImGui::Unindent(); + bool insEditColorizeB=settings.insEditColorize; if (ImGui::Checkbox("Colorize instrument editor using instrument type",&insEditColorizeB)) { settings.insEditColorize=insEditColorizeB; @@ -3061,6 +3075,7 @@ void FurnaceGUI::syncSettings() { settings.insTypeMenu=e->getConfInt("insTypeMenu",1); settings.capitalMenuBar=e->getConfInt("capitalMenuBar",0); settings.centerPopup=e->getConfInt("centerPopup",1); + settings.insIconsStyle=e->getConfInt("insIconsStyle",1); clampSetting(settings.mainFontSize,2,96); clampSetting(settings.headFontSize,2,96); @@ -3198,6 +3213,7 @@ void FurnaceGUI::syncSettings() { clampSetting(settings.insTypeMenu,0,1); clampSetting(settings.capitalMenuBar,0,1); clampSetting(settings.centerPopup,0,1); + clampSetting(settings.insIconsStyle,0,1); if (settings.exportLoops<0.0) settings.exportLoops=0.0; if (settings.exportFadeOut<0.0) settings.exportFadeOut=0.0; @@ -3434,6 +3450,7 @@ void FurnaceGUI::commitSettings() { e->setConf("insTypeMenu",settings.insTypeMenu); e->setConf("capitalMenuBar",settings.capitalMenuBar); e->setConf("centerPopup",settings.centerPopup); + e->setConf("insIconsStyle",settings.insIconsStyle); // colors for (int i=0; iAddFontFromMemoryCompressedTTF(furIcons_compressed_data,furIcons_compressed_size,MAX(1,e->getConfInt("iconSize",16)*dpiScale),&fc,fontRangeFurIcon))==NULL) { + logE("could not load Furnace icons font!"); + } + if (settings.mainFontSize==settings.patFontSize && settings.patFont<5 && builtinFontM[settings.patFont]==builtinFont[settings.mainFont]) { logD("using main font for pat font."); patFont=mainFont;