mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-25 15:55:40 +00:00
Added localization support to parts of the application
This commit is contained in:
parent
1700bb195c
commit
6b541ad501
|
@ -1,6 +1,6 @@
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
//
|
//
|
||||||
// ES-DE
|
// ES-DE Frontend
|
||||||
// FileSorts.cpp
|
// FileSorts.cpp
|
||||||
//
|
//
|
||||||
// Gamelist sorting functions.
|
// Gamelist sorting functions.
|
||||||
|
@ -10,6 +10,7 @@
|
||||||
#include "FileSorts.h"
|
#include "FileSorts.h"
|
||||||
|
|
||||||
#include "SystemData.h"
|
#include "SystemData.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
#include "utils/StringUtil.h"
|
#include "utils/StringUtil.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -274,4 +275,28 @@ namespace FileSorts
|
||||||
return system1.compare(system2) > 0;
|
return system1.compare(system2) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gettextMessageCatalogEntries()
|
||||||
|
{
|
||||||
|
_("name, ascending");
|
||||||
|
_("name, descending");
|
||||||
|
_("rating, ascending");
|
||||||
|
_("rating, descending");
|
||||||
|
_("release date, ascending");
|
||||||
|
_("release date, descending");
|
||||||
|
_("developer, ascending");
|
||||||
|
_("developer, descending");
|
||||||
|
_("publisher, ascending");
|
||||||
|
_("publisher, descending");
|
||||||
|
_("genre, ascending");
|
||||||
|
_("genre, descending");
|
||||||
|
_("players, ascending");
|
||||||
|
_("players, descending");
|
||||||
|
_("last played, ascending");
|
||||||
|
_("last played, descending");
|
||||||
|
_("times played, ascending");
|
||||||
|
_("times played, descending");
|
||||||
|
_("system, ascending");
|
||||||
|
_("system, descending");
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace FileSorts
|
} // namespace FileSorts
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
//
|
//
|
||||||
// ES-DE
|
// ES-DE Frontend
|
||||||
// FileSorts.h
|
// FileSorts.h
|
||||||
//
|
//
|
||||||
// Gamelist sorting functions.
|
// Gamelist sorting functions.
|
||||||
|
@ -37,6 +37,9 @@ namespace FileSorts
|
||||||
bool compareSystem(const FileData* file1, const FileData* file2);
|
bool compareSystem(const FileData* file1, const FileData* file2);
|
||||||
bool compareSystemDescending(const FileData* file1, const FileData* file2);
|
bool compareSystemDescending(const FileData* file1, const FileData* file2);
|
||||||
|
|
||||||
|
// This is just to get gettext msgid entries added to the PO message catalog files.
|
||||||
|
void gettextMessageCatalogEntries();
|
||||||
|
|
||||||
extern const std::vector<FileData::SortType> SortTypes;
|
extern const std::vector<FileData::SortType> SortTypes;
|
||||||
} // namespace FileSorts
|
} // namespace FileSorts
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
//
|
//
|
||||||
// ES-DE
|
// ES-DE Frontend
|
||||||
// GuiGamelistOptions.cpp
|
// GuiGamelistOptions.cpp
|
||||||
//
|
//
|
||||||
// Gamelist options menu for the 'Jump to...' quick selector,
|
// Gamelist options menu for the 'Jump to...' quick selector,
|
||||||
|
@ -27,12 +27,13 @@
|
||||||
#include "UIModeController.h"
|
#include "UIModeController.h"
|
||||||
#include "guis/GuiGamelistFilter.h"
|
#include "guis/GuiGamelistFilter.h"
|
||||||
#include "scrapers/Scraper.h"
|
#include "scrapers/Scraper.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
#include "views/ViewController.h"
|
#include "views/ViewController.h"
|
||||||
|
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
|
|
||||||
GuiGamelistOptions::GuiGamelistOptions(SystemData* system)
|
GuiGamelistOptions::GuiGamelistOptions(SystemData* system)
|
||||||
: mMenu {"GAMELIST OPTIONS"}
|
: mMenu {_("GAMELIST OPTIONS")}
|
||||||
, mSystem {system}
|
, mSystem {system}
|
||||||
, mFiltersChanged {false}
|
, mFiltersChanged {false}
|
||||||
, mCancelled {false}
|
, mCancelled {false}
|
||||||
|
@ -102,7 +103,7 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system)
|
||||||
mCurrentFirstCharacter = Utils::String::getFirstCharacter(file->getSortName());
|
mCurrentFirstCharacter = Utils::String::getFirstCharacter(file->getSortName());
|
||||||
}
|
}
|
||||||
|
|
||||||
mJumpToLetterList = std::make_shared<LetterList>(getHelpStyle(), "JUMP TO...", false);
|
mJumpToLetterList = std::make_shared<LetterList>(getHelpStyle(), _("JUMP TO.."), false);
|
||||||
|
|
||||||
// Enable key repeat so that the left or right button can be held to cycle through
|
// Enable key repeat so that the left or right button can be held to cycle through
|
||||||
// the letters.
|
// the letters.
|
||||||
|
@ -116,12 +117,12 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (system->getName() != "recent")
|
if (system->getName() != "recent")
|
||||||
mMenu.addWithLabel("JUMP TO..", mJumpToLetterList);
|
mMenu.addWithLabel(_("JUMP TO.."), mJumpToLetterList);
|
||||||
|
|
||||||
// Add the sorting entry, unless this is the grouped custom collections list.
|
// Add the sorting entry, unless this is the grouped custom collections list.
|
||||||
if (!mIsCustomCollectionGroup) {
|
if (!mIsCustomCollectionGroup) {
|
||||||
// Sort list by selected sort type (persistent throughout the program session).
|
// Sort list by selected sort type (persistent throughout the program session).
|
||||||
mListSort = std::make_shared<SortList>(getHelpStyle(), "SORT GAMES BY", false);
|
mListSort = std::make_shared<SortList>(getHelpStyle(), _("SORT GAMES BY"), false);
|
||||||
FileData* root {nullptr};
|
FileData* root {nullptr};
|
||||||
if (mIsCustomCollection)
|
if (mIsCustomCollection)
|
||||||
root = getGamelist()->getCursor()->getSystem()->getRootFolder();
|
root = getGamelist()->getCursor()->getSystem()->getRootFolder();
|
||||||
|
@ -137,9 +138,11 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system)
|
||||||
for (unsigned int i {0}; i < numSortTypes; ++i) {
|
for (unsigned int i {0}; i < numSortTypes; ++i) {
|
||||||
const FileData::SortType& sort {FileSorts::SortTypes.at(i)};
|
const FileData::SortType& sort {FileSorts::SortTypes.at(i)};
|
||||||
if (sort.description == sortType)
|
if (sort.description == sortType)
|
||||||
mListSort->add(sort.description, &sort, true);
|
mListSort->add(Utils::String::toUpper(_(sort.description.c_str())), &sort,
|
||||||
|
true);
|
||||||
else
|
else
|
||||||
mListSort->add(sort.description, &sort, false);
|
mListSort->add(Utils::String::toUpper(_(sort.description.c_str())), &sort,
|
||||||
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable key repeat so that the left or right button can be held to cycle through
|
// Enable key repeat so that the left or right button can be held to cycle through
|
||||||
|
@ -148,7 +151,7 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system)
|
||||||
|
|
||||||
// Don't show the sort type option if the gamelist type is recent/last played.
|
// Don't show the sort type option if the gamelist type is recent/last played.
|
||||||
if (system->getName() != "recent")
|
if (system->getName() != "recent")
|
||||||
mMenu.addWithLabel("SORT GAMES BY", mListSort);
|
mMenu.addWithLabel(_("SORT GAMES BY"), mListSort);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,8 +160,9 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system)
|
||||||
if (!mIsCustomCollectionGroup && system->getRootFolder()->getChildren().size() > 0) {
|
if (!mIsCustomCollectionGroup && system->getRootFolder()->getChildren().size() > 0) {
|
||||||
if (system->getName() != "recent" && Settings::getInstance()->getBool("GamelistFilters")) {
|
if (system->getName() != "recent" && Settings::getInstance()->getBool("GamelistFilters")) {
|
||||||
row.elements.clear();
|
row.elements.clear();
|
||||||
row.addElement(std::make_shared<TextComponent>(
|
row.addElement(std::make_shared<TextComponent>(_("FILTER GAMELIST"),
|
||||||
"FILTER GAMELIST", Font::get(FONT_SIZE_MEDIUM), mMenuColorPrimary),
|
Font::get(FONT_SIZE_MEDIUM),
|
||||||
|
mMenuColorPrimary),
|
||||||
true);
|
true);
|
||||||
row.addElement(mMenu.makeArrow(), false);
|
row.addElement(mMenu.makeArrow(), false);
|
||||||
row.makeAcceptInputHandler(std::bind(&GuiGamelistOptions::openGamelistFilter, this));
|
row.makeAcceptInputHandler(std::bind(&GuiGamelistOptions::openGamelistFilter, this));
|
||||||
|
@ -210,7 +214,7 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system)
|
||||||
if (UIModeController::getInstance()->isUIModeFull() && !mFromPlaceholder &&
|
if (UIModeController::getInstance()->isUIModeFull() && !mFromPlaceholder &&
|
||||||
!(mSystem->isCollection() && file->getType() == FOLDER)) {
|
!(mSystem->isCollection() && file->getType() == FOLDER)) {
|
||||||
row.elements.clear();
|
row.elements.clear();
|
||||||
row.addElement(std::make_shared<TextComponent>("EDIT THIS FOLDER'S METADATA",
|
row.addElement(std::make_shared<TextComponent>(_("EDIT THIS FOLDER'S METADATA"),
|
||||||
Font::get(FONT_SIZE_MEDIUM),
|
Font::get(FONT_SIZE_MEDIUM),
|
||||||
mMenuColorPrimary),
|
mMenuColorPrimary),
|
||||||
true);
|
true);
|
||||||
|
@ -223,7 +227,7 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system)
|
||||||
if (UIModeController::getInstance()->isUIModeFull() && !mFromPlaceholder &&
|
if (UIModeController::getInstance()->isUIModeFull() && !mFromPlaceholder &&
|
||||||
!(mSystem->isCollection() && file->getType() == FOLDER)) {
|
!(mSystem->isCollection() && file->getType() == FOLDER)) {
|
||||||
row.elements.clear();
|
row.elements.clear();
|
||||||
row.addElement(std::make_shared<TextComponent>("EDIT THIS GAME'S METADATA",
|
row.addElement(std::make_shared<TextComponent>(_("EDIT THIS GAME'S METADATA"),
|
||||||
Font::get(FONT_SIZE_MEDIUM),
|
Font::get(FONT_SIZE_MEDIUM),
|
||||||
mMenuColorPrimary),
|
mMenuColorPrimary),
|
||||||
true);
|
true);
|
||||||
|
@ -256,8 +260,8 @@ GuiGamelistOptions::GuiGamelistOptions(SystemData* system)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mMenu.addButton("APPLY", "apply", [&] { delete this; });
|
mMenu.addButton(_("APPLY"), _("APPLY"), [&] { delete this; });
|
||||||
mMenu.addButton("CANCEL", "cancel", [&] {
|
mMenu.addButton(_("CANCEL"), _("CANCEL"), [&] {
|
||||||
mCancelled = true;
|
mCancelled = true;
|
||||||
delete this;
|
delete this;
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// SPDX-License-Identifier: MIT
|
// SPDX-License-Identifier: MIT
|
||||||
//
|
//
|
||||||
// ES-DE
|
// ES-DE Frontend
|
||||||
// GuiGamelistOptions.h
|
// GuiGamelistOptions.h
|
||||||
//
|
//
|
||||||
// Gamelist options menu for the 'Jump to...' quick selector,
|
// Gamelist options menu for the 'Jump to...' quick selector,
|
||||||
|
|
|
@ -55,39 +55,39 @@ GuiMenu::GuiMenu()
|
||||||
const bool isFullUI {UIModeController::getInstance()->isUIModeFull()};
|
const bool isFullUI {UIModeController::getInstance()->isUIModeFull()};
|
||||||
|
|
||||||
if (isFullUI)
|
if (isFullUI)
|
||||||
addEntry("SCRAPER", mMenuColorPrimary, true, [this] { openScraperOptions(); });
|
addEntry(_("SCRAPER"), mMenuColorPrimary, true, [this] { openScraperOptions(); });
|
||||||
|
|
||||||
if (isFullUI)
|
if (isFullUI)
|
||||||
addEntry("UI SETTINGS", mMenuColorPrimary, true, [this] { openUIOptions(); });
|
addEntry(_("UI SETTINGS"), mMenuColorPrimary, true, [this] { openUIOptions(); });
|
||||||
|
|
||||||
addEntry("SOUND SETTINGS", mMenuColorPrimary, true, [this] { openSoundOptions(); });
|
addEntry(_("SOUND SETTINGS"), mMenuColorPrimary, true, [this] { openSoundOptions(); });
|
||||||
|
|
||||||
if (isFullUI)
|
if (isFullUI)
|
||||||
addEntry("INPUT DEVICE SETTINGS", mMenuColorPrimary, true,
|
addEntry(_("INPUT DEVICE SETTINGS"), mMenuColorPrimary, true,
|
||||||
[this] { openInputDeviceOptions(); });
|
[this] { openInputDeviceOptions(); });
|
||||||
|
|
||||||
if (isFullUI)
|
if (isFullUI)
|
||||||
addEntry("GAME COLLECTION SETTINGS", mMenuColorPrimary, true,
|
addEntry(_("GAME COLLECTION SETTINGS"), mMenuColorPrimary, true,
|
||||||
[this] { openCollectionSystemOptions(); });
|
[this] { openCollectionSystemOptions(); });
|
||||||
|
|
||||||
if (isFullUI)
|
if (isFullUI)
|
||||||
addEntry("OTHER SETTINGS", mMenuColorPrimary, true, [this] { openOtherOptions(); });
|
addEntry(_("OTHER SETTINGS"), mMenuColorPrimary, true, [this] { openOtherOptions(); });
|
||||||
|
|
||||||
if (isFullUI)
|
if (isFullUI)
|
||||||
addEntry("UTILITIES", mMenuColorPrimary, true, [this] { openUtilities(); });
|
addEntry(_("UTILITIES"), mMenuColorPrimary, true, [this] { openUtilities(); });
|
||||||
|
|
||||||
if (!Settings::getInstance()->getBool("ForceKiosk") &&
|
if (!Settings::getInstance()->getBool("ForceKiosk") &&
|
||||||
Settings::getInstance()->getString("UIMode") != "kiosk") {
|
Settings::getInstance()->getString("UIMode") != "kiosk") {
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
addEntry("QUIT ES-DE", mMenuColorPrimary, false, [this] { openQuitMenu(); });
|
addEntry(_("QUIT ES-DE"), mMenuColorPrimary, false, [this] { openQuitMenu(); });
|
||||||
#elif defined(__ANDROID__)
|
#elif defined(__ANDROID__)
|
||||||
if (!AndroidVariables::sIsHomeApp)
|
if (!AndroidVariables::sIsHomeApp)
|
||||||
addEntry("QUIT ES-DE", mMenuColorPrimary, false, [this] { openQuitMenu(); });
|
addEntry(_("QUIT ES-DE"), mMenuColorPrimary, false, [this] { openQuitMenu(); });
|
||||||
#else
|
#else
|
||||||
if (Settings::getInstance()->getBool("ShowQuitMenu"))
|
if (Settings::getInstance()->getBool("ShowQuitMenu"))
|
||||||
addEntry("QUIT", mMenuColorPrimary, true, [this] { openQuitMenu(); });
|
addEntry(_("QUIT"), mMenuColorPrimary, true, [this] { openQuitMenu(); });
|
||||||
else
|
else
|
||||||
addEntry("QUIT ES-DE", mMenuColorPrimary, false, [this] { openQuitMenu(); });
|
addEntry(_("QUIT ES-DE"), mMenuColorPrimary, false, [this] { openQuitMenu(); });
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,12 +113,12 @@ GuiMenu::~GuiMenu()
|
||||||
void GuiMenu::openScraperOptions()
|
void GuiMenu::openScraperOptions()
|
||||||
{
|
{
|
||||||
// Open the scraper menu.
|
// Open the scraper menu.
|
||||||
mWindow->pushGui(new GuiScraperMenu("SCRAPER"));
|
mWindow->pushGui(new GuiScraperMenu(_("SCRAPER")));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiMenu::openUIOptions()
|
void GuiMenu::openUIOptions()
|
||||||
{
|
{
|
||||||
auto s = new GuiSettings("UI SETTINGS");
|
auto s = new GuiSettings(_("UI SETTINGS"));
|
||||||
|
|
||||||
// Theme options section.
|
// Theme options section.
|
||||||
|
|
||||||
|
@ -127,11 +127,12 @@ void GuiMenu::openUIOptions()
|
||||||
std::map<std::string, ThemeData::Theme, ThemeData::StringComparator>::const_iterator
|
std::map<std::string, ThemeData::Theme, ThemeData::StringComparator>::const_iterator
|
||||||
selectedTheme;
|
selectedTheme;
|
||||||
|
|
||||||
auto theme = std::make_shared<OptionListComponent<std::string>>(getHelpStyle(), "THEME", false);
|
auto theme =
|
||||||
|
std::make_shared<OptionListComponent<std::string>>(getHelpStyle(), _("THEME"), false);
|
||||||
|
|
||||||
ComponentListRow themeDownloaderInputRow;
|
ComponentListRow themeDownloaderInputRow;
|
||||||
themeDownloaderInputRow.elements.clear();
|
themeDownloaderInputRow.elements.clear();
|
||||||
themeDownloaderInputRow.addElement(std::make_shared<TextComponent>("THEME DOWNLOADER",
|
themeDownloaderInputRow.addElement(std::make_shared<TextComponent>(_("THEME DOWNLOADER"),
|
||||||
Font::get(FONT_SIZE_MEDIUM),
|
Font::get(FONT_SIZE_MEDIUM),
|
||||||
mMenuColorPrimary),
|
mMenuColorPrimary),
|
||||||
true);
|
true);
|
||||||
|
@ -165,7 +166,7 @@ void GuiMenu::openUIOptions()
|
||||||
theme->add(themeName, it->second.first, (*it).second.first == selectedTheme->first,
|
theme->add(themeName, it->second.first, (*it).second.first == selectedTheme->first,
|
||||||
maxNameLength);
|
maxNameLength);
|
||||||
}
|
}
|
||||||
s->addWithLabel("THEME", theme);
|
s->addWithLabel(_("THEME"), theme);
|
||||||
s->addSaveFunc([this, theme, s] {
|
s->addSaveFunc([this, theme, s] {
|
||||||
if (theme->getSelected() != Settings::getInstance()->getString("Theme")) {
|
if (theme->getSelected() != Settings::getInstance()->getString("Theme")) {
|
||||||
Scripting::fireEvent("theme-changed", theme->getSelected(),
|
Scripting::fireEvent("theme-changed", theme->getSelected(),
|
||||||
|
@ -198,9 +199,9 @@ void GuiMenu::openUIOptions()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Theme variants.
|
// Theme variants.
|
||||||
auto themeVariant =
|
auto themeVariant = std::make_shared<OptionListComponent<std::string>>(
|
||||||
std::make_shared<OptionListComponent<std::string>>(getHelpStyle(), "THEME VARIANT", false);
|
getHelpStyle(), _("THEME VARIANT"), false);
|
||||||
s->addWithLabel("THEME VARIANT", themeVariant);
|
s->addWithLabel(_("THEME VARIANT"), themeVariant);
|
||||||
s->addSaveFunc([themeVariant, s] {
|
s->addSaveFunc([themeVariant, s] {
|
||||||
if (themeVariant->getSelected() != Settings::getInstance()->getString("ThemeVariant")) {
|
if (themeVariant->getSelected() != Settings::getInstance()->getString("ThemeVariant")) {
|
||||||
Settings::getInstance()->setString("ThemeVariant", themeVariant->getSelected());
|
Settings::getInstance()->setString("ThemeVariant", themeVariant->getSelected());
|
||||||
|
@ -229,15 +230,15 @@ void GuiMenu::openUIOptions()
|
||||||
// If required, abbreviate the variant name so it doesn't overlap the
|
// If required, abbreviate the variant name so it doesn't overlap the
|
||||||
// setting name.
|
// setting name.
|
||||||
const float maxNameLength {mSize.x * 0.62f};
|
const float maxNameLength {mSize.x * 0.62f};
|
||||||
themeVariant->add(variant.label, variant.name, variant.name == selectedVariant,
|
themeVariant->add(Utils::String::toUpper(variant.label), variant.name,
|
||||||
maxNameLength);
|
variant.name == selectedVariant, maxNameLength);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (themeVariant->getSelectedObjects().size() == 0)
|
if (themeVariant->getSelectedObjects().size() == 0)
|
||||||
themeVariant->selectEntry(0);
|
themeVariant->selectEntry(0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
themeVariant->add("None defined", "none", true);
|
themeVariant->add(_("NONE DEFINED"), "none", true);
|
||||||
themeVariant->setEnabled(false);
|
themeVariant->setEnabled(false);
|
||||||
themeVariant->setOpacity(DISABLED_OPACITY);
|
themeVariant->setOpacity(DISABLED_OPACITY);
|
||||||
themeVariant->getParent()
|
themeVariant->getParent()
|
||||||
|
@ -251,8 +252,8 @@ void GuiMenu::openUIOptions()
|
||||||
|
|
||||||
// Theme color schemes.
|
// Theme color schemes.
|
||||||
auto themeColorScheme = std::make_shared<OptionListComponent<std::string>>(
|
auto themeColorScheme = std::make_shared<OptionListComponent<std::string>>(
|
||||||
getHelpStyle(), "THEME COLOR SCHEME", false);
|
getHelpStyle(), _("THEME COLOR SCHEME"), false);
|
||||||
s->addWithLabel("THEME COLOR SCHEME", themeColorScheme);
|
s->addWithLabel(_("THEME COLOR SCHEME"), themeColorScheme);
|
||||||
s->addSaveFunc([themeColorScheme, s] {
|
s->addSaveFunc([themeColorScheme, s] {
|
||||||
if (themeColorScheme->getSelected() !=
|
if (themeColorScheme->getSelected() !=
|
||||||
Settings::getInstance()->getString("ThemeColorScheme")) {
|
Settings::getInstance()->getString("ThemeColorScheme")) {
|
||||||
|
@ -276,14 +277,14 @@ void GuiMenu::openUIOptions()
|
||||||
// If required, abbreviate the color scheme name so it doesn't overlap the
|
// If required, abbreviate the color scheme name so it doesn't overlap the
|
||||||
// setting name.
|
// setting name.
|
||||||
const float maxNameLength {mSize.x * 0.52f};
|
const float maxNameLength {mSize.x * 0.52f};
|
||||||
themeColorScheme->add(colorScheme.label, colorScheme.name,
|
themeColorScheme->add(Utils::String::toUpper(colorScheme.label), colorScheme.name,
|
||||||
colorScheme.name == selectedColorScheme, maxNameLength);
|
colorScheme.name == selectedColorScheme, maxNameLength);
|
||||||
}
|
}
|
||||||
if (themeColorScheme->getSelectedObjects().size() == 0)
|
if (themeColorScheme->getSelectedObjects().size() == 0)
|
||||||
themeColorScheme->selectEntry(0);
|
themeColorScheme->selectEntry(0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
themeColorScheme->add("None defined", "none", true);
|
themeColorScheme->add(_("NONE DEFINED"), "none", true);
|
||||||
themeColorScheme->setEnabled(false);
|
themeColorScheme->setEnabled(false);
|
||||||
themeColorScheme->setOpacity(DISABLED_OPACITY);
|
themeColorScheme->setOpacity(DISABLED_OPACITY);
|
||||||
themeColorScheme->getParent()
|
themeColorScheme->getParent()
|
||||||
|
@ -297,8 +298,8 @@ void GuiMenu::openUIOptions()
|
||||||
|
|
||||||
// Theme font sizes.
|
// Theme font sizes.
|
||||||
auto themeFontSize = std::make_shared<OptionListComponent<std::string>>(
|
auto themeFontSize = std::make_shared<OptionListComponent<std::string>>(
|
||||||
getHelpStyle(), "THEME FONT SIZE", false);
|
getHelpStyle(), _("THEME FONT SIZE"), false);
|
||||||
s->addWithLabel("THEME FONT SIZE", themeFontSize);
|
s->addWithLabel(_("THEME FONT SIZE"), themeFontSize);
|
||||||
s->addSaveFunc([themeFontSize, s] {
|
s->addSaveFunc([themeFontSize, s] {
|
||||||
if (themeFontSize->getSelected() != Settings::getInstance()->getString("ThemeFontSize")) {
|
if (themeFontSize->getSelected() != Settings::getInstance()->getString("ThemeFontSize")) {
|
||||||
Settings::getInstance()->setString("ThemeFontSize", themeFontSize->getSelected());
|
Settings::getInstance()->setString("ThemeFontSize", themeFontSize->getSelected());
|
||||||
|
@ -318,13 +319,14 @@ void GuiMenu::openUIOptions()
|
||||||
themeFontSize->clearEntries();
|
themeFontSize->clearEntries();
|
||||||
if (currentSet->second.capabilities.fontSizes.size() > 0) {
|
if (currentSet->second.capabilities.fontSizes.size() > 0) {
|
||||||
for (auto& fontSize : currentSet->second.capabilities.fontSizes)
|
for (auto& fontSize : currentSet->second.capabilities.fontSizes)
|
||||||
themeFontSize->add(ThemeData::getFontSizeLabel(fontSize), fontSize,
|
themeFontSize->add(
|
||||||
fontSize == selectedFontSize);
|
Utils::String::toUpper(_(ThemeData::getFontSizeLabel(fontSize).c_str())),
|
||||||
|
fontSize, fontSize == selectedFontSize);
|
||||||
if (themeFontSize->getSelectedObjects().size() == 0)
|
if (themeFontSize->getSelectedObjects().size() == 0)
|
||||||
themeFontSize->selectEntry(0);
|
themeFontSize->selectEntry(0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
themeFontSize->add("None defined", "none", true);
|
themeFontSize->add(_("NONE DEFINED"), "none", true);
|
||||||
themeFontSize->setEnabled(false);
|
themeFontSize->setEnabled(false);
|
||||||
themeFontSize->setOpacity(DISABLED_OPACITY);
|
themeFontSize->setOpacity(DISABLED_OPACITY);
|
||||||
themeFontSize->getParent()
|
themeFontSize->getParent()
|
||||||
|
@ -338,8 +340,8 @@ void GuiMenu::openUIOptions()
|
||||||
|
|
||||||
// Theme aspect ratios.
|
// Theme aspect ratios.
|
||||||
auto themeAspectRatio = std::make_shared<OptionListComponent<std::string>>(
|
auto themeAspectRatio = std::make_shared<OptionListComponent<std::string>>(
|
||||||
getHelpStyle(), "THEME ASPECT RATIO", false);
|
getHelpStyle(), _("THEME ASPECT RATIO"), false);
|
||||||
s->addWithLabel("THEME ASPECT RATIO", themeAspectRatio);
|
s->addWithLabel(_("THEME ASPECT RATIO"), themeAspectRatio);
|
||||||
s->addSaveFunc([themeAspectRatio, s] {
|
s->addSaveFunc([themeAspectRatio, s] {
|
||||||
if (themeAspectRatio->getSelected() !=
|
if (themeAspectRatio->getSelected() !=
|
||||||
Settings::getInstance()->getString("ThemeAspectRatio")) {
|
Settings::getInstance()->getString("ThemeAspectRatio")) {
|
||||||
|
@ -359,14 +361,16 @@ void GuiMenu::openUIOptions()
|
||||||
// We need to recreate the OptionListComponent entries.
|
// We need to recreate the OptionListComponent entries.
|
||||||
themeAspectRatio->clearEntries();
|
themeAspectRatio->clearEntries();
|
||||||
if (currentSet->second.capabilities.aspectRatios.size() > 0) {
|
if (currentSet->second.capabilities.aspectRatios.size() > 0) {
|
||||||
for (auto& aspectRatio : currentSet->second.capabilities.aspectRatios)
|
for (auto& aspectRatio : currentSet->second.capabilities.aspectRatios) {
|
||||||
themeAspectRatio->add(ThemeData::getAspectRatioLabel(aspectRatio), aspectRatio,
|
themeAspectRatio->add(
|
||||||
aspectRatio == selectedAspectRatio);
|
Utils::String::toUpper(_(ThemeData::getAspectRatioLabel(aspectRatio).c_str())),
|
||||||
|
aspectRatio, aspectRatio == selectedAspectRatio);
|
||||||
|
}
|
||||||
if (themeAspectRatio->getSelectedObjects().size() == 0)
|
if (themeAspectRatio->getSelectedObjects().size() == 0)
|
||||||
themeAspectRatio->selectEntry(0);
|
themeAspectRatio->selectEntry(0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
themeAspectRatio->add("None defined", "none", true);
|
themeAspectRatio->add(_("NONE DEFINED"), "none", true);
|
||||||
themeAspectRatio->setEnabled(false);
|
themeAspectRatio->setEnabled(false);
|
||||||
themeAspectRatio->setOpacity(DISABLED_OPACITY);
|
themeAspectRatio->setOpacity(DISABLED_OPACITY);
|
||||||
themeAspectRatio->getParent()
|
themeAspectRatio->getParent()
|
||||||
|
@ -380,14 +384,14 @@ void GuiMenu::openUIOptions()
|
||||||
|
|
||||||
// Theme transitions.
|
// Theme transitions.
|
||||||
auto themeTransitions = std::make_shared<OptionListComponent<std::string>>(
|
auto themeTransitions = std::make_shared<OptionListComponent<std::string>>(
|
||||||
getHelpStyle(), "THEME TRANSITIONS", false);
|
getHelpStyle(), _("THEME TRANSITIONS"), false);
|
||||||
std::string selectedThemeTransitions {Settings::getInstance()->getString("ThemeTransitions")};
|
std::string selectedThemeTransitions {Settings::getInstance()->getString("ThemeTransitions")};
|
||||||
themeTransitions->add("AUTOMATIC", "automatic", selectedThemeTransitions == "automatic");
|
themeTransitions->add(_("AUTOMATIC"), "automatic", selectedThemeTransitions == "automatic");
|
||||||
// If there are no objects returned, then there must be a manually modified entry in the
|
// If there are no objects returned, then there must be a manually modified entry in the
|
||||||
// configuration file. Simply set theme transitions to "automatic" in this case.
|
// configuration file. Simply set theme transitions to "automatic" in this case.
|
||||||
if (themeTransitions->getSelectedObjects().size() == 0)
|
if (themeTransitions->getSelectedObjects().size() == 0)
|
||||||
themeTransitions->selectEntry(0);
|
themeTransitions->selectEntry(0);
|
||||||
s->addWithLabel("THEME TRANSITIONS", themeTransitions);
|
s->addWithLabel(_("THEME TRANSITIONS"), themeTransitions);
|
||||||
s->addSaveFunc([themeTransitions, s] {
|
s->addSaveFunc([themeTransitions, s] {
|
||||||
if (themeTransitions->getSelected() !=
|
if (themeTransitions->getSelected() !=
|
||||||
Settings::getInstance()->getString("ThemeTransitions")) {
|
Settings::getInstance()->getString("ThemeTransitions")) {
|
||||||
|
@ -405,12 +409,12 @@ void GuiMenu::openUIOptions()
|
||||||
return;
|
return;
|
||||||
// We need to recreate the OptionListComponent entries.
|
// We need to recreate the OptionListComponent entries.
|
||||||
themeTransitions->clearEntries();
|
themeTransitions->clearEntries();
|
||||||
themeTransitions->add("AUTOMATIC", "automatic", "automatic" == selectedThemeTransitions);
|
themeTransitions->add(_("AUTOMATIC"), "automatic", "automatic" == selectedThemeTransitions);
|
||||||
if (currentSet->second.capabilities.transitions.size() == 1 &&
|
if (currentSet->second.capabilities.transitions.size() == 1 &&
|
||||||
currentSet->second.capabilities.transitions.front().selectable) {
|
currentSet->second.capabilities.transitions.front().selectable) {
|
||||||
std::string label;
|
std::string label;
|
||||||
if (currentSet->second.capabilities.transitions.front().label == "")
|
if (currentSet->second.capabilities.transitions.front().label == "")
|
||||||
label = "THEME PROFILE";
|
label = _("THEME PROFILE");
|
||||||
else
|
else
|
||||||
label = currentSet->second.capabilities.transitions.front().label;
|
label = currentSet->second.capabilities.transitions.front().label;
|
||||||
const std::string transitions {
|
const std::string transitions {
|
||||||
|
@ -423,7 +427,7 @@ void GuiMenu::openUIOptions()
|
||||||
continue;
|
continue;
|
||||||
std::string label;
|
std::string label;
|
||||||
if (currentSet->second.capabilities.transitions[i].label == "")
|
if (currentSet->second.capabilities.transitions[i].label == "")
|
||||||
label = "THEME PROFILE " + std::to_string(i + 1);
|
label = _("THEME PROFILE") + " " + std::to_string(i + 1);
|
||||||
else
|
else
|
||||||
label = currentSet->second.capabilities.transitions[i].label;
|
label = currentSet->second.capabilities.transitions[i].label;
|
||||||
const std::string transitions {currentSet->second.capabilities.transitions[i].name};
|
const std::string transitions {currentSet->second.capabilities.transitions[i].name};
|
||||||
|
@ -434,21 +438,21 @@ void GuiMenu::openUIOptions()
|
||||||
currentSet->second.capabilities.suppressedTransitionProfiles.cend(),
|
currentSet->second.capabilities.suppressedTransitionProfiles.cend(),
|
||||||
"builtin-instant") ==
|
"builtin-instant") ==
|
||||||
currentSet->second.capabilities.suppressedTransitionProfiles.cend()) {
|
currentSet->second.capabilities.suppressedTransitionProfiles.cend()) {
|
||||||
themeTransitions->add("INSTANT (BUILT-IN)", "builtin-instant",
|
themeTransitions->add(_("INSTANT (BUILT-IN)"), "builtin-instant",
|
||||||
"builtin-instant" == selectedThemeTransitions);
|
"builtin-instant" == selectedThemeTransitions);
|
||||||
}
|
}
|
||||||
if (std::find(currentSet->second.capabilities.suppressedTransitionProfiles.cbegin(),
|
if (std::find(currentSet->second.capabilities.suppressedTransitionProfiles.cbegin(),
|
||||||
currentSet->second.capabilities.suppressedTransitionProfiles.cend(),
|
currentSet->second.capabilities.suppressedTransitionProfiles.cend(),
|
||||||
"builtin-slide") ==
|
"builtin-slide") ==
|
||||||
currentSet->second.capabilities.suppressedTransitionProfiles.cend()) {
|
currentSet->second.capabilities.suppressedTransitionProfiles.cend()) {
|
||||||
themeTransitions->add("SLIDE (BUILT-IN)", "builtin-slide",
|
themeTransitions->add(_("SLIDE (BUILT-IN)"), "builtin-slide",
|
||||||
"builtin-slide" == selectedThemeTransitions);
|
"builtin-slide" == selectedThemeTransitions);
|
||||||
}
|
}
|
||||||
if (std::find(currentSet->second.capabilities.suppressedTransitionProfiles.cbegin(),
|
if (std::find(currentSet->second.capabilities.suppressedTransitionProfiles.cbegin(),
|
||||||
currentSet->second.capabilities.suppressedTransitionProfiles.cend(),
|
currentSet->second.capabilities.suppressedTransitionProfiles.cend(),
|
||||||
"builtin-fade") ==
|
"builtin-fade") ==
|
||||||
currentSet->second.capabilities.suppressedTransitionProfiles.cend()) {
|
currentSet->second.capabilities.suppressedTransitionProfiles.cend()) {
|
||||||
themeTransitions->add("FADE (BUILT-IN)", "builtin-fade",
|
themeTransitions->add(_("FADE (BUILT-IN)"), "builtin-fade",
|
||||||
"builtin-fade" == selectedThemeTransitions);
|
"builtin-fade" == selectedThemeTransitions);
|
||||||
}
|
}
|
||||||
if (themeTransitions->getSelectedObjects().size() == 0)
|
if (themeTransitions->getSelectedObjects().size() == 0)
|
||||||
|
@ -475,23 +479,25 @@ void GuiMenu::openUIOptions()
|
||||||
|
|
||||||
// Application language.
|
// Application language.
|
||||||
auto applicationLanguage = std::make_shared<OptionListComponent<std::string>>(
|
auto applicationLanguage = std::make_shared<OptionListComponent<std::string>>(
|
||||||
getHelpStyle(), "APPLICATION LANGUAGE", false);
|
getHelpStyle(), _("APPLICATION LANGUAGE"), false);
|
||||||
std::string selectedApplicationLanguage {
|
std::string selectedApplicationLanguage {
|
||||||
Settings::getInstance()->getString("ApplicationLanguage")};
|
Settings::getInstance()->getString("ApplicationLanguage")};
|
||||||
applicationLanguage->add("AUTOMATIC", "automatic", selectedApplicationLanguage == "automatic");
|
applicationLanguage->add(_("AUTOMATIC"), "automatic",
|
||||||
|
selectedApplicationLanguage == "automatic");
|
||||||
applicationLanguage->add("ENGLISH (AMERICAN)", "en_US", selectedApplicationLanguage == "en_US");
|
applicationLanguage->add("ENGLISH (AMERICAN)", "en_US", selectedApplicationLanguage == "en_US");
|
||||||
applicationLanguage->add("SWEDISH", "sv_SE", selectedApplicationLanguage == "sv_SE");
|
applicationLanguage->add("SVENSKA", "sv_SE", selectedApplicationLanguage == "sv_SE");
|
||||||
// If there are no objects returned, then there must be a manually modified entry in the
|
// If there are no objects returned, then there must be a manually modified entry in the
|
||||||
// configuration file. Simply set the application langauge to "automatic" in this case.
|
// configuration file. Simply set the application langauge to "automatic" in this case.
|
||||||
if (applicationLanguage->getSelectedObjects().size() == 0)
|
if (applicationLanguage->getSelectedObjects().size() == 0)
|
||||||
applicationLanguage->selectEntry(0);
|
applicationLanguage->selectEntry(0);
|
||||||
s->addWithLabel("APPLICATION LANGUAGE", applicationLanguage);
|
s->addWithLabel(_("APPLICATION LANGUAGE"), applicationLanguage);
|
||||||
s->addSaveFunc([this, applicationLanguage, s] {
|
s->addSaveFunc([this, applicationLanguage, s] {
|
||||||
if (applicationLanguage->getSelected() !=
|
if (applicationLanguage->getSelected() !=
|
||||||
Settings::getInstance()->getString("ApplicationLanguage")) {
|
Settings::getInstance()->getString("ApplicationLanguage")) {
|
||||||
Settings::getInstance()->setString("ApplicationLanguage",
|
Settings::getInstance()->setString("ApplicationLanguage",
|
||||||
applicationLanguage->getSelected());
|
applicationLanguage->getSelected());
|
||||||
Utils::Localization::setLocale();
|
Utils::Localization::setLocale();
|
||||||
|
mWindow->updateSplashScreenText();
|
||||||
s->setNeedsSaving();
|
s->setNeedsSaving();
|
||||||
s->setNeedsCloseMenu([this] { delete this; });
|
s->setNeedsCloseMenu([this] { delete this; });
|
||||||
s->setNeedsRescanROMDirectory();
|
s->setNeedsRescanROMDirectory();
|
||||||
|
@ -500,21 +506,21 @@ void GuiMenu::openUIOptions()
|
||||||
|
|
||||||
// Quick system select (navigate between systems in the gamelist view).
|
// Quick system select (navigate between systems in the gamelist view).
|
||||||
auto quickSystemSelect = std::make_shared<OptionListComponent<std::string>>(
|
auto quickSystemSelect = std::make_shared<OptionListComponent<std::string>>(
|
||||||
getHelpStyle(), "QUICK SYSTEM SELECT", false);
|
getHelpStyle(), _("QUICK SYSTEM SELECT"), false);
|
||||||
std::string selectedQuickSelect {Settings::getInstance()->getString("QuickSystemSelect")};
|
std::string selectedQuickSelect {Settings::getInstance()->getString("QuickSystemSelect")};
|
||||||
quickSystemSelect->add("LEFT/RIGHT OR SHOULDERS", "leftrightshoulders",
|
quickSystemSelect->add(_("LEFT/RIGHT OR SHOULDERS"), "leftrightshoulders",
|
||||||
selectedQuickSelect == "leftrightshoulders");
|
selectedQuickSelect == "leftrightshoulders");
|
||||||
quickSystemSelect->add("LEFT/RIGHT OR TRIGGERS", "leftrighttriggers",
|
quickSystemSelect->add(_("LEFT/RIGHT OR TRIGGERS"), "leftrighttriggers",
|
||||||
selectedQuickSelect == "leftrighttriggers");
|
selectedQuickSelect == "leftrighttriggers");
|
||||||
quickSystemSelect->add("SHOULDERS", "shoulders", selectedQuickSelect == "shoulders");
|
quickSystemSelect->add(_("SHOULDERS"), "shoulders", selectedQuickSelect == "shoulders");
|
||||||
quickSystemSelect->add("TRIGGERS", "triggers", selectedQuickSelect == "triggers");
|
quickSystemSelect->add(_("TRIGGERS"), "triggers", selectedQuickSelect == "triggers");
|
||||||
quickSystemSelect->add("LEFT/RIGHT", "leftright", selectedQuickSelect == "leftright");
|
quickSystemSelect->add(_("LEFT/RIGHT"), "leftright", selectedQuickSelect == "leftright");
|
||||||
quickSystemSelect->add("DISABLED", "disabled", selectedQuickSelect == "disabled");
|
quickSystemSelect->add(_("DISABLED"), "disabled", selectedQuickSelect == "disabled");
|
||||||
// If there are no objects returned, then there must be a manually modified entry in the
|
// If there are no objects returned, then there must be a manually modified entry in the
|
||||||
// configuration file. Simply set the quick system select to "leftrightshoulders" in this case.
|
// configuration file. Simply set the quick system select to "leftrightshoulders" in this case.
|
||||||
if (quickSystemSelect->getSelectedObjects().size() == 0)
|
if (quickSystemSelect->getSelectedObjects().size() == 0)
|
||||||
quickSystemSelect->selectEntry(0);
|
quickSystemSelect->selectEntry(0);
|
||||||
s->addWithLabel("QUICK SYSTEM SELECT", quickSystemSelect);
|
s->addWithLabel(_("QUICK SYSTEM SELECT"), quickSystemSelect);
|
||||||
s->addSaveFunc([quickSystemSelect, s] {
|
s->addSaveFunc([quickSystemSelect, s] {
|
||||||
if (quickSystemSelect->getSelected() !=
|
if (quickSystemSelect->getSelected() !=
|
||||||
Settings::getInstance()->getString("QuickSystemSelect")) {
|
Settings::getInstance()->getString("QuickSystemSelect")) {
|
||||||
|
@ -526,13 +532,13 @@ void GuiMenu::openUIOptions()
|
||||||
|
|
||||||
// Optionally start in selected system/gamelist.
|
// Optionally start in selected system/gamelist.
|
||||||
auto startupSystem = std::make_shared<OptionListComponent<std::string>>(
|
auto startupSystem = std::make_shared<OptionListComponent<std::string>>(
|
||||||
getHelpStyle(), "GAMELIST ON STARTUP", false);
|
getHelpStyle(), _("GAMELIST ON STARTUP"), false);
|
||||||
startupSystem->add("NONE", "", Settings::getInstance()->getString("StartupSystem") == "");
|
startupSystem->add(_("NONE"), "", Settings::getInstance()->getString("StartupSystem") == "");
|
||||||
for (auto it = SystemData::sSystemVector.cbegin(); // Line break.
|
for (auto it = SystemData::sSystemVector.cbegin(); // Line break.
|
||||||
it != SystemData::sSystemVector.cend(); ++it) {
|
it != SystemData::sSystemVector.cend(); ++it) {
|
||||||
// If required, abbreviate the system name so it doesn't overlap the setting name.
|
// If required, abbreviate the system name so it doesn't overlap the setting name.
|
||||||
float maxNameLength {mSize.x * 0.51f};
|
float maxNameLength {mSize.x * 0.51f};
|
||||||
startupSystem->add((*it)->getFullName(), (*it)->getName(),
|
startupSystem->add(Utils::String::toUpper((*it)->getFullName()), (*it)->getName(),
|
||||||
Settings::getInstance()->getString("StartupSystem") == (*it)->getName(),
|
Settings::getInstance()->getString("StartupSystem") == (*it)->getName(),
|
||||||
maxNameLength);
|
maxNameLength);
|
||||||
}
|
}
|
||||||
|
@ -540,7 +546,7 @@ void GuiMenu::openUIOptions()
|
||||||
// entry is selected.
|
// entry is selected.
|
||||||
if (startupSystem->getSelectedObjects().size() == 0)
|
if (startupSystem->getSelectedObjects().size() == 0)
|
||||||
startupSystem->selectEntry(0);
|
startupSystem->selectEntry(0);
|
||||||
s->addWithLabel("GAMELIST ON STARTUP", startupSystem);
|
s->addWithLabel(_("GAMELIST ON STARTUP"), startupSystem);
|
||||||
s->addSaveFunc([startupSystem, s] {
|
s->addSaveFunc([startupSystem, s] {
|
||||||
if (startupSystem->getSelected() != Settings::getInstance()->getString("StartupSystem")) {
|
if (startupSystem->getSelected() != Settings::getInstance()->getString("StartupSystem")) {
|
||||||
Settings::getInstance()->setString("StartupSystem", startupSystem->getSelected());
|
Settings::getInstance()->setString("StartupSystem", startupSystem->getSelected());
|
||||||
|
@ -550,21 +556,21 @@ void GuiMenu::openUIOptions()
|
||||||
|
|
||||||
// Systems sorting.
|
// Systems sorting.
|
||||||
auto systemsSorting = std::make_shared<OptionListComponent<std::string>>(
|
auto systemsSorting = std::make_shared<OptionListComponent<std::string>>(
|
||||||
getHelpStyle(), "SYSTEMS SORTING", false);
|
getHelpStyle(), _("SYSTEMS SORTING"), false);
|
||||||
std::string selectedSystemsSorting {Settings::getInstance()->getString("SystemsSorting")};
|
std::string selectedSystemsSorting {Settings::getInstance()->getString("SystemsSorting")};
|
||||||
systemsSorting->add("FULL NAMES OR CUSTOM", "default", selectedSystemsSorting == "default");
|
systemsSorting->add(_("FULL NAMES OR CUSTOM"), "default", selectedSystemsSorting == "default");
|
||||||
systemsSorting->add("RELEASE YEAR", "year", selectedSystemsSorting == "year");
|
systemsSorting->add(_("RELEASE YEAR"), "year", selectedSystemsSorting == "year");
|
||||||
systemsSorting->add("MANUFACTURER, RELEASE YEAR", "manufacturer_year",
|
systemsSorting->add(_("MANUFACTURER, RELEASE YEAR"), "manufacturer_year",
|
||||||
selectedSystemsSorting == "manufacturer_year");
|
selectedSystemsSorting == "manufacturer_year");
|
||||||
systemsSorting->add("HW TYPE, RELEASE YEAR", "hwtype_year",
|
systemsSorting->add(_("HW TYPE, RELEASE YEAR"), "hwtype_year",
|
||||||
selectedSystemsSorting == "hwtype_year");
|
selectedSystemsSorting == "hwtype_year");
|
||||||
systemsSorting->add("MANUFACTURER, HW TYPE, REL. YEAR", "manufacturer_hwtype_year",
|
systemsSorting->add(_("MANUFACTURER, HW TYPE, REL. YEAR"), "manufacturer_hwtype_year",
|
||||||
selectedSystemsSorting == "manufacturer_hwtype_year");
|
selectedSystemsSorting == "manufacturer_hwtype_year");
|
||||||
// If there are no objects returned, then there must be a manually modified entry in the
|
// If there are no objects returned, then there must be a manually modified entry in the
|
||||||
// configuration file. Simply set the systems sorting to "default" in this case.
|
// configuration file. Simply set the systems sorting to "default" in this case.
|
||||||
if (systemsSorting->getSelectedObjects().size() == 0)
|
if (systemsSorting->getSelectedObjects().size() == 0)
|
||||||
systemsSorting->selectEntry(0);
|
systemsSorting->selectEntry(0);
|
||||||
s->addWithLabel("SYSTEMS SORTING", systemsSorting);
|
s->addWithLabel(_("SYSTEMS SORTING"), systemsSorting);
|
||||||
s->addSaveFunc([this, systemsSorting, s] {
|
s->addSaveFunc([this, systemsSorting, s] {
|
||||||
if (systemsSorting->getSelected() != Settings::getInstance()->getString("SystemsSorting")) {
|
if (systemsSorting->getSelected() != Settings::getInstance()->getString("SystemsSorting")) {
|
||||||
Settings::getInstance()->setString("SystemsSorting", systemsSorting->getSelected());
|
Settings::getInstance()->setString("SystemsSorting", systemsSorting->getSelected());
|
||||||
|
@ -580,7 +586,7 @@ void GuiMenu::openUIOptions()
|
||||||
// Default gamelist sort order.
|
// Default gamelist sort order.
|
||||||
std::string sortOrder;
|
std::string sortOrder;
|
||||||
auto defaultSortOrder = std::make_shared<OptionListComponent<const FileData::SortType*>>(
|
auto defaultSortOrder = std::make_shared<OptionListComponent<const FileData::SortType*>>(
|
||||||
getHelpStyle(), "DEFAULT SORT ORDER", false);
|
getHelpStyle(), _("GAMES DEFAULT SORT ORDER [SHORT]"), false);
|
||||||
// Exclude the System sort options.
|
// Exclude the System sort options.
|
||||||
unsigned int numSortTypes {static_cast<unsigned int>(FileSorts::SortTypes.size() - 2)};
|
unsigned int numSortTypes {static_cast<unsigned int>(FileSorts::SortTypes.size() - 2)};
|
||||||
for (unsigned int i {0}; i < numSortTypes; ++i) {
|
for (unsigned int i {0}; i < numSortTypes; ++i) {
|
||||||
|
@ -600,11 +606,12 @@ void GuiMenu::openUIOptions()
|
||||||
for (unsigned int i {0}; i < numSortTypes; ++i) {
|
for (unsigned int i {0}; i < numSortTypes; ++i) {
|
||||||
const FileData::SortType& sort {FileSorts::SortTypes[i]};
|
const FileData::SortType& sort {FileSorts::SortTypes[i]};
|
||||||
if (sort.description == sortOrder)
|
if (sort.description == sortOrder)
|
||||||
defaultSortOrder->add(sort.description, &sort, true);
|
defaultSortOrder->add(Utils::String::toUpper(_(sort.description.c_str())), &sort, true);
|
||||||
else
|
else
|
||||||
defaultSortOrder->add(sort.description, &sort, false);
|
defaultSortOrder->add(Utils::String::toUpper(_(sort.description.c_str())), &sort,
|
||||||
|
false);
|
||||||
}
|
}
|
||||||
s->addWithLabel("GAMES DEFAULT SORT ORDER", defaultSortOrder);
|
s->addWithLabel(_("GAMES DEFAULT SORT ORDER"), defaultSortOrder);
|
||||||
s->addSaveFunc([defaultSortOrder, sortOrder, s] {
|
s->addSaveFunc([defaultSortOrder, sortOrder, s] {
|
||||||
std::string selectedSortOrder {defaultSortOrder.get()->getSelected()->description};
|
std::string selectedSortOrder {defaultSortOrder.get()->getSelected()->description};
|
||||||
if (selectedSortOrder != sortOrder) {
|
if (selectedSortOrder != sortOrder) {
|
||||||
|
@ -618,15 +625,15 @@ void GuiMenu::openUIOptions()
|
||||||
|
|
||||||
// Menu color scheme.
|
// Menu color scheme.
|
||||||
auto menuColorScheme = std::make_shared<OptionListComponent<std::string>>(
|
auto menuColorScheme = std::make_shared<OptionListComponent<std::string>>(
|
||||||
getHelpStyle(), "MENU COLOR SCHEME", false);
|
getHelpStyle(), _("MENU COLOR SCHEME"), false);
|
||||||
const std::string selectedMenuColor {Settings::getInstance()->getString("MenuColorScheme")};
|
const std::string selectedMenuColor {Settings::getInstance()->getString("MenuColorScheme")};
|
||||||
menuColorScheme->add("DARK", "dark", selectedMenuColor == "dark");
|
menuColorScheme->add(_("DARK"), "dark", selectedMenuColor == "dark");
|
||||||
menuColorScheme->add("LIGHT", "light", selectedMenuColor == "light");
|
menuColorScheme->add(_("LIGHT"), "light", selectedMenuColor == "light");
|
||||||
// If there are no objects returned, then there must be a manually modified entry in the
|
// If there are no objects returned, then there must be a manually modified entry in the
|
||||||
// configuration file. Simply set the menu color scheme to "dark" in this case.
|
// configuration file. Simply set the menu color scheme to "dark" in this case.
|
||||||
if (menuColorScheme->getSelectedObjects().size() == 0)
|
if (menuColorScheme->getSelectedObjects().size() == 0)
|
||||||
menuColorScheme->selectEntry(0);
|
menuColorScheme->selectEntry(0);
|
||||||
s->addWithLabel("MENU COLOR SCHEME", menuColorScheme);
|
s->addWithLabel(_("MENU COLOR SCHEME"), menuColorScheme);
|
||||||
s->addSaveFunc([this, menuColorScheme, s] {
|
s->addSaveFunc([this, menuColorScheme, s] {
|
||||||
if (menuColorScheme->getSelected() !=
|
if (menuColorScheme->getSelected() !=
|
||||||
Settings::getInstance()->getString("MenuColorScheme")) {
|
Settings::getInstance()->getString("MenuColorScheme")) {
|
||||||
|
@ -642,15 +649,15 @@ void GuiMenu::openUIOptions()
|
||||||
|
|
||||||
// Open menu effect.
|
// Open menu effect.
|
||||||
auto menuOpeningEffect = std::make_shared<OptionListComponent<std::string>>(
|
auto menuOpeningEffect = std::make_shared<OptionListComponent<std::string>>(
|
||||||
getHelpStyle(), "MENU OPENING EFFECT", false);
|
getHelpStyle(), _("MENU OPENING ANIMATION"), false);
|
||||||
std::string selectedMenuEffect {Settings::getInstance()->getString("MenuOpeningEffect")};
|
std::string selectedMenuEffect {Settings::getInstance()->getString("MenuOpeningEffect")};
|
||||||
menuOpeningEffect->add("SCALE-UP", "scale-up", selectedMenuEffect == "scale-up");
|
menuOpeningEffect->add(_("SCALE-UP"), "scale-up", selectedMenuEffect == "scale-up");
|
||||||
menuOpeningEffect->add("NONE", "none", selectedMenuEffect == "none");
|
menuOpeningEffect->add(_("NONE"), "none", selectedMenuEffect == "none");
|
||||||
// If there are no objects returned, then there must be a manually modified entry in the
|
// If there are no objects returned, then there must be a manually modified entry in the
|
||||||
// configuration file. Simply set the opening effect to "scale-up" in this case.
|
// configuration file. Simply set the opening effect to "scale-up" in this case.
|
||||||
if (menuOpeningEffect->getSelectedObjects().size() == 0)
|
if (menuOpeningEffect->getSelectedObjects().size() == 0)
|
||||||
menuOpeningEffect->selectEntry(0);
|
menuOpeningEffect->selectEntry(0);
|
||||||
s->addWithLabel("MENU OPENING EFFECT", menuOpeningEffect);
|
s->addWithLabel(_("MENU OPENING ANIMATION"), menuOpeningEffect);
|
||||||
s->addSaveFunc([menuOpeningEffect, s] {
|
s->addSaveFunc([menuOpeningEffect, s] {
|
||||||
if (menuOpeningEffect->getSelected() !=
|
if (menuOpeningEffect->getSelected() !=
|
||||||
Settings::getInstance()->getString("MenuOpeningEffect")) {
|
Settings::getInstance()->getString("MenuOpeningEffect")) {
|
||||||
|
@ -662,17 +669,17 @@ void GuiMenu::openUIOptions()
|
||||||
|
|
||||||
// Launch screen duration.
|
// Launch screen duration.
|
||||||
auto launchScreenDuration = std::make_shared<OptionListComponent<std::string>>(
|
auto launchScreenDuration = std::make_shared<OptionListComponent<std::string>>(
|
||||||
getHelpStyle(), "LAUNCH SCREEN DURATION", false);
|
getHelpStyle(), _("LAUNCH SCREEN DURATION [SHORT]"), false);
|
||||||
std::string selectedDuration {Settings::getInstance()->getString("LaunchScreenDuration")};
|
std::string selectedDuration {Settings::getInstance()->getString("LaunchScreenDuration")};
|
||||||
launchScreenDuration->add("NORMAL", "normal", selectedDuration == "normal");
|
launchScreenDuration->add(_("NORMAL"), "normal", selectedDuration == "normal");
|
||||||
launchScreenDuration->add("BRIEF", "brief", selectedDuration == "brief");
|
launchScreenDuration->add(_("BRIEF"), "brief", selectedDuration == "brief");
|
||||||
launchScreenDuration->add("LONG", "long", selectedDuration == "long");
|
launchScreenDuration->add(_("LONG"), "long", selectedDuration == "long");
|
||||||
launchScreenDuration->add("DISABLED", "disabled", selectedDuration == "disabled");
|
launchScreenDuration->add(_("DISABLED"), "disabled", selectedDuration == "disabled");
|
||||||
// If there are no objects returned, then there must be a manually modified entry in the
|
// If there are no objects returned, then there must be a manually modified entry in the
|
||||||
// configuration file. Simply set the duration to "normal" in this case.
|
// configuration file. Simply set the duration to "normal" in this case.
|
||||||
if (launchScreenDuration->getSelectedObjects().size() == 0)
|
if (launchScreenDuration->getSelectedObjects().size() == 0)
|
||||||
launchScreenDuration->selectEntry(0);
|
launchScreenDuration->selectEntry(0);
|
||||||
s->addWithLabel("LAUNCH SCREEN DURATION", launchScreenDuration);
|
s->addWithLabel(_("LAUNCH SCREEN DURATION"), launchScreenDuration);
|
||||||
s->addSaveFunc([launchScreenDuration, s] {
|
s->addSaveFunc([launchScreenDuration, s] {
|
||||||
if (launchScreenDuration->getSelected() !=
|
if (launchScreenDuration->getSelected() !=
|
||||||
Settings::getInstance()->getString("LaunchScreenDuration")) {
|
Settings::getInstance()->getString("LaunchScreenDuration")) {
|
||||||
|
@ -684,11 +691,7 @@ void GuiMenu::openUIOptions()
|
||||||
|
|
||||||
// UI mode.
|
// UI mode.
|
||||||
auto uiMode =
|
auto uiMode =
|
||||||
std::make_shared<OptionListComponent<std::string>>(getHelpStyle(), "UI MODE", false);
|
std::make_shared<OptionListComponent<std::string>>(getHelpStyle(), _("UI MODE"), false);
|
||||||
std::vector<std::string> uiModes;
|
|
||||||
uiModes.push_back("full");
|
|
||||||
uiModes.push_back("kiosk");
|
|
||||||
uiModes.push_back("kid");
|
|
||||||
std::string setMode;
|
std::string setMode;
|
||||||
if (Settings::getInstance()->getBool("ForceKiosk"))
|
if (Settings::getInstance()->getBool("ForceKiosk"))
|
||||||
setMode = "kiosk";
|
setMode = "kiosk";
|
||||||
|
@ -696,9 +699,14 @@ void GuiMenu::openUIOptions()
|
||||||
setMode = "kid";
|
setMode = "kid";
|
||||||
else
|
else
|
||||||
setMode = Settings::getInstance()->getString("UIMode");
|
setMode = Settings::getInstance()->getString("UIMode");
|
||||||
for (auto it = uiModes.cbegin(); it != uiModes.cend(); ++it)
|
uiMode->add(_("FULL"), "full", setMode == "full");
|
||||||
uiMode->add(*it, *it, setMode == *it);
|
uiMode->add(_("KIOSK"), "kiosk", setMode == "kiosk");
|
||||||
s->addWithLabel("UI MODE", uiMode);
|
uiMode->add(_("KID"), "kid", setMode == "kid");
|
||||||
|
// If there are no objects returned, then there must be a manually modified entry in the
|
||||||
|
// configuration file. Simply set the UI mode to "full" in this case.
|
||||||
|
if (uiMode->getSelectedObjects().size() == 0)
|
||||||
|
uiMode->selectEntry(0);
|
||||||
|
s->addWithLabel(_("UI MODE"), uiMode);
|
||||||
s->addSaveFunc([uiMode, this, s] {
|
s->addSaveFunc([uiMode, this, s] {
|
||||||
std::string selectedMode {uiMode->getSelected()};
|
std::string selectedMode {uiMode->getSelected()};
|
||||||
// If any of the force flags are set, then always apply and save the setting.
|
// If any of the force flags are set, then always apply and save the setting.
|
||||||
|
@ -773,18 +781,18 @@ void GuiMenu::openUIOptions()
|
||||||
|
|
||||||
// Random entry button.
|
// Random entry button.
|
||||||
auto randomEntryButton = std::make_shared<OptionListComponent<std::string>>(
|
auto randomEntryButton = std::make_shared<OptionListComponent<std::string>>(
|
||||||
getHelpStyle(), "RANDOM ENTRY BUTTON", false);
|
getHelpStyle(), _("RANDOM ENTRY BUTTON [SHORT]"), false);
|
||||||
const std::string selectedRandomEntryButton {
|
const std::string selectedRandomEntryButton {
|
||||||
Settings::getInstance()->getString("RandomEntryButton")};
|
Settings::getInstance()->getString("RandomEntryButton")};
|
||||||
randomEntryButton->add("GAMES ONLY", "games", selectedRandomEntryButton == "games");
|
randomEntryButton->add(_("GAMES ONLY"), "games", selectedRandomEntryButton == "games");
|
||||||
randomEntryButton->add("GAMES AND SYSTEMS", "gamessystems",
|
randomEntryButton->add(_("GAMES AND SYSTEMS"), "gamessystems",
|
||||||
selectedRandomEntryButton == "gamessystems");
|
selectedRandomEntryButton == "gamessystems");
|
||||||
randomEntryButton->add("DISABLED", "disabled", selectedRandomEntryButton == "disabled");
|
randomEntryButton->add(_("DISABLED"), "disabled", selectedRandomEntryButton == "disabled");
|
||||||
// If there are no objects returned, then there must be a manually modified entry in the
|
// If there are no objects returned, then there must be a manually modified entry in the
|
||||||
// configuration file. Simply set the random entry button to "games" in this case.
|
// configuration file. Simply set the random entry button to "games" in this case.
|
||||||
if (randomEntryButton->getSelectedObjects().size() == 0)
|
if (randomEntryButton->getSelectedObjects().size() == 0)
|
||||||
randomEntryButton->selectEntry(0);
|
randomEntryButton->selectEntry(0);
|
||||||
s->addWithLabel("RANDOM ENTRY BUTTON", randomEntryButton);
|
s->addWithLabel(_("RANDOM ENTRY BUTTON"), randomEntryButton);
|
||||||
s->addSaveFunc([randomEntryButton, s] {
|
s->addSaveFunc([randomEntryButton, s] {
|
||||||
if (randomEntryButton->getSelected() !=
|
if (randomEntryButton->getSelected() !=
|
||||||
Settings::getInstance()->getString("RandomEntryButton")) {
|
Settings::getInstance()->getString("RandomEntryButton")) {
|
||||||
|
@ -797,7 +805,7 @@ void GuiMenu::openUIOptions()
|
||||||
// Media viewer.
|
// Media viewer.
|
||||||
ComponentListRow mediaViewerRow;
|
ComponentListRow mediaViewerRow;
|
||||||
mediaViewerRow.elements.clear();
|
mediaViewerRow.elements.clear();
|
||||||
mediaViewerRow.addElement(std::make_shared<TextComponent>("MEDIA VIEWER SETTINGS",
|
mediaViewerRow.addElement(std::make_shared<TextComponent>(_("MEDIA VIEWER SETTINGS"),
|
||||||
Font::get(FONT_SIZE_MEDIUM),
|
Font::get(FONT_SIZE_MEDIUM),
|
||||||
mMenuColorPrimary),
|
mMenuColorPrimary),
|
||||||
true);
|
true);
|
||||||
|
@ -808,7 +816,7 @@ void GuiMenu::openUIOptions()
|
||||||
// Screensaver.
|
// Screensaver.
|
||||||
ComponentListRow screensaverRow;
|
ComponentListRow screensaverRow;
|
||||||
screensaverRow.elements.clear();
|
screensaverRow.elements.clear();
|
||||||
screensaverRow.addElement(std::make_shared<TextComponent>("SCREENSAVER SETTINGS",
|
screensaverRow.addElement(std::make_shared<TextComponent>(_("SCREENSAVER SETTINGS"),
|
||||||
Font::get(FONT_SIZE_MEDIUM),
|
Font::get(FONT_SIZE_MEDIUM),
|
||||||
mMenuColorPrimary),
|
mMenuColorPrimary),
|
||||||
true);
|
true);
|
||||||
|
@ -1046,7 +1054,7 @@ void GuiMenu::openUIOptions()
|
||||||
|
|
||||||
void GuiMenu::openSoundOptions()
|
void GuiMenu::openSoundOptions()
|
||||||
{
|
{
|
||||||
auto s = new GuiSettings("SOUND SETTINGS");
|
auto s = new GuiSettings(_("SOUND SETTINGS"));
|
||||||
|
|
||||||
// TODO: Implement system volume support for macOS and Android.
|
// TODO: Implement system volume support for macOS and Android.
|
||||||
#if !defined(__APPLE__) && !defined(__ANDROID__) && !defined(__FreeBSD__) && \
|
#if !defined(__APPLE__) && !defined(__ANDROID__) && !defined(__FreeBSD__) && \
|
||||||
|
@ -1157,7 +1165,7 @@ void GuiMenu::openSoundOptions()
|
||||||
|
|
||||||
void GuiMenu::openInputDeviceOptions()
|
void GuiMenu::openInputDeviceOptions()
|
||||||
{
|
{
|
||||||
auto s = new GuiSettings("INPUT DEVICE SETTINGS");
|
auto s = new GuiSettings(_("INPUT DEVICE SETTINGS"));
|
||||||
|
|
||||||
// Controller type.
|
// Controller type.
|
||||||
auto inputControllerType = std::make_shared<OptionListComponent<std::string>>(
|
auto inputControllerType = std::make_shared<OptionListComponent<std::string>>(
|
||||||
|
@ -1423,7 +1431,7 @@ void GuiMenu::openConfigInput(GuiSettings* settings)
|
||||||
|
|
||||||
void GuiMenu::openOtherOptions()
|
void GuiMenu::openOtherOptions()
|
||||||
{
|
{
|
||||||
auto s = new GuiSettings("OTHER SETTINGS");
|
auto s = new GuiSettings(_("OTHER SETTINGS"));
|
||||||
|
|
||||||
// Alternative emulators GUI.
|
// Alternative emulators GUI.
|
||||||
ComponentListRow alternativeEmulatorsRow;
|
ComponentListRow alternativeEmulatorsRow;
|
||||||
|
@ -1951,7 +1959,7 @@ void GuiMenu::openOtherOptions()
|
||||||
|
|
||||||
void GuiMenu::openUtilities()
|
void GuiMenu::openUtilities()
|
||||||
{
|
{
|
||||||
auto s = new GuiSettings("UTILITIES");
|
auto s = new GuiSettings(_("UTILITIES"));
|
||||||
|
|
||||||
HelpStyle style {getHelpStyle()};
|
HelpStyle style {getHelpStyle()};
|
||||||
|
|
||||||
|
@ -2073,7 +2081,7 @@ void GuiMenu::openQuitMenu()
|
||||||
"NO", nullptr));
|
"NO", nullptr));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
auto s = new GuiSettings("QUIT");
|
auto s = new GuiSettings(_("QUIT"));
|
||||||
|
|
||||||
Window* window {mWindow};
|
Window* window {mWindow};
|
||||||
HelpStyle style {getHelpStyle()};
|
HelpStyle style {getHelpStyle()};
|
||||||
|
@ -2182,17 +2190,17 @@ void GuiMenu::openThemeDownloader(GuiSettings* settings)
|
||||||
|
|
||||||
void GuiMenu::openMediaViewerOptions()
|
void GuiMenu::openMediaViewerOptions()
|
||||||
{
|
{
|
||||||
mWindow->pushGui(new GuiMediaViewerOptions("MEDIA VIEWER SETTINGS"));
|
mWindow->pushGui(new GuiMediaViewerOptions(_("MEDIA VIEWER SETTINGS [SHORT]")));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiMenu::openScreensaverOptions()
|
void GuiMenu::openScreensaverOptions()
|
||||||
{
|
{
|
||||||
mWindow->pushGui(new GuiScreensaverOptions("SCREENSAVER SETTINGS"));
|
mWindow->pushGui(new GuiScreensaverOptions(_("SCREENSAVER SETTINGS [SHORT]")));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiMenu::openCollectionSystemOptions()
|
void GuiMenu::openCollectionSystemOptions()
|
||||||
{
|
{
|
||||||
mWindow->pushGui(new GuiCollectionSystemsOptions("GAME COLLECTION SETTINGS"));
|
mWindow->pushGui(new GuiCollectionSystemsOptions(_("GAME COLLECTION SETTINGS")));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiMenu::onSizeChanged()
|
void GuiMenu::onSizeChanged()
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "components/ImageComponent.h"
|
#include "components/ImageComponent.h"
|
||||||
#include "components/TextComponent.h"
|
#include "components/TextComponent.h"
|
||||||
#include "utils/FileSystemUtil.h"
|
#include "utils/FileSystemUtil.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
#include "utils/StringUtil.h"
|
#include "utils/StringUtil.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -2061,3 +2062,25 @@ void ThemeData::parseElement(const pugi::xml_node& root,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ThemeData::gettextMessageCatalogEntries()
|
||||||
|
{
|
||||||
|
// sSupportedFontSizes
|
||||||
|
_("medium");
|
||||||
|
_("large");
|
||||||
|
_("small");
|
||||||
|
_("extra small");
|
||||||
|
_("extra large");
|
||||||
|
|
||||||
|
// sSupportedAspectRatios
|
||||||
|
_("automatic");
|
||||||
|
_("16:9 vertical");
|
||||||
|
_("16:10 vertical");
|
||||||
|
_("3:2 vertical");
|
||||||
|
_("4:3 vertical");
|
||||||
|
_("5:4 vertical");
|
||||||
|
_("19.5:9 vertical");
|
||||||
|
_("20:9 vertical");
|
||||||
|
_("21:9 vertical");
|
||||||
|
_("32:9 vertical");
|
||||||
|
}
|
||||||
|
|
|
@ -263,6 +263,9 @@ private:
|
||||||
const std::map<std::string, ElementPropertyType>& typeMap,
|
const std::map<std::string, ElementPropertyType>& typeMap,
|
||||||
ThemeElement& element);
|
ThemeElement& element);
|
||||||
|
|
||||||
|
// This is just to get gettext msgid entries added to the PO message catalog files.
|
||||||
|
void gettextMessageCatalogEntries();
|
||||||
|
|
||||||
static std::vector<std::string> sSupportedViews;
|
static std::vector<std::string> sSupportedViews;
|
||||||
static std::vector<std::string> sSupportedMediaTypes;
|
static std::vector<std::string> sSupportedMediaTypes;
|
||||||
static std::vector<std::string> sSupportedTransitions;
|
static std::vector<std::string> sSupportedTransitions;
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include "components/ImageComponent.h"
|
#include "components/ImageComponent.h"
|
||||||
#include "guis/GuiInfoPopup.h"
|
#include "guis/GuiInfoPopup.h"
|
||||||
#include "resources/Font.h"
|
#include "resources/Font.h"
|
||||||
|
#include "utils/LocalizationUtil.h"
|
||||||
|
|
||||||
#if defined(__ANDROID__)
|
#if defined(__ANDROID__)
|
||||||
#include "InputOverlay.h"
|
#include "InputOverlay.h"
|
||||||
|
@ -142,25 +143,7 @@ bool Window::init()
|
||||||
mSplash->setPosition((mRenderer->getScreenWidth() - mSplash->getSize().x) / 2.0f,
|
mSplash->setPosition((mRenderer->getScreenWidth() - mSplash->getSize().x) / 2.0f,
|
||||||
(mRenderer->getScreenHeight() - mSplash->getSize().y) / 2.0f * 0.6f);
|
(mRenderer->getScreenHeight() - mSplash->getSize().y) / 2.0f * 0.6f);
|
||||||
|
|
||||||
mSplashTextScanning = std::unique_ptr<TextCache>(
|
updateSplashScreenText();
|
||||||
mDefaultFonts.at(1)->buildTextCache("Searching for games...", 0.0f, 0.0f, 0x777777FF));
|
|
||||||
mSplashTextPopulating = std::unique_ptr<TextCache>(
|
|
||||||
mDefaultFonts.at(1)->buildTextCache("Loading systems...", 0.0f, 0.0f, 0x777777FF));
|
|
||||||
mSplashTextReloading = std::unique_ptr<TextCache>(
|
|
||||||
mDefaultFonts.at(1)->buildTextCache("Reloading...", 0.0f, 0.0f, 0x777777FF));
|
|
||||||
mSplashTextResourceCopy = std::unique_ptr<TextCache>(
|
|
||||||
mDefaultFonts.at(1)->buildTextCache("Copying resources...", 0.0f, 0.0f, 0x777777FF));
|
|
||||||
mSplashTextDirCreation = std::unique_ptr<TextCache>(mDefaultFonts.at(1)->buildTextCache(
|
|
||||||
"Creating system directories...", 0.0f, 0.0f, 0x777777FF));
|
|
||||||
|
|
||||||
mSplashTextPositions.x =
|
|
||||||
(mRenderer->getScreenWidth() - mSplashTextScanning->metrics.size.x) / 2.0f;
|
|
||||||
mSplashTextPositions.z =
|
|
||||||
(mRenderer->getScreenWidth() - mSplashTextPopulating->metrics.size.x) / 2.0f;
|
|
||||||
mSplashTextPositions.w =
|
|
||||||
(mRenderer->getScreenWidth() - mSplashTextReloading->metrics.size.x) / 2.0f;
|
|
||||||
mSplashTextPositions.y =
|
|
||||||
mRenderer->getScreenHeight() * (mRenderer->getIsVerticalOrientation() ? 0.620f : 0.745f);
|
|
||||||
|
|
||||||
ProgressBarRectangle progressBarRect;
|
ProgressBarRectangle progressBarRect;
|
||||||
if (mRenderer->getIsVerticalOrientation())
|
if (mRenderer->getIsVerticalOrientation())
|
||||||
|
@ -682,6 +665,29 @@ void Window::render()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Window::updateSplashScreenText()
|
||||||
|
{
|
||||||
|
mSplashTextScanning = std::unique_ptr<TextCache>(
|
||||||
|
mDefaultFonts.at(1)->buildTextCache(_("Searching for games..."), 0.0f, 0.0f, 0x777777FF));
|
||||||
|
mSplashTextPopulating = std::unique_ptr<TextCache>(
|
||||||
|
mDefaultFonts.at(1)->buildTextCache(_("Loading systems..."), 0.0f, 0.0f, 0x777777FF));
|
||||||
|
mSplashTextReloading = std::unique_ptr<TextCache>(
|
||||||
|
mDefaultFonts.at(1)->buildTextCache(_("Reloading..."), 0.0f, 0.0f, 0x777777FF));
|
||||||
|
mSplashTextResourceCopy = std::unique_ptr<TextCache>(
|
||||||
|
mDefaultFonts.at(1)->buildTextCache(_("Copying resources..."), 0.0f, 0.0f, 0x777777FF));
|
||||||
|
mSplashTextDirCreation = std::unique_ptr<TextCache>(mDefaultFonts.at(1)->buildTextCache(
|
||||||
|
_("Creating system directories..."), 0.0f, 0.0f, 0x777777FF));
|
||||||
|
|
||||||
|
mSplashTextPositions.x =
|
||||||
|
(mRenderer->getScreenWidth() - mSplashTextScanning->metrics.size.x) / 2.0f;
|
||||||
|
mSplashTextPositions.z =
|
||||||
|
(mRenderer->getScreenWidth() - mSplashTextPopulating->metrics.size.x) / 2.0f;
|
||||||
|
mSplashTextPositions.w =
|
||||||
|
(mRenderer->getScreenWidth() - mSplashTextReloading->metrics.size.x) / 2.0f;
|
||||||
|
mSplashTextPositions.y =
|
||||||
|
mRenderer->getScreenHeight() * (mRenderer->getIsVerticalOrientation() ? 0.620f : 0.745f);
|
||||||
|
}
|
||||||
|
|
||||||
void Window::renderSplashScreen(SplashScreenState state, float progress)
|
void Window::renderSplashScreen(SplashScreenState state, float progress)
|
||||||
{
|
{
|
||||||
glm::mat4 trans {mRenderer->getIdentity()};
|
glm::mat4 trans {mRenderer->getIdentity()};
|
||||||
|
@ -894,7 +900,7 @@ void Window::startPDFViewer(FileData* game)
|
||||||
mRenderPDFViewer = true;
|
mRenderPDFViewer = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
queueInfoPopup("ERROR: COULDN'T RENDER PDF FILE", 4000);
|
queueInfoPopup(_("ERROR: COULDN'T RENDER PDF FILE"), 4000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,6 +114,7 @@ public:
|
||||||
DIR_CREATION
|
DIR_CREATION
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void updateSplashScreenText();
|
||||||
void renderSplashScreen(SplashScreenState state, float progress);
|
void renderSplashScreen(SplashScreenState state, float progress);
|
||||||
// The list scroll overlay is triggered from IList when the highest scrolling tier is reached.
|
// The list scroll overlay is triggered from IList when the highest scrolling tier is reached.
|
||||||
void renderListScrollOverlay(const float opacity, const std::string& text);
|
void renderListScrollOverlay(const float opacity, const std::string& text);
|
||||||
|
|
Loading…
Reference in a new issue