mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-23 01:02:23 +08:00
Set menu language to game language on first run (#1577)
* feat(translations): set menu language to game language on first run * fix(translations): add exception handlers * fix: more exception handlers
This commit is contained in:
@ -30,14 +30,21 @@ namespace big
|
||||
auto file_path = item.path();
|
||||
if (file_path.extension() == ".json")
|
||||
{
|
||||
auto profile_file = std::ifstream(file_path, std::ios::binary);
|
||||
nlohmann::json j;
|
||||
profile_file >> j;
|
||||
profile_file.close();
|
||||
try
|
||||
{
|
||||
auto profile_file = std::ifstream(file_path, std::ios::binary);
|
||||
nlohmann::json j;
|
||||
profile_file >> j;
|
||||
profile_file.close();
|
||||
|
||||
m_handling_profiles.emplace(file_path.stem().string(), j.get<handling_profile>());
|
||||
m_handling_profiles.emplace(file_path.stem().string(), j.get<handling_profile>());
|
||||
|
||||
++files_loaded;
|
||||
++files_loaded;
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
LOG(WARNING) << "Failed to load " << file_path.filename() << ". " << e.what();
|
||||
}
|
||||
}
|
||||
// deprecate this
|
||||
else if (file_path.extension() == ".bin")
|
||||
@ -46,7 +53,7 @@ namespace big
|
||||
|
||||
auto profile_file = std::ifstream(file_path, std::ios::binary);
|
||||
auto profile = handling_profile();
|
||||
profile_file.read(reinterpret_cast<char*>(&profile), 328);// hardcoded old size to prevent overreading
|
||||
profile_file.read(reinterpret_cast<char*>(&profile), 328); // hardcoded old size to prevent overreading
|
||||
profile_file.close();
|
||||
|
||||
const auto new_save = file_path.stem().string();
|
||||
|
Reference in New Issue
Block a user