diff options
| author | 2018-10-09 21:48:35 -0400 | |
|---|---|---|
| committer | 2018-10-23 19:31:28 -0400 | |
| commit | e7e3d5898e4750e8ca8d859791dddf27705819b9 (patch) | |
| tree | b737963f0e36f72d62d9ddce60c9e647dba06790 /src/yuzu_cmd/config.cpp | |
| parent | Added Amiibo support (#1390) (diff) | |
| download | yuzu-e7e3d5898e4750e8ca8d859791dddf27705819b9.tar.gz yuzu-e7e3d5898e4750e8ca8d859791dddf27705819b9.tar.xz yuzu-e7e3d5898e4750e8ca8d859791dddf27705819b9.zip | |
settings: Add users and current_user settings and remove username
Diffstat (limited to 'src/yuzu_cmd/config.cpp')
| -rw-r--r-- | src/yuzu_cmd/config.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 654a15a5c..613894449 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -126,9 +126,25 @@ void Config::ReadValues() { | |||
| 126 | // System | 126 | // System |
| 127 | Settings::values.use_docked_mode = sdl2_config->GetBoolean("System", "use_docked_mode", false); | 127 | Settings::values.use_docked_mode = sdl2_config->GetBoolean("System", "use_docked_mode", false); |
| 128 | Settings::values.enable_nfc = sdl2_config->GetBoolean("System", "enable_nfc", true); | 128 | Settings::values.enable_nfc = sdl2_config->GetBoolean("System", "enable_nfc", true); |
| 129 | Settings::values.username = sdl2_config->Get("System", "username", "yuzu"); | 129 | const auto size = sdl2_config->GetInteger("System", "users_size", 0); |
| 130 | if (Settings::values.username.empty()) { | 130 | |
| 131 | Settings::values.username = "yuzu"; | 131 | Settings::values.users.clear(); |
| 132 | for (std::size_t i = 0; i < size; ++i) { | ||
| 133 | const auto uuid_low = std::stoull( | ||
| 134 | sdl2_config->Get("System", fmt::format("users_{}_uuid_low", i), "0"), nullptr, 0); | ||
| 135 | const auto uuid_high = std::stoull( | ||
| 136 | sdl2_config->Get("System", fmt::format("users_{}_uuid_high", i), "0"), nullptr, 0); | ||
| 137 | Settings::values.users.emplace_back( | ||
| 138 | sdl2_config->Get("System", fmt::format("users_{}_username", i), ""), | ||
| 139 | Service::Account::UUID{uuid_low, uuid_high}); | ||
| 140 | } | ||
| 141 | |||
| 142 | if (Settings::values.users.empty()) { | ||
| 143 | Settings::values.users.emplace_back("yuzu", Service::Account::UUID{1, 0}); | ||
| 144 | LOG_WARNING( | ||
| 145 | Config, | ||
| 146 | "You are using the default UUID of {1, 0}! This might cause issues down the road! " | ||
| 147 | "Please consider randomizing a UUID and adding it to the sdl2_config.ini file."); | ||
| 132 | } | 148 | } |
| 133 | 149 | ||
| 134 | // Miscellaneous | 150 | // Miscellaneous |