Add Custom Font option.

Mostly for proper Ukrainian support.
This commit is contained in:
StackZ
2020-11-11 02:48:05 +01:00
parent 0dc8369bff
commit cd24742621
22 changed files with 215 additions and 120 deletions
+10 -10
View File
@@ -40,20 +40,20 @@ void Overlays::ShowCredits() {
GFX::DrawTop();
GFX::DrawSprite(sprites_universal_updater_idx, 220, 30);
Gui::DrawStringCentered(0, 1, 0.7f, TEXT_COLOR, "Universal-Updater - " + Lang::get("CREDITS"));
Gui::DrawStringCentered(0, 1, 0.7f, TEXT_COLOR, "Universal-Updater - " + Lang::get("CREDITS"), 395, 0, font);
Gui::DrawString(10, 30, 0.5f, TEXT_COLOR, "- Universal-Team");
Gui::DrawString(10, 50, 0.5f, TEXT_COLOR, "- devkitPro");
Gui::DrawString(10, 70, 0.5f, TEXT_COLOR, "- dlbeer");
Gui::DrawString(10, 90, 0.5f, TEXT_COLOR, "- FlagBrew");
Gui::DrawString(10, 110, 0.5f, TEXT_COLOR, "- https://icons8.com/");
Gui::DrawString(10, 130, 0.5f, TEXT_COLOR, "- PabloMK7");
Gui::DrawString(10, 150, 0.5f, TEXT_COLOR, Lang::get("CONTRIBUTOR_TRANSLATORS"), 210);
Gui::DrawString(10, 197, 0.5f, TEXT_COLOR, Lang::get("GITHUB"), 390);
Gui::DrawString(10, 30, 0.5f, TEXT_COLOR, "- Universal-Team", 0, 0, font);
Gui::DrawString(10, 50, 0.5f, TEXT_COLOR, "- devkitPro", 0, 0, font);
Gui::DrawString(10, 70, 0.5f, TEXT_COLOR, "- dlbeer", 0, 0, font);
Gui::DrawString(10, 90, 0.5f, TEXT_COLOR, "- FlagBrew", 0, 0, font);
Gui::DrawString(10, 110, 0.5f, TEXT_COLOR, "- https://icons8.com/", 0, 0, font);
Gui::DrawString(10, 130, 0.5f, TEXT_COLOR, "- PabloMK7", 0, 0, font);
Gui::DrawString(10, 150, 0.5f, TEXT_COLOR, Lang::get("CONTRIBUTOR_TRANSLATORS"), 210, 0, font);
Gui::DrawString(10, 197, 0.5f, TEXT_COLOR, Lang::get("GITHUB"), 390, 0, font);
Gui::Draw_Rect(0, 215, 400, 25, BAR_COLOR);
Gui::Draw_Rect(0, 214, 400, 1, BAR_OUTL_COLOR);
Gui::DrawStringCentered(0, 218, 0.6f, TEXT_COLOR, Lang::get("CURRENT_VERSION") + std::string(V_STRING), 390);
Gui::DrawStringCentered(0, 218, 0.6f, TEXT_COLOR, Lang::get("CURRENT_VERSION") + std::string(V_STRING), 390, 0, font);
GFX::DrawBottom();
GFX::DrawSprite(sprites_universal_core_idx, 0, 26);
+4 -4
View File
@@ -82,22 +82,22 @@ std::string Overlays::SelectDir(const std::string &oldDir, const std::string &ms
GFX::DrawTop();
}
Gui::DrawStringCentered(0, 1, 0.7f, TEXT_COLOR, msg, 380);
Gui::DrawStringCentered(0, 1, 0.7f, TEXT_COLOR, msg, 380, 0, font);
Gui::Draw_Rect(0, 215, 400, 25, BAR_COLOR);
Gui::Draw_Rect(0, 214, 400, 1, BAR_OUTL_COLOR);
Gui::DrawStringCentered(0, 217, 0.6f, TEXT_COLOR, currentPath, 390);
Gui::DrawStringCentered(0, 217, 0.6f, TEXT_COLOR, currentPath, 390, 0, font);
GFX::DrawBottom();
Gui::Draw_Rect(0, 215, 320, 25, BAR_COLOR);
Gui::Draw_Rect(0, 214, 320, 1, BAR_OUTL_COLOR);
Gui::DrawStringCentered(0, 220, 0.5f, TEXT_COLOR, Lang::get("START_SELECT"), 310);
Gui::DrawStringCentered(0, 220, 0.5f, TEXT_COLOR, Lang::get("START_SELECT"), 310, 0, font);
if (dirContents.size() > 0) {
for(int i = 0; i < 7 && i < (int)dirContents.size(); i++) {
if (sPos + i == selection) GFX::DrawBox(mainButtons[i].x, mainButtons[i].y, mainButtons[i].w, mainButtons[i].h, false);
Gui::DrawStringCentered(10 - 160 + (300 / 2), mainButtons[i].y + 4, 0.45f, TEXT_COLOR, dirContents[sPos + i].name, 295);
Gui::DrawStringCentered(10 - 160 + (300 / 2), mainButtons[i].y + 4, 0.45f, TEXT_COLOR, dirContents[sPos + i].name, 295, 0, font);
}
}
+10 -10
View File
@@ -241,38 +241,38 @@ void Overlays::SelectStore(std::unique_ptr<Store> &store, std::vector<std::uniqu
if (info.size() > 0) {
if (info[selection].StoreSize != -1) {
Gui::DrawStringCentered(0, 1, 0.7f, TEXT_COLOR, info[selection].Title, 390);
Gui::DrawStringCentered(0, 30, 0.6f, TEXT_COLOR, info[selection].Author, 380);
Gui::DrawStringCentered(0, 1, 0.7f, TEXT_COLOR, info[selection].Title, 390, 0, font);
Gui::DrawStringCentered(0, 30, 0.6f, TEXT_COLOR, info[selection].Author, 380, 0, font);
if (info[selection].Description != "") {
/* "\n\n" breaks C2D_WordWrap, so check here. */
if (!(info[selection].Description.find("\n\n") != std::string::npos)) {
Gui::DrawStringCentered(0, 70, 0.5f, TEXT_COLOR, info[selection].Description, 380, 130, nullptr, C2D_WordWrap);
Gui::DrawStringCentered(0, 70, 0.5f, TEXT_COLOR, info[selection].Description, 380, 130, font, C2D_WordWrap);
} else {
Gui::DrawStringCentered(0, 70, 0.5f, TEXT_COLOR, info[selection].Description, 380, 130);
Gui::DrawStringCentered(0, 70, 0.5f, TEXT_COLOR, info[selection].Description, 380, 130, font);
}
}
} else {
Gui::DrawStringCentered(0, 1, 0.7f, TEXT_COLOR, Lang::get("INVALID_UNISTORE"), 390);
Gui::DrawStringCentered(0, 1, 0.7f, TEXT_COLOR, Lang::get("INVALID_UNISTORE"), 390, 0, font);
}
Gui::DrawString(10, 200, 0.4, TEXT_COLOR, "- " + Lang::get("ENTRIES") + ": " + std::to_string(info[selection].StoreSize), 150);
Gui::DrawString(10, 210, 0.4, TEXT_COLOR, "- " + Lang::get("VERSION") + ": " + std::to_string(info[selection].Version), 150);
Gui::DrawString(10, 220, 0.4, TEXT_COLOR, "- " + Lang::get("REVISION") + ": " + std::to_string(info[selection].Revision), 150);
Gui::DrawString(10, 200, 0.4, TEXT_COLOR, "- " + Lang::get("ENTRIES") + ": " + std::to_string(info[selection].StoreSize), 150, 0, font);
Gui::DrawString(10, 210, 0.4, TEXT_COLOR, "- " + Lang::get("VERSION") + ": " + std::to_string(info[selection].Version), 150, 0, font);
Gui::DrawString(10, 220, 0.4, TEXT_COLOR, "- " + Lang::get("REVISION") + ": " + std::to_string(info[selection].Revision), 150, 0, font);
GFX::DrawBottom();
Gui::Draw_Rect(0, 0, 320, 25, ENTRY_BAR_COLOR);
Gui::Draw_Rect(0, 25, 320, 1, ENTRY_BAR_OUTL_COLOR);
GFX::DrawSprite(sprites_arrow_idx, mainButtons[10].x, mainButtons[10].y);
Gui::DrawStringCentered(0, 2, 0.6, TEXT_COLOR, Lang::get("SELECT_UNISTORE_2"), 310);
Gui::DrawStringCentered(0, 2, 0.6, TEXT_COLOR, Lang::get("SELECT_UNISTORE_2"), 310, 0, font);
for(int i = 0; i < 6 && i < (int)info.size(); i++) {
if (sPos + i == selection) GFX::DrawBox(mainButtons[i].x, mainButtons[i].y, mainButtons[i].w, mainButtons[i].h, false);
Gui::DrawStringCentered(10 - 160 + (300 / 2), mainButtons[i].y + 4, 0.45f, TEXT_COLOR, info[sPos + i].FileName, 295);
Gui::DrawStringCentered(10 - 160 + (300 / 2), mainButtons[i].y + 4, 0.45f, TEXT_COLOR, info[sPos + i].FileName, 295, 0, font);
}
}