diff options
| author | 2022-12-28 19:08:31 +0000 | |
|---|---|---|
| committer | 2022-12-28 20:34:28 +0000 | |
| commit | 2ccf17532456f4480a40fea06e00242d5fd3483c (patch) | |
| tree | c82b3b07a9c00c6178bcd4476667347e989e2502 /src | |
| parent | Merge pull request #9490 from ameerj/texture-cache-prealloc (diff) | |
| download | yuzu-2ccf17532456f4480a40fea06e00242d5fd3483c.tar.gz yuzu-2ccf17532456f4480a40fea06e00242d5fd3483c.tar.xz yuzu-2ccf17532456f4480a40fea06e00242d5fd3483c.zip | |
settings: warn on invalid regon/language combinations
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/configuration/configure_system.cpp | 30 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_system.ui | 12 |
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 @@ | |||
| 14 | #include "yuzu/configuration/configuration_shared.h" | 14 | #include "yuzu/configuration/configuration_shared.h" |
| 15 | #include "yuzu/configuration/configure_system.h" | 15 | #include "yuzu/configuration/configure_system.h" |
| 16 | 16 | ||
| 17 | constexpr std::array<u32, 7> LOCALE_BLOCKLIST{ | ||
| 18 | 0b100011100001100000, // Japan | ||
| 19 | 0b000001101001100100, // Americas | ||
| 20 | 0b100110100001000010, // Europe | ||
| 21 | 0b100110100001000010, // Australia | ||
| 22 | 0b000000000000000000, // China | ||
| 23 | 0b100111100001000000, // Korea | ||
| 24 | 0b100111100001000000, // Taiwan | ||
| 25 | }; | ||
| 26 | |||
| 27 | static bool IsValidLocale(u32 region_index, u32 language_index) { | ||
| 28 | return ((LOCALE_BLOCKLIST[region_index] >> language_index) & 1) == 0; | ||
| 29 | } | ||
| 30 | |||
| 17 | ConfigureSystem::ConfigureSystem(Core::System& system_, QWidget* parent) | 31 | ConfigureSystem::ConfigureSystem(Core::System& system_, QWidget* parent) |
| 18 | : QWidget(parent), ui{std::make_unique<Ui::ConfigureSystem>()}, system{system_} { | 32 | : QWidget(parent), ui{std::make_unique<Ui::ConfigureSystem>()}, system{system_} { |
| 19 | ui->setupUi(this); | 33 | ui->setupUi(this); |
| @@ -34,6 +48,22 @@ ConfigureSystem::ConfigureSystem(Core::System& system_, QWidget* parent) | |||
| 34 | } | 48 | } |
| 35 | }); | 49 | }); |
| 36 | 50 | ||
| 51 | const auto locale_check = [this](int index) { | ||
| 52 | const bool valid_locale = | ||
| 53 | IsValidLocale(ui->combo_region->currentIndex(), ui->combo_language->currentIndex()); | ||
| 54 | ui->label_warn_invalid_locale->setVisible(!valid_locale); | ||
| 55 | if (!valid_locale) { | ||
| 56 | ui->label_warn_invalid_locale->setText( | ||
| 57 | tr("Warning: \"%1\" is not a valid language for region \"%2\"") | ||
| 58 | .arg(ui->combo_language->currentText()) | ||
| 59 | .arg(ui->combo_region->currentText())); | ||
| 60 | } | ||
| 61 | }; | ||
| 62 | |||
| 63 | connect(ui->combo_language, qOverload<int>(&QComboBox::currentIndexChanged), this, | ||
| 64 | locale_check); | ||
| 65 | connect(ui->combo_region, qOverload<int>(&QComboBox::currentIndexChanged), this, locale_check); | ||
| 66 | |||
| 37 | ui->label_console_id->setVisible(Settings::IsConfiguringGlobal()); | 67 | ui->label_console_id->setVisible(Settings::IsConfiguringGlobal()); |
| 38 | ui->button_regenerate_console_id->setVisible(Settings::IsConfiguringGlobal()); | 68 | ui->button_regenerate_console_id->setVisible(Settings::IsConfiguringGlobal()); |
| 39 | 69 | ||
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 @@ | |||
| 326 | </item> | 326 | </item> |
| 327 | <item> | 327 | <item> |
| 328 | <property name="text"> | 328 | <property name="text"> |
| 329 | <string>English</string> | 329 | <string>American English</string> |
| 330 | </property> | 330 | </property> |
| 331 | </item> | 331 | </item> |
| 332 | <item> | 332 | <item> |
| @@ -546,6 +546,16 @@ | |||
| 546 | </spacer> | 546 | </spacer> |
| 547 | </item> | 547 | </item> |
| 548 | <item> | 548 | <item> |
| 549 | <widget class="QLabel" name="label_warn_invalid_locale"> | ||
| 550 | <property name="text"> | ||
| 551 | <string></string> | ||
| 552 | </property> | ||
| 553 | <property name="wordWrap"> | ||
| 554 | <bool>true</bool> | ||
| 555 | </property> | ||
| 556 | </widget> | ||
| 557 | </item> | ||
| 558 | <item> | ||
| 549 | <widget class="QLabel" name="label_disable_info"> | 559 | <widget class="QLabel" name="label_disable_info"> |
| 550 | <property name="text"> | 560 | <property name="text"> |
| 551 | <string>System settings are available only when game is not running.</string> | 561 | <string>System settings are available only when game is not running.</string> |