refactor!: File Manager (#1633)

* feat(vscode): added launch.json to dbg
* feat(file_manager): Make use of a global instance
* feat(file_manager): Allow for file and folder instances to be empty
* refactor(GlobalsService): Update code of global service (untested)
This commit is contained in:
Andreas Maerten
2023-07-08 17:54:59 +02:00
committed by GitHub
parent b8922a9dba
commit 5c6fb1064b
32 changed files with 185 additions and 208 deletions

View File

@ -30,8 +30,8 @@ namespace big
}
gta_data_service::gta_data_service() :
m_peds_cache(g_file_manager->get_project_file("./cache/peds.bin"), 5),
m_vehicles_cache(g_file_manager->get_project_file("./cache/vehicles.bin"), 4),
m_peds_cache(g_file_manager.get_project_file("./cache/peds.bin"), 5),
m_vehicles_cache(g_file_manager.get_project_file("./cache/vehicles.bin"), 4),
m_update_state(eGtaDataUpdateState::IDLE)
{
if (!is_cache_up_to_date())
@ -161,7 +161,7 @@ namespace big
m_peds_cache.load();
m_vehicles_cache.load();
auto weapons_file = g_file_manager->get_project_file("./cache/weapons.json");
auto weapons_file = g_file_manager.get_project_file("./cache/weapons.json");
if (weapons_file.exists())
{
std::ifstream file(weapons_file.get_path());
@ -593,7 +593,7 @@ namespace big
m_weapons_cache.weapon_components.insert({weapon_component.m_name, weapon_component});
}
auto weapons_file = big::g_file_manager->get_project_file("./cache/weapons.json");
auto weapons_file = g_file_manager.get_project_file("./cache/weapons.json");
std::ofstream file(weapons_file.get_path());
try
{