Add Traditional Chinese and Korean support

This commit is contained in:
cam900 2022-08-26 08:49:08 +09:00
parent a7d0949eac
commit 3597e57bb2
2 changed files with 51 additions and 9 deletions

View File

@ -1085,7 +1085,9 @@ class FurnaceGUI {
int roundedButtons; int roundedButtons;
int roundedMenus; int roundedMenus;
int loadJapanese; int loadJapanese;
int loadChinese; int loadChineseSimplified;
int loadChineseTraditional;
int loadKorean;
int fmLayout; int fmLayout;
int sampleLayout; int sampleLayout;
int waveLayout; int waveLayout;
@ -1202,7 +1204,9 @@ class FurnaceGUI {
roundedButtons(1), roundedButtons(1),
roundedMenus(0), roundedMenus(0),
loadJapanese(0), loadJapanese(0),
loadChinese(0), loadChineseSimplified(0),
loadChineseTraditional(0),
loadKorean(0),
fmLayout(0), fmLayout(0),
sampleLayout(0), sampleLayout(0),
waveLayout(0), waveLayout(0),

View File

@ -1072,9 +1072,9 @@ void FurnaceGUI::drawSettings() {
); );
} }
bool loadChineseB=settings.loadChinese; bool loadChineseSimplifiedB=settings.loadChineseSimplified;
if (ImGui::Checkbox("Display Chinese (Simplified) characters",&loadChineseB)) { if (ImGui::Checkbox("Display Chinese (Simplified) characters",&loadChineseSimplifiedB)) {
settings.loadChinese=loadChineseB; settings.loadChineseSimplified=loadChineseSimplifiedB;
} }
if (ImGui::IsItemHovered()) { if (ImGui::IsItemHovered()) {
ImGui::SetTooltip( ImGui::SetTooltip(
@ -1085,6 +1085,32 @@ void FurnaceGUI::drawSettings() {
); );
} }
bool loadChineseTraditionalB=settings.loadChineseTraditional;
if (ImGui::Checkbox("Display Chinese (Traditional) characters",&loadChineseTraditionalB)) {
settings.loadChineseTraditional=loadChineseTraditionalB;
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip(
"Only toggle this option if you have enough graphics memory.\n"
"This is a temporary solution until dynamic font atlas is implemented in Dear ImGui.\n\n"
"請在確保你有足夠的顯存后再啟動此設定\n"
"這是一個在ImGui實現動態字體加載之前的臨時解決方案"
);
}
bool loadKoreanB=settings.loadKorean;
if (ImGui::Checkbox("Display Korean characters",&loadKoreanB)) {
settings.loadKorean=loadKoreanB;
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip(
"Only toggle this option if you have enough graphics memory.\n"
"This is a temporary solution until dynamic font atlas is implemented in Dear ImGui.\n\n"
"그래픽 메모리가 충분한 경우에만 이 옵션을 선택하십시오.\n"
"이 옵션은 Dear ImGui에 동적 글꼴 아틀라스가 구현될 때까지 임시 솔루션입니다."
);
}
ImGui::Separator(); ImGui::Separator();
ImGui::Text("Pattern view labels:"); ImGui::Text("Pattern view labels:");
@ -2170,7 +2196,9 @@ void FurnaceGUI::syncSettings() {
settings.roundedButtons=e->getConfInt("roundedButtons",1); settings.roundedButtons=e->getConfInt("roundedButtons",1);
settings.roundedMenus=e->getConfInt("roundedMenus",0); settings.roundedMenus=e->getConfInt("roundedMenus",0);
settings.loadJapanese=e->getConfInt("loadJapanese",0); settings.loadJapanese=e->getConfInt("loadJapanese",0);
settings.loadChinese=e->getConfInt("loadChinese",0); settings.loadChineseSimplified=e->getConfInt("loadChineseSimplified",0);
settings.loadChineseTraditional=e->getConfInt("loadChineseTraditional",0);
settings.loadKorean=e->getConfInt("loadKorean",0);
settings.fmLayout=e->getConfInt("fmLayout",0); settings.fmLayout=e->getConfInt("fmLayout",0);
settings.sampleLayout=e->getConfInt("sampleLayout",0); settings.sampleLayout=e->getConfInt("sampleLayout",0);
settings.waveLayout=e->getConfInt("waveLayout",0); settings.waveLayout=e->getConfInt("waveLayout",0);
@ -2274,7 +2302,9 @@ void FurnaceGUI::syncSettings() {
clampSetting(settings.roundedButtons,0,1); clampSetting(settings.roundedButtons,0,1);
clampSetting(settings.roundedMenus,0,1); clampSetting(settings.roundedMenus,0,1);
clampSetting(settings.loadJapanese,0,1); clampSetting(settings.loadJapanese,0,1);
clampSetting(settings.loadChinese,0,1); clampSetting(settings.loadChineseSimplified,0,1);
clampSetting(settings.loadChineseTraditional,0,1);
clampSetting(settings.loadKorean,0,1);
clampSetting(settings.fmLayout,0,6); clampSetting(settings.fmLayout,0,6);
clampSetting(settings.susPosition,0,1); clampSetting(settings.susPosition,0,1);
clampSetting(settings.effectCursorDir,0,2); clampSetting(settings.effectCursorDir,0,2);
@ -2413,7 +2443,9 @@ void FurnaceGUI::commitSettings() {
e->setConf("roundedButtons",settings.roundedButtons); e->setConf("roundedButtons",settings.roundedButtons);
e->setConf("roundedMenus",settings.roundedMenus); e->setConf("roundedMenus",settings.roundedMenus);
e->setConf("loadJapanese",settings.loadJapanese); e->setConf("loadJapanese",settings.loadJapanese);
e->setConf("loadChinese",settings.loadChinese); e->setConf("loadChineseSimplified",settings.loadChineseSimplified);
e->setConf("loadChineseTraditional",settings.loadChineseTraditional);
e->setConf("loadKorean",settings.loadKorean);
e->setConf("fmLayout",settings.fmLayout); e->setConf("fmLayout",settings.fmLayout);
e->setConf("sampleLayout",settings.sampleLayout); e->setConf("sampleLayout",settings.sampleLayout);
e->setConf("waveLayout",settings.waveLayout); e->setConf("waveLayout",settings.waveLayout);
@ -3061,9 +3093,15 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
if (settings.loadJapanese) { if (settings.loadJapanese) {
range.AddRanges(ImGui::GetIO().Fonts->GetGlyphRangesJapanese()); range.AddRanges(ImGui::GetIO().Fonts->GetGlyphRangesJapanese());
} }
if (settings.loadChinese) { if (settings.loadChineseSimplified) {
range.AddRanges(ImGui::GetIO().Fonts->GetGlyphRangesChineseSimplifiedCommon()); range.AddRanges(ImGui::GetIO().Fonts->GetGlyphRangesChineseSimplifiedCommon());
} }
if (settings.loadChineseTraditional) {
range.AddRanges(ImGui::GetIO().Fonts->GetGlyphRangesChineseFull());
}
if (settings.loadKorean) {
range.AddRanges(ImGui::GetIO().Fonts->GetGlyphRangesKorean());
}
// I'm terribly sorry // I'm terribly sorry
range.UsedChars[0x80>>5]=0; range.UsedChars[0x80>>5]=0;