Automatically get float label type in most cases (#463)

* automatically get float type in most cases

* try harder to print json errors

* fix test
This commit is contained in:
water111
2021-05-11 21:57:05 -04:00
committed by GitHub
parent 0599d144f8
commit 223adeeb0c
8 changed files with 37 additions and 178 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ namespace {
nlohmann::json read_json_file_from_config(const nlohmann::json& cfg, const std::string& file_key) {
auto file_name = cfg.at(file_key).get<std::string>();
auto file_txt = file_util::read_text_file(file_util::get_file_path({file_name}));
return parse_commented_json(file_txt);
return parse_commented_json(file_txt, file_name);
}
} // namespace
@@ -25,7 +25,7 @@ nlohmann::json read_json_file_from_config(const nlohmann::json& cfg, const std::
Config read_config_file(const std::string& path_to_config_file) {
Config config;
auto config_str = file_util::read_text_file(path_to_config_file);
auto cfg = parse_commented_json(config_str);
auto cfg = parse_commented_json(config_str, path_to_config_file);
config.game_version = cfg.at("game_version").get<int>();