summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorColin Kinloch <colin.kinloch@collabora.com>2022-12-28 20:08:31 +0100
committerColin Kinloch <colin.kinloch@collabora.com>2022-12-28 21:34:28 +0100
commit2ccf17532456f4480a40fea06e00242d5fd3483c (patch)
treec82b3b07a9c00c6178bcd4476667347e989e2502 /src
parentMerge pull request #9490 from ameerj/texture-cache-prealloc (diff)
downloadyuzu-2ccf17532456f4480a40fea06e00242d5fd3483c.tar
yuzu-2ccf17532456f4480a40fea06e00242d5fd3483c.tar.gz
yuzu-2ccf17532456f4480a40fea06e00242d5fd3483c.tar.bz2
yuzu-2ccf17532456f4480a40fea06e00242d5fd3483c.tar.lz
yuzu-2ccf17532456f4480a40fea06e00242d5fd3483c.tar.xz
yuzu-2ccf17532456f4480a40fea06e00242d5fd3483c.tar.zst
yuzu-2ccf17532456f4480a40fea06e00242d5fd3483c.zip
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/configuration/configure_system.cpp30
-rw-r--r--src/yuzu/configuration/configure_system.ui12
2 files changed, 41 insertions, 1 deletions
diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp
index 9b14e5903..37a98bea1 100644
--- a/src/yuzu/configuration/configure_system.cpp
+++ b/src/yuzu/configuration/configure_system.cpp
@@ -14,6 +14,20 @@
#include "yuzu/configuration/configuration_shared.h"
#include "yuzu/configuration/configure_system.h"
+constexpr std::array<u32, 7> LOCALE_BLOCKLIST{
+ 0b100011100001100000, // Japan
+ 0b000001101001100100, // Americas
+ 0b100110100001000010, // Europe
+ 0b100110100001000010, // Australia
+ 0b000000000000000000, // China
+ 0b100111100001000000, // Korea
+ 0b100111100001000000, // Taiwan
+};
+
+static bool IsValidLocale(u32 region_index, u32 language_index) {
+ return ((LOCALE_BLOCKLIST[region_index] >> language_index) & 1) == 0;
+}
+
ConfigureSystem::ConfigureSystem(Core::System& system_, QWidget* parent)
: QWidget(parent), ui{std::make_unique<Ui::ConfigureSystem>()}, system{system_} {
ui->setupUi(this);
@@ -34,6 +48,22 @@ ConfigureSystem::ConfigureSystem(Core::System& system_, QWidget* parent)
}
});
+ const auto locale_check = [this](int index) {
+ const bool valid_locale =
+ IsValidLocale(ui->combo_region->currentIndex(), ui->combo_language->currentIndex());
+ ui->label_warn_invalid_locale->setVisible(!valid_locale);
+ if (!valid_locale) {
+ ui->label_warn_invalid_locale->setText(
+ tr("Warning: \"%1\" is not a valid language for region \"%2\"")
+ .arg(ui->combo_language->currentText())
+ .arg(ui->combo_region->currentText()));
+ }
+ };
+
+ connect(ui->combo_language, qOverload<int>(&QComboBox::currentIndexChanged), this,
+ locale_check);
+ connect(ui->combo_region, qOverload<int>(&QComboBox::currentIndexChanged), this, locale_check);
+
ui->label_console_id->setVisible(Settings::IsConfiguringGlobal());
ui->button_regenerate_console_id->setVisible(Settings::IsConfiguringGlobal());
diff --git a/src/yuzu/configuration/configure_system.ui b/src/yuzu/configuration/configure_system.ui
index 46892f5c1..0459cd924 100644
--- a/src/yuzu/configuration/configure_system.ui
+++ b/src/yuzu/configuration/configure_system.ui
@@ -326,7 +326,7 @@
</item>
<item>
<property name="text">
- <string>English</string>
+ <string>American English</string>
</property>
</item>
<item>
@@ -546,6 +546,16 @@
</spacer>
</item>
<item>
+ <widget class="QLabel" name="label_warn_invalid_locale">
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="QLabel" name="label_disable_info">
<property name="text">
<string>System settings are available only when game is not running.</string>