we got custom icons

This commit is contained in:
tildearrow 2023-08-14 20:02:10 -05:00
parent 1848484831
commit 6ae8f615d9
12 changed files with 123 additions and 279 deletions

View File

@ -649,6 +649,7 @@ src/gui/font_proggyClean.cpp
src/gui/font_ptMono.cpp src/gui/font_ptMono.cpp
src/gui/font_unifont.cpp src/gui/font_unifont.cpp
src/gui/font_icon.cpp src/gui/font_icon.cpp
src/gui/font_furicon.cpp
src/gui/fonts.cpp src/gui/fonts.cpp
src/gui/image_icon.cpp src/gui/image_icon.cpp

View File

@ -1,9 +1,11 @@
#!/bin/bash #!/bin/bash
# run after exporting to .ttf # 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 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 g++ -o binary_to_compressed_c ../extern/imgui_patched/misc/fonts/binary_to_compressed_c.cpp || exit 1
fi 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 #xxd -i -n "furIcons" icons.ttf | sed -r "s/^ +//g;s/, /,/g;s/ = /=/g;s/unsigned/const unsigned/g" > ../src/gui/font_furIcons.cpp

View File

@ -76,223 +76,26 @@ void FurnaceGUI::insListItem(int i, int dir, int asset) {
const char* insType="Bug!"; const char* insType="Bug!";
if (i>=0 && i<e->song.insLen) { if (i>=0 && i<e->song.insLen) {
DivInstrument* ins=e->song.ins[i]; DivInstrument* ins=e->song.ins[i];
insType=(ins->type>DIV_INS_MAX)?"Unknown":insTypes[ins->type]; insType=(ins->type>DIV_INS_MAX)?"Unknown":insTypes[ins->type][0];
switch (ins->type) { const char** insIcon=NULL;
case DIV_INS_FM:
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_FM]); if (ins->type>=DIV_INS_MAX) {
name=fmt::sprintf(ICON_FA_AREA_CHART "##_INS%d",i); 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; break;
case DIV_INS_STD: case 2:
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_STD]); name=fmt::sprintf("%s##_INS%d",insIcon[2],i);
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);
break; break;
default: default:
ImGui::PushStyleColor(ImGuiCol_Text,uiColors[GUI_COLOR_INSTR_UNKNOWN]); name=fmt::sprintf("##_INS%d",i);
name=fmt::sprintf(ICON_FA_QUESTION "##_INS%d",i);
break; break;
} }
} else { } else {

View File

@ -1,7 +1,8 @@
#include "fonts.h"
// File: 'icons.ttf' (25980 bytes) // File: 'icons.ttf' (25980 bytes)
// Exported using binary_to_compressed_c.cpp // Exported using binary_to_compressed_c.cpp
static const unsigned int furIcons_compressed_size = 12613; const unsigned int furIcons_compressed_size = 12613;
static const unsigned int furIcons_compressed_data[12616/4] = const unsigned int furIcons_compressed_data[12616/4] =
{ {
0x0000bc57, 0x00000000, 0x7c650000, 0x00000400, 0x00010037, 0x000e0000, 0x00030080, 0x54464660, 0xd753a24d, 0x650000e9, 0x28158260, 0x4544471c, 0x0000bc57, 0x00000000, 0x7c650000, 0x00000400, 0x00010037, 0x000e0000, 0x00030080, 0x54464660, 0xd753a24d, 0x650000e9, 0x28158260, 0x4544471c,
0x00150046, 0x200f8214, 0x2b0f8344, 0x322f534f, 0x6952fa8c, 0x68010000, 0x562c0f82, 0x70616d63, 0xb9c7ffcb, 0x48020000, 0xc82c1382, 0x20747663, 0x00150046, 0x200f8214, 0x2b0f8344, 0x322f534f, 0x6952fa8c, 0x68010000, 0x562c0f82, 0x70616d63, 0xb9c7ffcb, 0x48020000, 0xc82c1382, 0x20747663,

View File

@ -40,6 +40,8 @@ extern const unsigned int font_unifont_compressed_size;
extern const unsigned int font_unifont_compressed_data[]; extern const unsigned int font_unifont_compressed_data[];
extern const unsigned int iconFont_compressed_size; extern const unsigned int iconFont_compressed_size;
extern const unsigned int iconFont_compressed_data[]; 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* builtinFont[];
extern const unsigned int builtinFontLen[]; extern const unsigned int builtinFontLen[];

View File

@ -62,7 +62,7 @@
#define ICON_FUR_INS_SM8521 u8"\ue130" #define ICON_FUR_INS_SM8521 u8"\ue130"
#define ICON_FUR_INS_PV1000 u8"\ue131" #define ICON_FUR_INS_PV1000 u8"\ue131"
#define ICON_FUR_INS_K053260 u8"\ue132" #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_TED u8"\ue134"
#define ICON_FUR_INS_C140 u8"\ue135" #define ICON_FUR_INS_C140 u8"\ue135"

View File

@ -5633,7 +5633,7 @@ bool FurnaceGUI::loop() {
if (ImGui::BeginPopup("InsTypeList",ImGuiWindowFlags_NoMove|ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings)) { if (ImGui::BeginPopup("InsTypeList",ImGuiWindowFlags_NoMove|ImGuiWindowFlags_AlwaysAutoResize|ImGuiWindowFlags_NoTitleBar|ImGuiWindowFlags_NoSavedSettings)) {
char temp[1024]; char temp[1024];
for (DivInstrumentType& i: makeInsTypeList) { for (DivInstrumentType& i: makeInsTypeList) {
strncpy(temp,insTypes[i],1023); strncpy(temp,insTypes[i][0],1023);
if (ImGui::MenuItem(temp)) { if (ImGui::MenuItem(temp)) {
// create ins // create ins
curIns=e->addInstrument(-1,i); curIns=e->addInstrument(-1,i);
@ -6883,6 +6883,7 @@ FurnaceGUI::FurnaceGUI():
learning(-1), learning(-1),
mainFont(NULL), mainFont(NULL),
iconFont(NULL), iconFont(NULL),
furIconFont(NULL),
patFont(NULL), patFont(NULL),
bigFont(NULL), bigFont(NULL),
headFont(NULL), headFont(NULL),

View File

@ -1385,6 +1385,7 @@ class FurnaceGUI {
ImFont* mainFont; ImFont* mainFont;
ImFont* iconFont; ImFont* iconFont;
ImFont* furIconFont;
ImFont* patFont; ImFont* patFont;
ImFont* bigFont; ImFont* bigFont;
ImFont* headFont; ImFont* headFont;
@ -1551,6 +1552,7 @@ class FurnaceGUI {
int insTypeMenu; int insTypeMenu;
int capitalMenuBar; int capitalMenuBar;
int centerPopup; int centerPopup;
int insIconsStyle;
unsigned int maxUndoSteps; unsigned int maxUndoSteps;
String mainFontPath; String mainFontPath;
String headFontPath; String headFontPath;
@ -1715,6 +1717,7 @@ class FurnaceGUI {
insTypeMenu(1), insTypeMenu(1),
capitalMenuBar(0), capitalMenuBar(0),
centerPopup(1), centerPopup(1),
insIconsStyle(1),
maxUndoSteps(100), maxUndoSteps(100),
mainFontPath(""), mainFontPath(""),
headFontPath(""), headFontPath(""),

View File

@ -21,6 +21,8 @@
#include "gui.h" #include "gui.h"
#include "guiConst.h" #include "guiConst.h"
#include "../engine/song.h" #include "../engine/song.h"
#include "IconsFontAwesome4.h"
#include "furIcons.h"
const int opOrder[4]={ const int opOrder[4]={
0, 2, 1, 3 0, 2, 1, 3
@ -116,62 +118,63 @@ const int vgmVersions[7]={
0x172 0x172
}; };
const char* insTypes[DIV_INS_MAX+1]={ // name, icon, letter icon
"SN76489/Sega PSG", const char* insTypes[DIV_INS_MAX+1][3]={
"FM (OPN)", {"SN76489/Sega PSG",ICON_FA_AREA_CHART,ICON_FUR_INS_STD},
"Game Boy", {"FM (OPN)",ICON_FA_BAR_CHART,ICON_FUR_INS_FM},
"C64", {"Game Boy",ICON_FA_GAMEPAD,ICON_FUR_INS_GB},
"Generic Sample", {"C64",ICON_FA_KEYBOARD_O,ICON_FUR_INS_C64},
"PC Engine", {"Generic Sample",ICON_FA_VOLUME_UP,ICON_FUR_INS_AMIGA},
"AY-3-8910/SSG", {"PC Engine",ICON_FA_ID_BADGE,ICON_FUR_INS_PCE},
"AY8930", {"AY-3-8910/SSG",ICON_FA_BAR_CHART,ICON_FUR_INS_AY},
"TIA", {"AY8930",ICON_FA_BAR_CHART,ICON_FUR_INS_AY8930},
"SAA1099", {"TIA",ICON_FA_BAR_CHART,ICON_FUR_INS_TIA},
"VIC", {"SAA1099",ICON_FA_BAR_CHART,ICON_FUR_INS_SAA1099},
"PET", {"VIC",ICON_FA_BAR_CHART,ICON_FUR_INS_VIC},
"VRC6", {"PET",ICON_FA_SQUARE,ICON_FUR_INS_PET},
"FM (OPLL)", {"VRC6",ICON_FA_BAR_CHART,ICON_FUR_INS_VRC6},
"FM (OPL)", {"FM (OPLL)",ICON_FA_AREA_CHART,ICON_FUR_INS_OPLL},
"FDS", {"FM (OPL)",ICON_FA_AREA_CHART,ICON_FUR_INS_OPL},
"Virtual Boy", {"FDS",ICON_FA_FLOPPY_O,ICON_FUR_INS_FDS},
"Namco 163", {"Virtual Boy",ICON_FA_BINOCULARS,ICON_FUR_INS_VBOY},
"Konami SCC/Bubble System WSG", {"Namco 163",ICON_FA_CALCULATOR,ICON_FUR_INS_N163},
"FM (OPZ)", {"Konami SCC/Bubble System WSG",ICON_FA_CALCULATOR,ICON_FUR_INS_SCC},
"POKEY", {"FM (OPZ)",ICON_FA_AREA_CHART,ICON_FUR_INS_OPZ},
"Beeper", {"POKEY",ICON_FA_BAR_CHART,ICON_FUR_INS_POKEY},
"WonderSwan", {"Beeper",ICON_FA_SQUARE,ICON_FUR_INS_BEEPER},
"Atari Lynx", {"WonderSwan",ICON_FA_GAMEPAD,ICON_FUR_INS_SWAN},
"VERA", {"Atari Lynx",ICON_FA_BAR_CHART,ICON_FUR_INS_MIKEY},
"X1-010", {"VERA",ICON_FA_KEYBOARD_O,ICON_FUR_INS_VERA},
"VRC6 (saw)", {"X1-010",ICON_FA_BAR_CHART,ICON_FUR_INS_X1_010},
"ES5506", {"VRC6 (saw)",ICON_FA_BAR_CHART,ICON_FUR_INS_VRC6_SAW},
"MultiPCM", {"ES5506",ICON_FA_VOLUME_UP,ICON_FUR_INS_ES5506},
"SNES", {"MultiPCM",ICON_FA_VOLUME_UP,ICON_FUR_INS_MULTIPCM},
"Sound Unit", {"SNES",ICON_FA_VOLUME_UP,ICON_FUR_INS_SNES},
"Namco WSG", {"Sound Unit",ICON_FA_MICROCHIP,ICON_FUR_INS_SU},
"OPL (drums)", {"Namco WSG",ICON_FA_PIE_CHART,ICON_FUR_INS_NAMCO},
"FM (OPM)", {"OPL (drums)",ICON_FA_COFFEE,ICON_FUR_INS_OPL_DRUMS},
"NES", {"FM (OPM)",ICON_FA_AREA_CHART,ICON_FUR_INS_OPM},
"MSM6258", {"NES",ICON_FA_GAMEPAD,ICON_FUR_INS_NES},
"MSM6295", {"MSM6258",ICON_FA_VOLUME_UP,ICON_FUR_INS_MSM6258},
"ADPCM-A", {"MSM6295",ICON_FA_VOLUME_UP,ICON_FUR_INS_MSM6295},
"ADPCM-B", {"ADPCM-A",ICON_FA_VOLUME_UP,ICON_FUR_INS_ADPCMA},
"SegaPCM", {"ADPCM-B",ICON_FA_VOLUME_UP,ICON_FUR_INS_ADPCMB},
"QSound", {"SegaPCM",ICON_FA_VOLUME_UP,ICON_FUR_INS_SEGAPCM},
"YMZ280B", {"QSound",ICON_FA_VOLUME_UP,ICON_FUR_INS_QSOUND},
"RF5C68", {"YMZ280B",ICON_FA_VOLUME_UP,ICON_FUR_INS_YMZ280B},
"MSM5232", {"RF5C68",ICON_FA_VOLUME_UP,ICON_FUR_INS_RF5C68},
"T6W28", {"MSM5232",ICON_FA_BAR_CHART,ICON_FUR_INS_MSM5232},
"K007232", {"T6W28",ICON_FA_BAR_CHART,ICON_FUR_INS_T6W28},
"GA20", {"K007232",ICON_FA_BAR_CHART,ICON_FUR_INS_K007232},
"Pokémon Mini/QuadTone", {"GA20",ICON_FA_BAR_CHART,ICON_FUR_INS_GA20},
"SM8521", {"Pokémon Mini/QuadTone",ICON_FA_BAR_CHART,ICON_FUR_INS_POKEMINI},
"PV-1000", {"SM8521",ICON_FA_GAMEPAD,ICON_FUR_INS_SM8521},
"K053260", {"PV-1000",ICON_FA_GAMEPAD,ICON_FUR_INS_PV1000},
"SCSP", {"K053260",ICON_FA_BAR_CHART,ICON_FUR_INS_K053260},
"TED", {"SCSP",ICON_FA_QUESTION,ICON_FUR_INS_SCSP},
"C140", {"TED",ICON_FA_BAR_CHART,ICON_FUR_INS_TED},
NULL {"C140",ICON_FA_VOLUME_UP,ICON_FUR_INS_C140},
{NULL,ICON_FA_QUESTION,ICON_FA_QUESTION}
}; };
const char* sampleLoopModes[DIV_SAMPLE_LOOP_MAX]={ const char* sampleLoopModes[DIV_SAMPLE_LOOP_MAX]={
@ -1255,3 +1258,9 @@ const char* chipCategoryNames[]={
"Sample", "Sample",
NULL NULL
}; };
// NORMAL, LETTER,
const char* insIcons[]={
ICON_FA_AREA_CHART,
};

View File

@ -41,7 +41,7 @@ extern const char* noteNamesG[180];
extern const char* noteNamesF[180]; extern const char* noteNamesF[180];
extern const char* noteNamesGF[180]; extern const char* noteNamesGF[180];
extern const char* pitchLabel[11]; extern const char* pitchLabel[11];
extern const char* insTypes[]; extern const char* insTypes[][3];
extern const char* sampleLoopModes[]; extern const char* sampleLoopModes[];
extern const char* sampleDepths[]; extern const char* sampleDepths[];
extern const char* resampleStrats[]; extern const char* resampleStrats[];

View File

@ -2306,17 +2306,17 @@ void FurnaceGUI::drawInsEdit() {
ins->type=(DivInstrumentType)insType; ins->type=(DivInstrumentType)insType;
} }
*/ */
if (ImGui::BeginCombo("##Type",insTypes[insType])) { if (ImGui::BeginCombo("##Type",insTypes[insType][0])) {
std::vector<DivInstrumentType> insTypeList; std::vector<DivInstrumentType> insTypeList;
if (settings.displayAllInsTypes) { if (settings.displayAllInsTypes) {
for (int i=0; insTypes[i]; i++) { for (int i=0; insTypes[i][0]; i++) {
insTypeList.push_back((DivInstrumentType)i); insTypeList.push_back((DivInstrumentType)i);
} }
} else { } else {
insTypeList=e->getPossibleInsTypes(); insTypeList=e->getPossibleInsTypes();
} }
for (DivInstrumentType i: insTypeList) { for (DivInstrumentType i: insTypeList) {
if (ImGui::Selectable(insTypes[i],insType==i)) { if (ImGui::Selectable(insTypes[i][0],insType==i)) {
ins->type=i; ins->type=i;
// reset macro zoom // reset macro zoom

View File

@ -27,6 +27,7 @@
#include "intConst.h" #include "intConst.h"
#include "ImGuiFileDialog.h" #include "ImGuiFileDialog.h"
#include "IconsFontAwesome4.h" #include "IconsFontAwesome4.h"
#include "furIcons.h"
#include "misc/cpp/imgui_stdlib.h" #include "misc/cpp/imgui_stdlib.h"
#include <fmt/printf.h> #include <fmt/printf.h>
#include <imgui.h> #include <imgui.h>
@ -2312,6 +2313,19 @@ void FurnaceGUI::drawSettings() {
} }
ImGui::EndDisabled(); 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; bool insEditColorizeB=settings.insEditColorize;
if (ImGui::Checkbox("Colorize instrument editor using instrument type",&insEditColorizeB)) { if (ImGui::Checkbox("Colorize instrument editor using instrument type",&insEditColorizeB)) {
settings.insEditColorize=insEditColorizeB; settings.insEditColorize=insEditColorizeB;
@ -3061,6 +3075,7 @@ void FurnaceGUI::syncSettings() {
settings.insTypeMenu=e->getConfInt("insTypeMenu",1); settings.insTypeMenu=e->getConfInt("insTypeMenu",1);
settings.capitalMenuBar=e->getConfInt("capitalMenuBar",0); settings.capitalMenuBar=e->getConfInt("capitalMenuBar",0);
settings.centerPopup=e->getConfInt("centerPopup",1); settings.centerPopup=e->getConfInt("centerPopup",1);
settings.insIconsStyle=e->getConfInt("insIconsStyle",1);
clampSetting(settings.mainFontSize,2,96); clampSetting(settings.mainFontSize,2,96);
clampSetting(settings.headFontSize,2,96); clampSetting(settings.headFontSize,2,96);
@ -3198,6 +3213,7 @@ void FurnaceGUI::syncSettings() {
clampSetting(settings.insTypeMenu,0,1); clampSetting(settings.insTypeMenu,0,1);
clampSetting(settings.capitalMenuBar,0,1); clampSetting(settings.capitalMenuBar,0,1);
clampSetting(settings.centerPopup,0,1); clampSetting(settings.centerPopup,0,1);
clampSetting(settings.insIconsStyle,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;
@ -3434,6 +3450,7 @@ void FurnaceGUI::commitSettings() {
e->setConf("insTypeMenu",settings.insTypeMenu); e->setConf("insTypeMenu",settings.insTypeMenu);
e->setConf("capitalMenuBar",settings.capitalMenuBar); e->setConf("capitalMenuBar",settings.capitalMenuBar);
e->setConf("centerPopup",settings.centerPopup); e->setConf("centerPopup",settings.centerPopup);
e->setConf("insIconsStyle",settings.insIconsStyle);
// colors // colors
for (int i=0; i<GUI_COLOR_MAX; i++) { for (int i=0; i<GUI_COLOR_MAX; i++) {
@ -4198,6 +4215,11 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
logE("could not load icon font!"); logE("could not load icon font!");
} }
static const ImWchar fontRangeFurIcon[]={ICON_MIN_FUR,ICON_MAX_FUR,0};
if ((furIconFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(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]) { if (settings.mainFontSize==settings.patFontSize && settings.patFont<5 && builtinFontM[settings.patFont]==builtinFont[settings.mainFont]) {
logD("using main font for pat font."); logD("using main font for pat font.");
patFont=mainFont; patFont=mainFont;