mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-11-02 05:17:52 +00:00
core: settings: Add a setting for time zone.
This commit is contained in:
parent
5dec81fcbd
commit
988e42a3f5
8 changed files with 282 additions and 10 deletions
|
@ -63,6 +63,21 @@ const std::array<const char*, NumMouseButtons> mapping = {{
|
||||||
|
|
||||||
Values values = {};
|
Values values = {};
|
||||||
|
|
||||||
|
std::string GetTimeZoneString() {
|
||||||
|
static constexpr std::array<const char*, 46> timezones{{
|
||||||
|
"auto", "default", "CET", "CST6CDT", "Cuba", "EET", "Egypt", "Eire",
|
||||||
|
"EST", "EST5EDT", "GB", "GB-Eire", "GMT", "GMT+0", "GMT-0", "GMT0",
|
||||||
|
"Greenwich", "Hongkong", "HST", "Iceland", "Iran", "Israel", "Jamaica", "Japan",
|
||||||
|
"Kwajalein", "Libya", "MET", "MST", "MST7MDT", "Navajo", "NZ", "NZ-CHAT",
|
||||||
|
"Poland", "Portugal", "PRC", "PST8PDT", "ROC", "ROK", "Singapore", "Turkey",
|
||||||
|
"UCT", "Universal", "UTC", "W-SU", "WET", "Zulu",
|
||||||
|
}};
|
||||||
|
|
||||||
|
ASSERT(Settings::values.time_zone_index < timezones.size());
|
||||||
|
|
||||||
|
return timezones[Settings::values.time_zone_index];
|
||||||
|
}
|
||||||
|
|
||||||
void Apply() {
|
void Apply() {
|
||||||
GDBStub::SetServerPort(values.gdbstub_port);
|
GDBStub::SetServerPort(values.gdbstub_port);
|
||||||
GDBStub::ToggleServer(values.use_gdbstub);
|
GDBStub::ToggleServer(values.use_gdbstub);
|
||||||
|
@ -87,6 +102,7 @@ void LogSettings() {
|
||||||
LogSetting("System_CurrentUser", Settings::values.current_user);
|
LogSetting("System_CurrentUser", Settings::values.current_user);
|
||||||
LogSetting("System_LanguageIndex", Settings::values.language_index);
|
LogSetting("System_LanguageIndex", Settings::values.language_index);
|
||||||
LogSetting("System_RegionIndex", Settings::values.region_index);
|
LogSetting("System_RegionIndex", Settings::values.region_index);
|
||||||
|
LogSetting("System_TimeZoneIndex", Settings::values.time_zone_index);
|
||||||
LogSetting("Core_UseMultiCore", Settings::values.use_multi_core);
|
LogSetting("Core_UseMultiCore", Settings::values.use_multi_core);
|
||||||
LogSetting("Renderer_UseResolutionFactor", Settings::values.resolution_factor);
|
LogSetting("Renderer_UseResolutionFactor", Settings::values.resolution_factor);
|
||||||
LogSetting("Renderer_UseFrameLimit", Settings::values.use_frame_limit);
|
LogSetting("Renderer_UseFrameLimit", Settings::values.use_frame_limit);
|
||||||
|
|
|
@ -394,6 +394,7 @@ struct Values {
|
||||||
s32 current_user;
|
s32 current_user;
|
||||||
s32 language_index;
|
s32 language_index;
|
||||||
s32 region_index;
|
s32 region_index;
|
||||||
|
s32 time_zone_index;
|
||||||
s32 sound_index;
|
s32 sound_index;
|
||||||
|
|
||||||
// Controls
|
// Controls
|
||||||
|
@ -490,6 +491,9 @@ struct Values {
|
||||||
bool IsGPULevelExtreme();
|
bool IsGPULevelExtreme();
|
||||||
bool IsGPULevelHigh();
|
bool IsGPULevelHigh();
|
||||||
|
|
||||||
|
std::string GetTimeZoneString();
|
||||||
|
|
||||||
void Apply();
|
void Apply();
|
||||||
void LogSettings();
|
void LogSettings();
|
||||||
|
|
||||||
} // namespace Settings
|
} // namespace Settings
|
||||||
|
|
|
@ -687,6 +687,8 @@ void Config::ReadSystemValues() {
|
||||||
|
|
||||||
Settings::values.region_index = ReadSetting(QStringLiteral("region_index"), 1).toInt();
|
Settings::values.region_index = ReadSetting(QStringLiteral("region_index"), 1).toInt();
|
||||||
|
|
||||||
|
Settings::values.time_zone_index = ReadSetting(QStringLiteral("time_zone_index"), 0).toInt();
|
||||||
|
|
||||||
const auto rng_seed_enabled = ReadSetting(QStringLiteral("rng_seed_enabled"), false).toBool();
|
const auto rng_seed_enabled = ReadSetting(QStringLiteral("rng_seed_enabled"), false).toBool();
|
||||||
if (rng_seed_enabled) {
|
if (rng_seed_enabled) {
|
||||||
Settings::values.rng_seed = ReadSetting(QStringLiteral("rng_seed"), 0).toULongLong();
|
Settings::values.rng_seed = ReadSetting(QStringLiteral("rng_seed"), 0).toULongLong();
|
||||||
|
@ -1126,6 +1128,7 @@ void Config::SaveSystemValues() {
|
||||||
WriteSetting(QStringLiteral("current_user"), Settings::values.current_user, 0);
|
WriteSetting(QStringLiteral("current_user"), Settings::values.current_user, 0);
|
||||||
WriteSetting(QStringLiteral("language_index"), Settings::values.language_index, 1);
|
WriteSetting(QStringLiteral("language_index"), Settings::values.language_index, 1);
|
||||||
WriteSetting(QStringLiteral("region_index"), Settings::values.region_index, 1);
|
WriteSetting(QStringLiteral("region_index"), Settings::values.region_index, 1);
|
||||||
|
WriteSetting(QStringLiteral("time_zone_index"), Settings::values.time_zone_index, 0);
|
||||||
|
|
||||||
WriteSetting(QStringLiteral("rng_seed_enabled"), Settings::values.rng_seed.has_value(), false);
|
WriteSetting(QStringLiteral("rng_seed_enabled"), Settings::values.rng_seed.has_value(), false);
|
||||||
WriteSetting(QStringLiteral("rng_seed"), Settings::values.rng_seed.value_or(0), 0);
|
WriteSetting(QStringLiteral("rng_seed"), Settings::values.rng_seed.value_or(0), 0);
|
||||||
|
|
|
@ -57,6 +57,7 @@ void ConfigureSystem::SetConfiguration() {
|
||||||
|
|
||||||
ui->combo_language->setCurrentIndex(Settings::values.language_index);
|
ui->combo_language->setCurrentIndex(Settings::values.language_index);
|
||||||
ui->combo_region->setCurrentIndex(Settings::values.region_index);
|
ui->combo_region->setCurrentIndex(Settings::values.region_index);
|
||||||
|
ui->combo_time_zone->setCurrentIndex(Settings::values.time_zone_index);
|
||||||
ui->combo_sound->setCurrentIndex(Settings::values.sound_index);
|
ui->combo_sound->setCurrentIndex(Settings::values.sound_index);
|
||||||
|
|
||||||
ui->rng_seed_checkbox->setChecked(Settings::values.rng_seed.has_value());
|
ui->rng_seed_checkbox->setChecked(Settings::values.rng_seed.has_value());
|
||||||
|
@ -84,6 +85,7 @@ void ConfigureSystem::ApplyConfiguration() {
|
||||||
|
|
||||||
Settings::values.language_index = ui->combo_language->currentIndex();
|
Settings::values.language_index = ui->combo_language->currentIndex();
|
||||||
Settings::values.region_index = ui->combo_region->currentIndex();
|
Settings::values.region_index = ui->combo_region->currentIndex();
|
||||||
|
Settings::values.time_zone_index = ui->combo_time_zone->currentIndex();
|
||||||
Settings::values.sound_index = ui->combo_sound->currentIndex();
|
Settings::values.sound_index = ui->combo_sound->currentIndex();
|
||||||
|
|
||||||
if (ui->rng_seed_checkbox->isChecked()) {
|
if (ui->rng_seed_checkbox->isChecked()) {
|
||||||
|
|
|
@ -37,5 +37,6 @@ private:
|
||||||
|
|
||||||
int language_index = 0;
|
int language_index = 0;
|
||||||
int region_index = 0;
|
int region_index = 0;
|
||||||
|
int time_zone_index = 0;
|
||||||
int sound_index = 0;
|
int sound_index = 0;
|
||||||
};
|
};
|
||||||
|
|
|
@ -22,14 +22,14 @@
|
||||||
<string>System Settings</string>
|
<string>System Settings</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="2" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="label_sound">
|
<widget class="QLabel" name="label_sound">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Sound output mode</string>
|
<string>Sound output mode</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QLabel" name="label_console_id">
|
<widget class="QLabel" name="label_console_id">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Console ID:</string>
|
<string>Console ID:</string>
|
||||||
|
@ -174,14 +174,255 @@
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_timezone">
|
||||||
|
<property name="text">
|
||||||
|
<string>Time Zone:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QComboBox" name="combo_time_zone">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Auto</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Default</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>CET</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>CST6CDT</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Cuba</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>EET</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Egypt</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Eire</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>EST</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>EST5EDT</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>GB</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>GB-Eire</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>GMT</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>GMT+0</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>GMT-0</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>GMT0</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Greenwich</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Hongkong</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>HST</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Iceland</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Iran</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Israel</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Jamaica</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Japan</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Kwajalein</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Libya</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>MET</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>MST</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>MST7MDT</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Navajo</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>NZ</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>NZ-CHAT</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Poland</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Portugal</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>PRC</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>PST8PDT</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>ROC</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>ROK</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Singapore</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Turkey</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>UCT</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Universal</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>UTC</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>W-SU</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>WET</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Zulu</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
<widget class="QCheckBox" name="rng_seed_checkbox">
|
<widget class="QCheckBox" name="rng_seed_checkbox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>RNG Seed</string>
|
<string>RNG Seed</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QComboBox" name="combo_sound">
|
<widget class="QComboBox" name="combo_sound">
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -207,7 +448,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="4" column="1">
|
||||||
<widget class="QPushButton" name="button_regenerate_console_id">
|
<widget class="QPushButton" name="button_regenerate_console_id">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
@ -223,14 +464,14 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QCheckBox" name="custom_rtc_checkbox">
|
<widget class="QCheckBox" name="custom_rtc_checkbox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Custom RTC</string>
|
<string>Custom RTC</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="5" column="1">
|
||||||
<widget class="QDateTimeEdit" name="custom_rtc_edit">
|
<widget class="QDateTimeEdit" name="custom_rtc_edit">
|
||||||
<property name="minimumDate">
|
<property name="minimumDate">
|
||||||
<date>
|
<date>
|
||||||
|
@ -244,7 +485,7 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="6" column="1">
|
||||||
<widget class="QLineEdit" name="rng_seed_edit">
|
<widget class="QLineEdit" name="rng_seed_edit">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
|
|
@ -367,6 +367,9 @@ void Config::ReadValues() {
|
||||||
Settings::values.custom_rtc = std::nullopt;
|
Settings::values.custom_rtc = std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Settings::values.language_index = sdl2_config->GetInteger("System", "language_index", 1);
|
||||||
|
Settings::values.time_zone_index = sdl2_config->GetInteger("System", "time_zone_index", 0);
|
||||||
|
|
||||||
// Core
|
// Core
|
||||||
Settings::values.use_multi_core = sdl2_config->GetBoolean("Core", "use_multi_core", false);
|
Settings::values.use_multi_core = sdl2_config->GetBoolean("Core", "use_multi_core", false);
|
||||||
|
|
||||||
|
@ -409,8 +412,6 @@ void Config::ReadValues() {
|
||||||
Settings::values.audio_device_id = sdl2_config->Get("Audio", "output_device", "auto");
|
Settings::values.audio_device_id = sdl2_config->Get("Audio", "output_device", "auto");
|
||||||
Settings::values.volume = static_cast<float>(sdl2_config->GetReal("Audio", "volume", 1));
|
Settings::values.volume = static_cast<float>(sdl2_config->GetReal("Audio", "volume", 1));
|
||||||
|
|
||||||
Settings::values.language_index = sdl2_config->GetInteger("System", "language_index", 1);
|
|
||||||
|
|
||||||
// Miscellaneous
|
// Miscellaneous
|
||||||
Settings::values.log_filter = sdl2_config->Get("Miscellaneous", "log_filter", "*:Trace");
|
Settings::values.log_filter = sdl2_config->Get("Miscellaneous", "log_filter", "*:Trace");
|
||||||
Settings::values.use_dev_keys = sdl2_config->GetBoolean("Miscellaneous", "use_dev_keys", false);
|
Settings::values.use_dev_keys = sdl2_config->GetBoolean("Miscellaneous", "use_dev_keys", false);
|
||||||
|
|
|
@ -262,6 +262,10 @@ language_index =
|
||||||
# -1: Auto-select (default), 0: Japan, 1: USA, 2: Europe, 3: Australia, 4: China, 5: Korea, 6: Taiwan
|
# -1: Auto-select (default), 0: Japan, 1: USA, 2: Europe, 3: Australia, 4: China, 5: Korea, 6: Taiwan
|
||||||
region_value =
|
region_value =
|
||||||
|
|
||||||
|
# The system time zone that yuzu will use during emulation
|
||||||
|
# 0: Auto-select (default), 1: Default (system archive value), Others: Index for specified time zone
|
||||||
|
time_zone_index =
|
||||||
|
|
||||||
[Miscellaneous]
|
[Miscellaneous]
|
||||||
# A filter which removes logs below a certain logging level.
|
# A filter which removes logs below a certain logging level.
|
||||||
# Examples: *:Debug Kernel.SVC:Trace Service.*:Critical
|
# Examples: *:Debug Kernel.SVC:Trace Service.*:Critical
|
||||||
|
|
Loading…
Reference in a new issue